mbox series

[0/3] Remove duplicate code in btrfs_prune_dentries/find_next_inode

Message ID 20220721135006.3345302-1-nborisov@suse.com (mailing list archive)
Headers show
Series Remove duplicate code in btrfs_prune_dentries/find_next_inode | expand

Message

Nikolay Borisov July 21, 2022, 1:50 p.m. UTC
Both functions share similar logic to find a particular inode. So this series
first factors out the common code in btrfs_find_inode and subsequently uses it
to remove most of the internals of the two client functions. This greatly
streamlines the codeflow in the affected functions.

The changes survived a full xfstest run.

Nikolay Borisov (3):
  btrfs: introduce btrfs_find_inode
  btrfs: use btrfs_find_inode in btrfs_prune_dentries
  btrfs: use btrfs_find_inode in find_next_inode

 fs/btrfs/ctree.h      |  1 +
 fs/btrfs/inode.c      | 75 ++++++++++++++++++++++++++++++-------------
 fs/btrfs/relocation.c | 54 +++++++++++--------------------
 3 files changed, 73 insertions(+), 57 deletions(-)

--
2.25.1

Comments

Sweet Tea Dorminy July 21, 2022, 3:36 p.m. UTC | #1
checkpatch has a minor nit, while(node) needs to be while (node), but 
otherwise, for the series:

Reviewed-by: Sweet Tea Dorminy <sweettea-kernel@dorminy.me>

On 2022-07-21 09:50, Nikolay Borisov wrote:
> Both functions share similar logic to find a particular inode. So this 
> series
> first factors out the common code in btrfs_find_inode and subsequently 
> uses it
> to remove most of the internals of the two client functions. This 
> greatly
> streamlines the codeflow in the affected functions.
> 
> The changes survived a full xfstest run.
> 
> Nikolay Borisov (3):
>   btrfs: introduce btrfs_find_inode
>   btrfs: use btrfs_find_inode in btrfs_prune_dentries
>   btrfs: use btrfs_find_inode in find_next_inode
> 
>  fs/btrfs/ctree.h      |  1 +
>  fs/btrfs/inode.c      | 75 ++++++++++++++++++++++++++++++-------------
>  fs/btrfs/relocation.c | 54 +++++++++++--------------------
>  3 files changed, 73 insertions(+), 57 deletions(-)
> 
> --
> 2.25.1