diff options
author | Liu Bo <bo.liu@linux.alibaba.com> | 2018-09-12 06:06:26 +0800 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2018-10-15 17:23:30 +0200 |
commit | 3cf5068f3d068d788871b0da1a0348048e68b9d6 (patch) | |
tree | 1ffbf067fbf99d96f4c9f86268bdef79ce41d8c8 /fs/btrfs/send.c | |
parent | 3b2fd8016069de59f73caca06f7ad60c25f3eb92 (diff) |
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 'fs/btrfs/send.c')
-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); |