mbox series

[00/16] btrfs: some cleanups for extent-io-tree (mostly renames)

Message ID cover.1744046765.git.fdmanana@suse.com (mailing list archive)
Headers show
Series btrfs: some cleanups for extent-io-tree (mostly renames) | expand

Message

Filipe Manana April 7, 2025, 5:36 p.m. UTC
From: Filipe Manana <fdmanana@suse.com>

These are mostly to rename exported functions so that they have a 'btrfs_'
prefix and follow coding style, to avoid potential clashes in the future
with other kernel functions defined elsewhere outside btrfs. As more
functions are added to extent-io-tree.h, there's a tendency to follow the
existing style and not add a 'btrfs_' prefix for consistency with the
other function names, so as time passes we get more exported functions
that don't follow the coding style by missing a 'btrfs_' prefix. I'm in
the process of adding another new exported function to extent-io-tree.h
and found my self unconfortable adding a 'btrfs_' prefix to it while the
other exported functions don't have one.

I tried to split the rename into several and more reasonably sized patches
to make it easier to review and also because a few do a bit more than
simply renaming, but with notes in the change logs.

Filipe Manana (16):
  btrfs: remove extent_io_tree_to_inode() and is_inode_io_tree()
  btrfs: add btrfs prefix to trace events for extent state alloc and free
  btrfs: add btrfs prefix to main lock, try lock and unlock extent functions
  btrfs: add btrfs prefix to dio lock and unlock extent functions
  btrfs: rename __lock_extent() and __try_lock_extent()
  btrfs: rename the functions to clear bits for an extent range
  btrfs: rename set_extent_bit() to include a btrfs prefix
  btrfs: rename the functions to search for bits in extent ranges
  btrfs: rename the functions to get inode and fs_info from an extent io tree
  btrfs: directly grab inode at __btrfs_debug_check_extent_io_range()
  btrfs: rename the functions to init and release an extent io tree
  btrfs: rename the functions to count, test and get bit ranges in io trees
  btrfs: rename free_extent_state() to include a btrfs prefix
  btrfs: rename remaining exported functions from extent-io-tree.h
  btrfs: remove double underscore prefix from __set_extent_bit()
  btrfs: make btrfs_find_contiguous_extent_bit() return bool instead of int

 fs/btrfs/block-group.c           |  34 ++---
 fs/btrfs/compression.c           |   6 +-
 fs/btrfs/defrag.c                |  36 ++---
 fs/btrfs/dev-replace.c           |  12 +-
 fs/btrfs/direct-io.c             |  38 +++---
 fs/btrfs/disk-io.c               |  35 ++---
 fs/btrfs/extent-io-tree.c        | 218 ++++++++++++++-----------------
 fs/btrfs/extent-io-tree.h        | 155 +++++++++++-----------
 fs/btrfs/extent-tree.c           |  38 +++---
 fs/btrfs/extent_io.c             |  40 +++---
 fs/btrfs/extent_map.c            |   4 +-
 fs/btrfs/fiemap.c                |   6 +-
 fs/btrfs/file-item.c             |  22 ++--
 fs/btrfs/file.c                  |  87 ++++++------
 fs/btrfs/free-space-cache.c      |  36 ++---
 fs/btrfs/inode.c                 | 167 +++++++++++------------
 fs/btrfs/ioctl.c                 |   8 +-
 fs/btrfs/ordered-data.c          |   8 +-
 fs/btrfs/qgroup.c                |  30 +++--
 fs/btrfs/reflink.c               |  12 +-
 fs/btrfs/relocation.c            |  61 ++++-----
 fs/btrfs/super.c                 |   4 +-
 fs/btrfs/tests/btrfs-tests.c     |   4 +-
 fs/btrfs/tests/extent-io-tests.c |  54 ++++----
 fs/btrfs/tests/inode-tests.c     |  24 ++--
 fs/btrfs/transaction.c           |  34 ++---
 fs/btrfs/tree-log.c              |  12 +-
 fs/btrfs/volumes.c               |  28 ++--
 include/trace/events/btrfs.h     |  16 +--
 29 files changed, 607 insertions(+), 622 deletions(-)

Comments

David Sterba April 7, 2025, 6:24 p.m. UTC | #1
On Mon, Apr 07, 2025 at 06:36:07PM +0100, fdmanana@kernel.org wrote:
> From: Filipe Manana <fdmanana@suse.com>
> 
> These are mostly to rename exported functions so that they have a 'btrfs_'
> prefix and follow coding style, to avoid potential clashes in the future
> with other kernel functions defined elsewhere outside btrfs. As more
> functions are added to extent-io-tree.h, there's a tendency to follow the
> existing style and not add a 'btrfs_' prefix for consistency with the
> other function names, so as time passes we get more exported functions
> that don't follow the coding style by missing a 'btrfs_' prefix. I'm in
> the process of adding another new exported function to extent-io-tree.h
> and found my self unconfortable adding a 'btrfs_' prefix to it while the
> other exported functions don't have one.
> 
> I tried to split the rename into several and more reasonably sized patches
> to make it easier to review and also because a few do a bit more than
> simply renaming, but with notes in the change logs.
> 
> Filipe Manana (16):
>   btrfs: remove extent_io_tree_to_inode() and is_inode_io_tree()
>   btrfs: add btrfs prefix to trace events for extent state alloc and free
>   btrfs: add btrfs prefix to main lock, try lock and unlock extent functions
>   btrfs: add btrfs prefix to dio lock and unlock extent functions
>   btrfs: rename __lock_extent() and __try_lock_extent()
>   btrfs: rename the functions to clear bits for an extent range
>   btrfs: rename set_extent_bit() to include a btrfs prefix
>   btrfs: rename the functions to search for bits in extent ranges
>   btrfs: rename the functions to get inode and fs_info from an extent io tree
>   btrfs: directly grab inode at __btrfs_debug_check_extent_io_range()
>   btrfs: rename the functions to init and release an extent io tree
>   btrfs: rename the functions to count, test and get bit ranges in io trees
>   btrfs: rename free_extent_state() to include a btrfs prefix
>   btrfs: rename remaining exported functions from extent-io-tree.h
>   btrfs: remove double underscore prefix from __set_extent_bit()
>   btrfs: make btrfs_find_contiguous_extent_bit() return bool instead of int

Reviewed-by: David Sterba <dsterba@suse.com>

Fairbly big number of changes so stable backports may not apply cleanly,
but it's a change that should have been done long time ago.
Johannes Thumshirn April 8, 2025, 6:24 a.m. UTC | #2
Looks good,
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>