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 | ee3b1e23bd759b57a964dd66ee835350ae4873dd (patch) | |
tree | 1332453bc84caea380bfa5091de0aa706c87e2f2 /drivers/staging/lustre/lnet/lnet/lib-md.c | |
parent | 508d5e0f4d45a815a0759c6aea69fef62359cf74 (diff) | |
download | op-kernel-dev-ee3b1e23bd759b57a964dd66ee835350ae4873dd.zip op-kernel-dev-ee3b1e23bd759b57a964dd66ee835350ae4873dd.tar.gz |
staging: lustre: lnet-lib: opencode some alloc/free functions.
These functions just call LIBCFS_ALLOC() which in-turn
calls kvmalloc().
In none of these cases is the 'vmalloc' option needed.
LIBCFS_ALLOC also produces a warning if NULL is returned,
but that can be provided with CONFIG_SLAB_DEBUG.
LIBCFS_ALLOC zeros the memory, so we need to use
__GFP_ZERO too.
So with one exception where the alloc function is not trivial,
open-code the alloc and free functions using kmalloc and kfree.
Note that the 'size' used in lnet_md_alloc() is limited and less than
a page because LNET_MAX_IOV is 256, so kvmalloc is not needed.
Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/lustre/lnet/lnet/lib-md.c')
-rw-r--r-- | drivers/staging/lustre/lnet/lnet/lib-md.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/staging/lustre/lnet/lnet/lib-md.c b/drivers/staging/lustre/lnet/lnet/lib-md.c index ac5b959..8a22514 100644 --- a/drivers/staging/lustre/lnet/lnet/lib-md.c +++ b/drivers/staging/lustre/lnet/lnet/lib-md.c @@ -81,7 +81,7 @@ lnet_md_unlink(struct lnet_libmd *md) LASSERT(!list_empty(&md->md_list)); list_del_init(&md->md_list); - lnet_md_free(md); + kfree(md); } static int @@ -173,7 +173,7 @@ lnet_md_link(struct lnet_libmd *md, struct lnet_handle_eq eq_handle, int cpt) /* * NB we are passed an allocated, but inactive md. * if we return success, caller may lnet_md_unlink() it. - * otherwise caller may only lnet_md_free() it. + * otherwise caller may only kfree() it. */ /* * This implementation doesn't know how to create START events or @@ -329,7 +329,7 @@ LNetMDAttach(struct lnet_handle_me meh, struct lnet_md umd, out_unlock: lnet_res_unlock(cpt); out_free: - lnet_md_free(md); + kfree(md); return rc; } EXPORT_SYMBOL(LNetMDAttach); @@ -390,7 +390,7 @@ LNetMDBind(struct lnet_md umd, enum lnet_unlink unlink, out_unlock: lnet_res_unlock(cpt); out_free: - lnet_md_free(md); + kfree(md); return rc; } |