diff options
author | David S. Miller <davem@davemloft.net> | 2018-01-29 10:14:59 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-01-29 10:15:51 -0500 |
commit | 3e3ab9ccca5b50b11bd4d16c2048b667343354bd (patch) | |
tree | 7279f7401e7cc2b93fb7cb2bff894b5385429a68 /fs/btrfs | |
parent | 868c36dcc949c26bc74fa4661b670d9acc6489e4 (diff) | |
parent | ba804bb4b72e57374b5f567b783aa0298fba0ce6 (diff) | |
download | linux-3e3ab9ccca5b50b11bd4d16c2048b667343354bd.tar.gz linux-3e3ab9ccca5b50b11bd4d16c2048b667343354bd.tar.bz2 linux-3e3ab9ccca5b50b11bd4d16c2048b667343354bd.zip |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'fs/btrfs')
-rw-r--r-- | fs/btrfs/delayed-inode.c | 26 |
1 files changed, 8 insertions, 18 deletions
diff --git a/fs/btrfs/delayed-inode.c b/fs/btrfs/delayed-inode.c index 056276101c63..a6226cd6063c 100644 --- a/fs/btrfs/delayed-inode.c +++ b/fs/btrfs/delayed-inode.c @@ -1633,28 +1633,18 @@ void btrfs_readdir_put_delayed_items(struct inode *inode, int btrfs_should_delete_dir_index(struct list_head *del_list, u64 index) { - struct btrfs_delayed_item *curr, *next; - int ret; - - if (list_empty(del_list)) - return 0; + struct btrfs_delayed_item *curr; + int ret = 0; - list_for_each_entry_safe(curr, next, del_list, readdir_list) { + list_for_each_entry(curr, del_list, readdir_list) { if (curr->key.offset > index) break; - - list_del(&curr->readdir_list); - ret = (curr->key.offset == index); - - if (refcount_dec_and_test(&curr->refs)) - kfree(curr); - - if (ret) - return 1; - else - continue; + if (curr->key.offset == index) { + ret = 1; + break; + } } - return 0; + return ret; } /* |