From f963e0128b180e8ab501bf1d5772fce17c36d68f Mon Sep 17 00:00:00 2001 From: David Sterba Date: Wed, 23 Apr 2025 18:53:57 +0200 Subject: btrfs: trivial conversion to return bool instead of int Old code has a lot of int for bool return values, bool is recommended and done in new code. Convert the trivial cases that do simple 0/false and 1/true. Functions comment are updated if needed. Reviewed-by: Naohiro Aota Signed-off-by: David Sterba --- fs/btrfs/inode.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'fs/btrfs/inode.c') diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 7f64725b95b3..925a3c880d36 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -3733,9 +3733,9 @@ out: * * slot is the slot the inode is in, objectid is the objectid of the inode */ -static noinline int acls_after_inode_item(struct extent_buffer *leaf, - int slot, u64 objectid, - int *first_xattr_slot) +static noinline bool acls_after_inode_item(struct extent_buffer *leaf, + int slot, u64 objectid, + int *first_xattr_slot) { u32 nritems = btrfs_header_nritems(leaf); struct btrfs_key found_key; @@ -3757,7 +3757,7 @@ static noinline int acls_after_inode_item(struct extent_buffer *leaf, /* we found a different objectid, there must not be acls */ if (found_key.objectid != objectid) - return 0; + return false; /* we found an xattr, assume we've got an acl */ if (found_key.type == BTRFS_XATTR_ITEM_KEY) { @@ -3765,7 +3765,7 @@ static noinline int acls_after_inode_item(struct extent_buffer *leaf, *first_xattr_slot = slot; if (found_key.offset == xattr_access || found_key.offset == xattr_default) - return 1; + return true; } /* @@ -3773,7 +3773,7 @@ static noinline int acls_after_inode_item(struct extent_buffer *leaf, * be any acls later on */ if (found_key.type > BTRFS_XATTR_ITEM_KEY) - return 0; + return false; slot++; scanned++; @@ -3793,7 +3793,7 @@ static noinline int acls_after_inode_item(struct extent_buffer *leaf, */ if (*first_xattr_slot == -1) *first_xattr_slot = slot; - return 1; + return true; } static int btrfs_init_file_extent_tree(struct btrfs_inode *inode) -- cgit