Skip to content

Commit b29b7b9

Browse files
fdmananakdave
authored andcommitted
btrfs: make btrfs_should_delete_dir_index() return a bool instead
There's no need to return errors and we currently return 1 in case the index should be deleted and 0 otherwise, so change the return type from int to bool as this is a boolean function and it's more clear this way. Reviewed-by: Boris Burkov <boris@bur.io> Signed-off-by: Filipe Manana <fdmanana@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
1 parent ff8af8f commit b29b7b9

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

fs/btrfs/delayed-inode.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1734,17 +1734,16 @@ void btrfs_readdir_put_delayed_items(struct btrfs_inode *inode,
17341734
downgrade_write(&inode->vfs_inode.i_rwsem);
17351735
}
17361736

1737-
int btrfs_should_delete_dir_index(const struct list_head *del_list,
1738-
u64 index)
1737+
bool btrfs_should_delete_dir_index(const struct list_head *del_list, u64 index)
17391738
{
17401739
struct btrfs_delayed_item *curr;
1741-
int ret = 0;
1740+
bool ret = false;
17421741

17431742
list_for_each_entry(curr, del_list, readdir_list) {
17441743
if (curr->index > index)
17451744
break;
17461745
if (curr->index == index) {
1747-
ret = 1;
1746+
ret = true;
17481747
break;
17491748
}
17501749
}

fs/btrfs/delayed-inode.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,7 @@ bool btrfs_readdir_get_delayed_items(struct btrfs_inode *inode,
150150
void btrfs_readdir_put_delayed_items(struct btrfs_inode *inode,
151151
struct list_head *ins_list,
152152
struct list_head *del_list);
153-
int btrfs_should_delete_dir_index(const struct list_head *del_list,
154-
u64 index);
153+
bool btrfs_should_delete_dir_index(const struct list_head *del_list, u64 index);
155154
int btrfs_readdir_delayed_dir_index(struct dir_context *ctx,
156155
const struct list_head *ins_list);
157156

0 commit comments

Comments
 (0)