mbox series

[00/15] btrfs: strip out btrfs_fs_info dependencies

Message ID cover.1663196541.git.josef@toxicpanda.com (mailing list archive)
Headers show
Series btrfs: strip out btrfs_fs_info dependencies | expand

Message

Josef Bacik Sept. 14, 2022, 11:04 p.m. UTC
Part of the cleaning up of ctree.h is being able to move btrfs_fs_info out of
it.  This is actually pretty difficult because we essentially rely on ctree.h
being included before everything else, so all other header files have fs_info
defined for their helpers.

This series starts this work.  There are a variety of other small moves as well,
but the bulk is trying to pull any helpers that access fs_info members inside of
their header files into their respective c files, or alternatively reworking the
code to drop the dependency.  Thanks,

Josef

Josef Bacik (15):
  btrfs: move btrfs_caching_type to block-group.h
  btrfs: move btrfs_full_stripe_locks_tree into block-group.h
  btrfs: move btrfs_init_async_reclaim_work prototype to space-info.h
  btrfs: move btrfs_pinned_by_swapfile prototype into volumes.h
  btrfs: remove temporary btrfs_map_token declaration in ctree.h
  btrfs: move static_assert() for btrfs_super_block into fs.c
  btrfs: move btrfs_swapfile_pin into volumes.h
  btrfs: move fs_info struct declarations to the top of ctree.h
  btrfs: move btrfs_csum_ptr to inode.c
  btrfs: move the fs_info related helpers closer to fs_info in ctree.h
  btrfs: move btrfs_ordered_sum_size into file-item.c
  btrfs: delete btrfs_inode_sectorsize helper
  btrfs: delete btrfs_insert_inode_hash helper
  btrfs: use a runtime flag to indicate an inode is a free space inode
  btrfs: add struct declarations in dev-replace.h

 fs/btrfs/block-group.c  |   3 +-
 fs/btrfs/block-group.h  |  15 +++
 fs/btrfs/btrfs_inode.h  |  22 +---
 fs/btrfs/ctree.h        | 260 ++++++++++++++++------------------------
 fs/btrfs/dev-replace.h  |   4 +
 fs/btrfs/disk-io.c      |   4 +-
 fs/btrfs/extent_io.c    |   4 +-
 fs/btrfs/file-item.c    |  12 ++
 fs/btrfs/file.c         |  11 +-
 fs/btrfs/fs.c           |   2 +
 fs/btrfs/inode.c        |  13 ++
 fs/btrfs/ordered-data.h |  12 --
 fs/btrfs/space-info.h   |   1 +
 fs/btrfs/volumes.h      |  26 ++++
 14 files changed, 188 insertions(+), 201 deletions(-)

Comments

David Sterba Sept. 20, 2022, 11:44 a.m. UTC | #1
On Wed, Sep 14, 2022 at 07:04:36PM -0400, Josef Bacik wrote:
> Part of the cleaning up of ctree.h is being able to move btrfs_fs_info out of
> it.  This is actually pretty difficult because we essentially rely on ctree.h
> being included before everything else, so all other header files have fs_info
> defined for their helpers.
> 
> This series starts this work.  There are a variety of other small moves as well,
> but the bulk is trying to pull any helpers that access fs_info members inside of
> their header files into their respective c files, or alternatively reworking the
> code to drop the dependency.  Thanks,
> 
> Josef
> 
> Josef Bacik (15):
>   btrfs: move btrfs_caching_type to block-group.h
>   btrfs: move btrfs_full_stripe_locks_tree into block-group.h
>   btrfs: move btrfs_init_async_reclaim_work prototype to space-info.h
>   btrfs: move btrfs_pinned_by_swapfile prototype into volumes.h
>   btrfs: remove temporary btrfs_map_token declaration in ctree.h
>   btrfs: move static_assert() for btrfs_super_block into fs.c
>   btrfs: move btrfs_swapfile_pin into volumes.h
>   btrfs: move fs_info struct declarations to the top of ctree.h
>   btrfs: move btrfs_csum_ptr to inode.c
>   btrfs: move the fs_info related helpers closer to fs_info in ctree.h
>   btrfs: move btrfs_ordered_sum_size into file-item.c
>   btrfs: delete btrfs_inode_sectorsize helper
>   btrfs: delete btrfs_insert_inode_hash helper
>   btrfs: use a runtime flag to indicate an inode is a free space inode
>   btrfs: add struct declarations in dev-replace.h

All are safe changes, I've added it to misc-next, except the
static_assert patch (6/15) that would need to be slightly changed.