mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-21 14:11:20 +00:00
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>
This commit is contained in:
parent
3b2fd80160
commit
3cf5068f3d
2 changed files with 7 additions and 22 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue