Skip to content

Commit

Permalink
btrfs: Use list_empty instead of list_empty_careful
Browse files Browse the repository at this point in the history
list_empty_careful usually is a signal of something tricky going on. Its
usage in btrfs is actually not needed since both lists it's used on are
local to a function and cannot be modified concurrently. So switch to
plain list_empty. No functional changes.

Signed-off-by: Nikolay Borisov <nborisov@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
  • Loading branch information
lorddoskias authored and kdave committed May 28, 2018
1 parent 2a3ff0a commit 81f1d39
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fs/btrfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -10254,7 +10254,7 @@ static int __start_delalloc_inodes(struct btrfs_root *root, int delay_iput,
btrfs_wait_and_free_delalloc_work(work);
}

if (!list_empty_careful(&splice)) {
if (!list_empty(&splice)) {
spin_lock(&root->delalloc_lock);
list_splice_tail(&splice, &root->delalloc_inodes);
spin_unlock(&root->delalloc_lock);
Expand Down Expand Up @@ -10316,7 +10316,7 @@ int btrfs_start_delalloc_roots(struct btrfs_fs_info *fs_info, int delay_iput,

ret = 0;
out:
if (!list_empty_careful(&splice)) {
if (!list_empty(&splice)) {
spin_lock(&fs_info->delalloc_root_lock);
list_splice_tail(&splice, &fs_info->delalloc_roots);
spin_unlock(&fs_info->delalloc_root_lock);
Expand Down

0 comments on commit 81f1d39

Please sign in to comment.