Re: [PATCH 2/3] btrfs: Make btrfs_find_name_in_ext_backref return struct btrfs_inode_extref

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Aug 27, 2019 at 02:46:29PM +0300, Nikolay Borisov wrote:
> btrfs_find_name_in_ext_backref returns either 0/1 depending on whether it
> found a backref for the given name. If it returns true then the actual
> inode_ref struct is returned in one of its parameters. That's pointless,
> instead refactor the function such that it returns either a pointer
> to the btrfs_inode_extref or NULL it it didn't find anything. This
> streamlines the function calling convention.
> 
> Signed-off-by: Nikolay Borisov <nborisov@xxxxxxxx>
> ---
>  fs/btrfs/ctree.h      |  9 ++++-----
>  fs/btrfs/inode-item.c | 33 +++++++++++++--------------------
>  fs/btrfs/tree-log.c   |  6 +++---
>  3 files changed, 20 insertions(+), 28 deletions(-)
> 
> diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
> index 11312aeb6ff6..8b9469df8e3f 100644
> --- a/fs/btrfs/ctree.h
> +++ b/fs/btrfs/ctree.h
> @@ -2863,11 +2863,10 @@ btrfs_lookup_inode_extref(struct btrfs_trans_handle *trans,
>  struct btrfs_inode_ref *btrfs_find_name_in_backref(struct extent_buffer *leaf,
>  						   int slot, const char *name,
>  						   int name_len);
> -int btrfs_find_name_in_ext_backref(struct extent_buffer *leaf, int slot,
> -				   u64 ref_objectid, const char *name,
> -				   int name_len,
> -				   struct btrfs_inode_extref **extref_ret);
> -
> +struct btrfs_inode_extref *
> +btrfs_find_name_in_ext_backref(struct extent_buffer *leaf, int slot,
> +			       u64 ref_objectid, const char *name,
> +			       int name_len);

Please use the common style for function declarations/definitions with
type and name on one line.



[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux