diff options
author | NeilBrown <neilb@suse.com> | 2017-12-18 11:46:30 +1100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-01-08 16:03:45 +0100 |
commit | 915fd1c2d1c4b05efda7975f992d54244178bc93 (patch) | |
tree | 80f1a3ff85b5f35d80e09db483a74a082317a7d8 /drivers/staging/lustre | |
parent | ee3b1e23bd759b57a964dd66ee835350ae4873dd (diff) | |
download | linux-stable-915fd1c2d1c4b05efda7975f992d54244178bc93.tar.gz linux-stable-915fd1c2d1c4b05efda7975f992d54244178bc93.tar.bz2 linux-stable-915fd1c2d1c4b05efda7975f992d54244178bc93.zip |
staging: lustre: lnet: discard CFS_ALLOC_PTR
These trivial wrappers hurt readability and
as they use kvmalloc, they are overly generic.
So discard them and use kmalloc/kfree as is
normal in Linux.
Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/lustre')
-rw-r--r-- | drivers/staging/lustre/include/linux/libcfs/libcfs_private.h | 3 | ||||
-rw-r--r-- | drivers/staging/lustre/lnet/lnet/net_fault.c | 10 |
2 files changed, 5 insertions, 8 deletions
diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_private.h b/drivers/staging/lustre/include/linux/libcfs/libcfs_private.h index 940200ee632e..d230c7f7cced 100644 --- a/drivers/staging/lustre/include/linux/libcfs/libcfs_private.h +++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_private.h @@ -215,9 +215,6 @@ do { \ #define LASSERT_ATOMIC_ZERO(a) LASSERT_ATOMIC_EQ(a, 0) #define LASSERT_ATOMIC_POS(a) LASSERT_ATOMIC_GT(a, 0) -#define CFS_ALLOC_PTR(ptr) LIBCFS_ALLOC(ptr, sizeof(*(ptr))) -#define CFS_FREE_PTR(ptr) LIBCFS_FREE(ptr, sizeof(*(ptr))) - /* implication */ #define ergo(a, b) (!(a) || (b)) /* logical equivalence */ diff --git a/drivers/staging/lustre/lnet/lnet/net_fault.c b/drivers/staging/lustre/lnet/lnet/net_fault.c index 0ee7e20ba151..e3468cef273b 100644 --- a/drivers/staging/lustre/lnet/lnet/net_fault.c +++ b/drivers/staging/lustre/lnet/lnet/net_fault.c @@ -161,7 +161,7 @@ lnet_drop_rule_add(struct lnet_fault_attr *attr) if (lnet_fault_attr_validate(attr)) return -EINVAL; - CFS_ALLOC_PTR(rule); + rule = kzalloc(sizeof(*rule), GFP_NOFS); if (!rule) return -ENOMEM; @@ -223,7 +223,7 @@ lnet_drop_rule_del(lnet_nid_t src, lnet_nid_t dst) rule->dr_attr.u.drop.da_interval); list_del(&rule->dr_link); - CFS_FREE_PTR(rule); + kfree(rule); n++; } @@ -452,7 +452,7 @@ delay_rule_decref(struct lnet_delay_rule *rule) LASSERT(list_empty(&rule->dl_msg_list)); LASSERT(list_empty(&rule->dl_link)); - CFS_FREE_PTR(rule); + kfree(rule); } } @@ -739,7 +739,7 @@ lnet_delay_rule_add(struct lnet_fault_attr *attr) if (lnet_fault_attr_validate(attr)) return -EINVAL; - CFS_ALLOC_PTR(rule); + rule = kzalloc(sizeof(*rule), GFP_NOFS); if (!rule) return -ENOMEM; @@ -793,7 +793,7 @@ lnet_delay_rule_add(struct lnet_fault_attr *attr) return 0; failed: mutex_unlock(&delay_dd.dd_mutex); - CFS_FREE_PTR(rule); + kfree(rule); return rc; } |