Commit 915fd1c2 authored by NeilBrown's avatar NeilBrown Committed by Greg Kroah-Hartman

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: default avatarNeilBrown <neilb@suse.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent ee3b1e23
...@@ -215,9 +215,6 @@ do { \ ...@@ -215,9 +215,6 @@ do { \
#define LASSERT_ATOMIC_ZERO(a) LASSERT_ATOMIC_EQ(a, 0) #define LASSERT_ATOMIC_ZERO(a) LASSERT_ATOMIC_EQ(a, 0)
#define LASSERT_ATOMIC_POS(a) LASSERT_ATOMIC_GT(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 */ /* implication */
#define ergo(a, b) (!(a) || (b)) #define ergo(a, b) (!(a) || (b))
/* logical equivalence */ /* logical equivalence */
......
...@@ -161,7 +161,7 @@ lnet_drop_rule_add(struct lnet_fault_attr *attr) ...@@ -161,7 +161,7 @@ lnet_drop_rule_add(struct lnet_fault_attr *attr)
if (lnet_fault_attr_validate(attr)) if (lnet_fault_attr_validate(attr))
return -EINVAL; return -EINVAL;
CFS_ALLOC_PTR(rule); rule = kzalloc(sizeof(*rule), GFP_NOFS);
if (!rule) if (!rule)
return -ENOMEM; return -ENOMEM;
...@@ -223,7 +223,7 @@ lnet_drop_rule_del(lnet_nid_t src, lnet_nid_t dst) ...@@ -223,7 +223,7 @@ lnet_drop_rule_del(lnet_nid_t src, lnet_nid_t dst)
rule->dr_attr.u.drop.da_interval); rule->dr_attr.u.drop.da_interval);
list_del(&rule->dr_link); list_del(&rule->dr_link);
CFS_FREE_PTR(rule); kfree(rule);
n++; n++;
} }
...@@ -452,7 +452,7 @@ delay_rule_decref(struct lnet_delay_rule *rule) ...@@ -452,7 +452,7 @@ delay_rule_decref(struct lnet_delay_rule *rule)
LASSERT(list_empty(&rule->dl_msg_list)); LASSERT(list_empty(&rule->dl_msg_list));
LASSERT(list_empty(&rule->dl_link)); 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) ...@@ -739,7 +739,7 @@ lnet_delay_rule_add(struct lnet_fault_attr *attr)
if (lnet_fault_attr_validate(attr)) if (lnet_fault_attr_validate(attr))
return -EINVAL; return -EINVAL;
CFS_ALLOC_PTR(rule); rule = kzalloc(sizeof(*rule), GFP_NOFS);
if (!rule) if (!rule)
return -ENOMEM; return -ENOMEM;
...@@ -793,7 +793,7 @@ lnet_delay_rule_add(struct lnet_fault_attr *attr) ...@@ -793,7 +793,7 @@ lnet_delay_rule_add(struct lnet_fault_attr *attr)
return 0; return 0;
failed: failed:
mutex_unlock(&delay_dd.dd_mutex); mutex_unlock(&delay_dd.dd_mutex);
CFS_FREE_PTR(rule); kfree(rule);
return rc; return rc;
} }
......
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