diff options
| author | Filipe Manana <[email protected]> | 2025-05-31 14:41:41 +0000 |
|---|---|---|
| committer | David Sterba <[email protected]> | 2025-07-21 21:53:30 +0000 |
| commit | 4106eb9bdae662e6ba14f1b55a33c8a2489ff86b (patch) | |
| tree | 2a9af936fffc8518a050282b1a338187a8dae492 | |
| parent | btrfs: add details to error messages at btrfs_delete_delayed_dir_index() (diff) | |
| download | kernel-4106eb9bdae662e6ba14f1b55a33c8a2489ff86b.tar.gz kernel-4106eb9bdae662e6ba14f1b55a33c8a2489ff86b.zip | |
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 <[email protected]>
Signed-off-by: Filipe Manana <[email protected]>
Reviewed-by: David Sterba <[email protected]>
Signed-off-by: David Sterba <[email protected]>
| -rw-r--r-- | fs/btrfs/delayed-inode.c | 7 | ||||
| -rw-r--r-- | fs/btrfs/delayed-inode.h | 3 |
2 files changed, 4 insertions, 6 deletions
diff --git a/fs/btrfs/delayed-inode.c b/fs/btrfs/delayed-inode.c index 1e9bec6d24f7..050723ade942 100644 --- a/fs/btrfs/delayed-inode.c +++ b/fs/btrfs/delayed-inode.c @@ -1734,17 +1734,16 @@ void btrfs_readdir_put_delayed_items(struct btrfs_inode *inode, downgrade_write(&inode->vfs_inode.i_rwsem); } -int btrfs_should_delete_dir_index(const struct list_head *del_list, - u64 index) +bool btrfs_should_delete_dir_index(const struct list_head *del_list, u64 index) { struct btrfs_delayed_item *curr; - int ret = 0; + bool ret = false; list_for_each_entry(curr, del_list, readdir_list) { if (curr->index > index) break; if (curr->index == index) { - ret = 1; + ret = true; break; } } diff --git a/fs/btrfs/delayed-inode.h b/fs/btrfs/delayed-inode.h index c4b4ba122beb..73d13fac8917 100644 --- a/fs/btrfs/delayed-inode.h +++ b/fs/btrfs/delayed-inode.h @@ -150,8 +150,7 @@ bool btrfs_readdir_get_delayed_items(struct btrfs_inode *inode, void btrfs_readdir_put_delayed_items(struct btrfs_inode *inode, struct list_head *ins_list, struct list_head *del_list); -int btrfs_should_delete_dir_index(const struct list_head *del_list, - u64 index); +bool btrfs_should_delete_dir_index(const struct list_head *del_list, u64 index); int btrfs_readdir_delayed_dir_index(struct dir_context *ctx, const struct list_head *ins_list); |
