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>
#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 */
if (lnet_fault_attr_validate(attr))
return -EINVAL;
- CFS_ALLOC_PTR(rule);
+ rule = kzalloc(sizeof(*rule), GFP_NOFS);
if (!rule)
return -ENOMEM;
rule->dr_attr.u.drop.da_interval);
list_del(&rule->dr_link);
- CFS_FREE_PTR(rule);
+ kfree(rule);
n++;
}
LASSERT(list_empty(&rule->dl_msg_list));
LASSERT(list_empty(&rule->dl_link));
- CFS_FREE_PTR(rule);
+ kfree(rule);
}
}
if (lnet_fault_attr_validate(attr))
return -EINVAL;
- CFS_ALLOC_PTR(rule);
+ rule = kzalloc(sizeof(*rule), GFP_NOFS);
if (!rule)
return -ENOMEM;
return 0;
failed:
mutex_unlock(&delay_dd.dd_mutex);
- CFS_FREE_PTR(rule);
+ kfree(rule);
return rc;
}