Commit 5d99a998 authored by David Sterba's avatar David Sterba

btrfs: remove unlikely from NULL checks

Unlikely is implicit for NULL checks of pointers.
Signed-off-by: default avatarDavid Sterba <dsterba@suse.cz>
parent 1d52c78a
...@@ -92,7 +92,7 @@ __btrfs_alloc_workqueue(const char *name, int flags, int max_active, ...@@ -92,7 +92,7 @@ __btrfs_alloc_workqueue(const char *name, int flags, int max_active,
{ {
struct __btrfs_workqueue *ret = kzalloc(sizeof(*ret), GFP_NOFS); struct __btrfs_workqueue *ret = kzalloc(sizeof(*ret), GFP_NOFS);
if (unlikely(!ret)) if (!ret)
return NULL; return NULL;
ret->max_active = max_active; ret->max_active = max_active;
...@@ -116,7 +116,7 @@ __btrfs_alloc_workqueue(const char *name, int flags, int max_active, ...@@ -116,7 +116,7 @@ __btrfs_alloc_workqueue(const char *name, int flags, int max_active,
ret->normal_wq = alloc_workqueue("%s-%s", flags, ret->normal_wq = alloc_workqueue("%s-%s", flags,
ret->max_active, "btrfs", ret->max_active, "btrfs",
name); name);
if (unlikely(!ret->normal_wq)) { if (!ret->normal_wq) {
kfree(ret); kfree(ret);
return NULL; return NULL;
} }
...@@ -138,12 +138,12 @@ struct btrfs_workqueue *btrfs_alloc_workqueue(const char *name, ...@@ -138,12 +138,12 @@ struct btrfs_workqueue *btrfs_alloc_workqueue(const char *name,
{ {
struct btrfs_workqueue *ret = kzalloc(sizeof(*ret), GFP_NOFS); struct btrfs_workqueue *ret = kzalloc(sizeof(*ret), GFP_NOFS);
if (unlikely(!ret)) if (!ret)
return NULL; return NULL;
ret->normal = __btrfs_alloc_workqueue(name, flags & ~WQ_HIGHPRI, ret->normal = __btrfs_alloc_workqueue(name, flags & ~WQ_HIGHPRI,
max_active, thresh); max_active, thresh);
if (unlikely(!ret->normal)) { if (!ret->normal) {
kfree(ret); kfree(ret);
return NULL; return NULL;
} }
...@@ -151,7 +151,7 @@ struct btrfs_workqueue *btrfs_alloc_workqueue(const char *name, ...@@ -151,7 +151,7 @@ struct btrfs_workqueue *btrfs_alloc_workqueue(const char *name,
if (flags & WQ_HIGHPRI) { if (flags & WQ_HIGHPRI) {
ret->high = __btrfs_alloc_workqueue(name, flags, max_active, ret->high = __btrfs_alloc_workqueue(name, flags, max_active,
thresh); thresh);
if (unlikely(!ret->high)) { if (!ret->high) {
__btrfs_destroy_workqueue(ret->normal); __btrfs_destroy_workqueue(ret->normal);
kfree(ret); kfree(ret);
return NULL; return NULL;
......
...@@ -9013,7 +9013,7 @@ static int __start_delalloc_inodes(struct btrfs_root *root, int delay_iput, ...@@ -9013,7 +9013,7 @@ static int __start_delalloc_inodes(struct btrfs_root *root, int delay_iput,
spin_unlock(&root->delalloc_lock); spin_unlock(&root->delalloc_lock);
work = btrfs_alloc_delalloc_work(inode, 0, delay_iput); work = btrfs_alloc_delalloc_work(inode, 0, delay_iput);
if (unlikely(!work)) { if (!work) {
if (delay_iput) if (delay_iput)
btrfs_add_delayed_iput(inode); btrfs_add_delayed_iput(inode);
else else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment