mbox series

[0/5] Make real_root used only in ref-verify

Message ID 20211011101019.1409855-1-nborisov@suse.com (mailing list archive)
Headers show
Series Make real_root used only in ref-verify | expand

Message

Nikolay Borisov Oct. 11, 2021, 10:10 a.m. UTC
Here's a small series that refactors the way btrfs_ref::real_root and
btrfs_ref::skip_qgroup are used. Currently the former is used in ref-verify but
also in order to perform the is_fstree() check on it in delayed-ref core. Given
the complexity and amount of information that the delayed ref machinery hauls
around it becomes really non-evident that delrefs really don't care about
real_root itself but rather only if qgroup processing should happen or not.

Instead of having the check burried in the core this series changes the data
flow in such a way that real_root will only be used for ref-verify's operation
and 'skip_qgroup' will contains the final condition of whether qgroup processing
should take place for a given delref.


Nikolay Borisov (5):
  btrfs: Rename root fields in delayed refs structs
  btrfs: Rely on owning_root field in btrfs_add_delayed_tree_ref to
    detect CHUNK_ROOT
  btrfs: Add additional parameters to
    btrfs_init_tree_ref/btrfs_init_data_ref
  btrfs: pull up qgroup checks from delayed-ref core to init time
  btrfs: make real_root optional

 fs/btrfs/delayed-ref.c | 19 +++++++++---------
 fs/btrfs/delayed-ref.h | 44 +++++++++++++++++++++---------------------
 fs/btrfs/extent-tree.c | 32 +++++++++++++++---------------
 fs/btrfs/file.c        | 13 ++++++++-----
 fs/btrfs/inode.c       |  4 ++--
 fs/btrfs/ref-verify.c  |  4 ++--
 fs/btrfs/relocation.c  | 28 +++++++++++++--------------
 fs/btrfs/tree-log.c    |  2 +-
 8 files changed, 74 insertions(+), 72 deletions(-)

--
2.25.1

Comments

David Sterba Oct. 11, 2021, 3:08 p.m. UTC | #1
On Mon, Oct 11, 2021 at 01:10:14PM +0300, Nikolay Borisov wrote:
> Here's a small series that refactors the way btrfs_ref::real_root and
> btrfs_ref::skip_qgroup are used. Currently the former is used in ref-verify but
> also in order to perform the is_fstree() check on it in delayed-ref core. Given
> the complexity and amount of information that the delayed ref machinery hauls
> around it becomes really non-evident that delrefs really don't care about
> real_root itself but rather only if qgroup processing should happen or not.
> 
> Instead of having the check burried in the core this series changes the data
> flow in such a way that real_root will only be used for ref-verify's operation
> and 'skip_qgroup' will contains the final condition of whether qgroup processing
> should take place for a given delref.
> 
> 
> Nikolay Borisov (5):
>   btrfs: Rename root fields in delayed refs structs
>   btrfs: Rely on owning_root field in btrfs_add_delayed_tree_ref to
>     detect CHUNK_ROOT
>   btrfs: Add additional parameters to
>     btrfs_init_tree_ref/btrfs_init_data_ref
>   btrfs: pull up qgroup checks from delayed-ref core to init time
>   btrfs: make real_root optional

I'll add the branch as-is to for-next so we have some testing coverage,
the suggested changes should not change functionality.