These functions are simple wrapper that do not benefit
readability, so remove them.
Move the DEBUJG messages to the places where allocation happens. This
introduces only a tiny amount of code duplication.
Signed-off-by: Mr NeilBrown <neilb@suse.de>
Change-Id: Ieb40f8a7547cba30b05c1e5e526c762e354f3c47
Reviewed-on: https://review.whamcloud.com/36910
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Shaun Tancheff <shaun.tancheff@hpe.com>
Reviewed-by: Serguei Smirnov <ssmirnov@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
-static inline struct lnet_me *
-lnet_me_alloc (void)
-{
- struct lnet_me *me;
-
- me = kmem_cache_alloc(lnet_mes_cachep, GFP_NOFS | __GFP_ZERO);
-
- if (me)
- CDEBUG(D_MALLOC, "slab-alloced 'me' at %p.\n", me);
- else
- CDEBUG(D_MALLOC, "failed to allocate 'me'\n");
-
- return me;
-}
-
-static inline void
-lnet_me_free(struct lnet_me *me)
-{
- CDEBUG(D_MALLOC, "slab-freed 'me' at %p.\n", me);
- kmem_cache_free(lnet_mes_cachep, me);
-}
-
struct lnet_libhandle *lnet_res_lh_lookup(struct lnet_res_container *rec,
__u64 cookie);
void lnet_res_lh_initialize(struct lnet_res_container *rec,
struct lnet_libhandle *lnet_res_lh_lookup(struct lnet_res_container *rec,
__u64 cookie);
void lnet_res_lh_initialize(struct lnet_res_container *rec,
if (mtable == NULL) /* can't match portal type */
return ERR_PTR(-EPERM);
if (mtable == NULL) /* can't match portal type */
return ERR_PTR(-EPERM);
- me = lnet_me_alloc();
- if (me == NULL)
+ me = kmem_cache_alloc(lnet_mes_cachep, GFP_NOFS | __GFP_ZERO);
+ if (me == NULL) {
+ CDEBUG(D_MALLOC, "failed to allocate 'me'\n");
+ }
+ CDEBUG(D_MALLOC, "slab-alloced 'me' at %p.\n", me);
lnet_res_lock(mtable->mt_cpt);
lnet_res_lock(mtable->mt_cpt);
+ CDEBUG(D_MALLOC, "slab-freed 'me' at %p.\n", me);
+ kmem_cache_free(lnet_mes_cachep, me);
struct lnet_me, me_list);
CERROR("Active ME %p on exit\n", me);
list_del(&me->me_list);
struct lnet_me, me_list);
CERROR("Active ME %p on exit\n", me);
list_del(&me->me_list);
+ CDEBUG(D_MALLOC,
+ "slab-freed 'me' at %p in cleanup.\n",
+ me);
+ kmem_cache_free(lnet_mes_cachep, me);
}
}
/* the extra entry is for MEs with ignore bits */
}
}
/* the extra entry is for MEs with ignore bits */