Re: [PATCH v5 09/18] btrfs: track owning root in btrfs_ref

Josef Bacik
2023-08-21T18:05:29Z

On Thu, Jul 27, 2023 at 03:12:56PM -0700, Boris Burkov wrote:
> While data extents require us to store additional inline refs to track
> the original owner on free, this information is available implicitly for
> metadata. It is found in the owner field of the header of the tree
> block. Even if other trees refer to this block and the original ref goes
> away, we will not rewrite that header field, so it will reliably give the
> original owner.
>
> In addition, there is a relocation case where a new data extent needs to
> have an owning root separate from the referring root wired through
> delayed refs.
>
> To use it for recording simple quota deltas, we need to wire this root
> id through from when we create the delayed ref until we fully process
> it. Store it in the generic btrfs_ref struct of the delayed ref.
>
> Signed-off-by: Boris Burkov <boris@bur.io>

Reviewed-by: Josef Bacik <josef@toxicpanda.com>

Thanks,

Josef