diff options
author | Liu Bo <bo.liu@linux.alibaba.com> | 2018-09-12 00:06:26 +0200 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2018-10-15 17:23:30 +0200 |
commit | 3cf5068f3d068d788871b0da1a0348048e68b9d6 (patch) | |
tree | 1ffbf067fbf99d96f4c9f86268bdef79ce41d8c8 /fs/btrfs/send.c | |
parent | Btrfs: use args in the correct order for kcalloc in btrfsic_read_block (diff) | |
download | linux-3cf5068f3d068d788871b0da1a0348048e68b9d6.tar.xz linux-3cf5068f3d068d788871b0da1a0348048e68b9d6.zip |
Btrfs: unify error handling of btrfs_lookup_dir_item
Unify the error handling of directory item lookups using IS_ERR_OR_NULL.
No functional changes.
Signed-off-by: Liu Bo <bo.liu@linux.alibaba.com>
Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to '')
-rw-r--r-- | fs/btrfs/send.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/fs/btrfs/send.c b/fs/btrfs/send.c index bd5756504709..094cc1444a90 100644 --- a/fs/btrfs/send.c +++ b/fs/btrfs/send.c @@ -1693,12 +1693,8 @@ static int lookup_dir_item_inode(struct btrfs_root *root, di = btrfs_lookup_dir_item(NULL, root, path, dir, name, name_len, 0); - if (!di) { - ret = -ENOENT; - goto out; - } - if (IS_ERR(di)) { - ret = PTR_ERR(di); + if (IS_ERR_OR_NULL(di)) { + ret = di ? PTR_ERR(di) : -ENOENT; goto out; } btrfs_dir_item_key_to_cpu(path->nodes[0], di, &key); |