Use kmem_cache_free directly instead of wrapping macro. Signed-off-by: Mike Rapoport <mike.rapoport@xxxxxxxxx> --- drivers/staging/lustre/lustre/ldlm/ldlm_extent.c | 2 +- drivers/staging/lustre/lustre/ldlm/ldlm_lock.c | 2 +- drivers/staging/lustre/lustre/ldlm/ldlm_resource.c | 6 +++--- drivers/staging/lustre/lustre/llite/remote_perm.c | 5 ++--- drivers/staging/lustre/lustre/lov/lov_ea.c | 5 ++--- 5 files changed, 9 insertions(+), 11 deletions(-) diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_extent.c b/drivers/staging/lustre/lustre/ldlm/ldlm_extent.c index 644a413..c787888 100644 --- a/drivers/staging/lustre/lustre/ldlm/ldlm_extent.c +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_extent.c @@ -126,7 +126,7 @@ void ldlm_interval_free(struct ldlm_interval *node) if (node) { LASSERT(list_empty(&node->li_group)); LASSERT(!interval_is_intree(&node->li_node)); - OBD_SLAB_FREE(node, ldlm_interval_slab, sizeof(*node)); + kmem_cache_free(ldlm_interval_slab, node); } } diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c b/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c index b1a347f..7f8c700 100644 --- a/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c @@ -392,7 +392,7 @@ static void lock_handle_addref(void *lock) static void lock_handle_free(void *lock, int size) { LASSERT(size == sizeof(struct ldlm_lock)); - OBD_SLAB_FREE(lock, ldlm_lock_slab, size); + kmem_cache_free(ldlm_lock_slab, lock); } static struct portals_handle_ops lock_handle_ops = { diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c b/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c index 6077ffb..342c465 100644 --- a/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c @@ -1124,7 +1124,7 @@ ldlm_resource_get(struct ldlm_namespace *ns, struct ldlm_resource *parent, lu_ref_fini(&res->lr_reference); /* We have taken lr_lvb_mutex. Drop it. */ mutex_unlock(&res->lr_lvb_mutex); - OBD_SLAB_FREE(res, ldlm_resource_slab, sizeof(*res)); + kmem_cache_free(ldlm_resource_slab, res); res = hlist_entry(hnode, struct ldlm_resource, lr_hash); /* Synchronize with regard to resource creation. */ @@ -1218,7 +1218,7 @@ int ldlm_resource_putref(struct ldlm_resource *res) cfs_hash_bd_unlock(ns->ns_rs_hash, &bd, 1); if (ns->ns_lvbo && ns->ns_lvbo->lvbo_free) ns->ns_lvbo->lvbo_free(res); - OBD_SLAB_FREE(res, ldlm_resource_slab, sizeof(*res)); + kmem_cache_free(ldlm_resource_slab, res); return 1; } return 0; @@ -1248,7 +1248,7 @@ int ldlm_resource_putref_locked(struct ldlm_resource *res) */ if (ns->ns_lvbo && ns->ns_lvbo->lvbo_free) ns->ns_lvbo->lvbo_free(res); - OBD_SLAB_FREE(res, ldlm_resource_slab, sizeof(*res)); + kmem_cache_free(ldlm_resource_slab, res); cfs_hash_bd_lock(ns->ns_rs_hash, &bd, 1); return 1; diff --git a/drivers/staging/lustre/lustre/llite/remote_perm.c b/drivers/staging/lustre/lustre/llite/remote_perm.c index 4257d74..c902133 100644 --- a/drivers/staging/lustre/lustre/llite/remote_perm.c +++ b/drivers/staging/lustre/lustre/llite/remote_perm.c @@ -74,7 +74,7 @@ static inline void free_ll_remote_perm(struct ll_remote_perm *lrp) if (!hlist_unhashed(&lrp->lrp_list)) hlist_del(&lrp->lrp_list); - OBD_SLAB_FREE(lrp, ll_remote_perm_cachep, sizeof(*lrp)); + kmem_cache_free(ll_remote_perm_cachep, lrp); } static struct hlist_head *alloc_rmtperm_hash(void) @@ -104,8 +104,7 @@ void free_rmtperm_hash(struct hlist_head *hash) for (i = 0; i < REMOTE_PERM_HASHSIZE; i++) hlist_for_each_entry_safe(lrp, next, hash + i, lrp_list) free_ll_remote_perm(lrp); - OBD_SLAB_FREE(hash, ll_rmtperm_hash_cachep, - REMOTE_PERM_HASHSIZE * sizeof(*hash)); + kmem_cache_free(ll_rmtperm_hash_cachep, hash); } static inline int remote_perm_hashfunc(uid_t uid) diff --git a/drivers/staging/lustre/lustre/lov/lov_ea.c b/drivers/staging/lustre/lustre/lov/lov_ea.c index a453cb9..34c1346 100644 --- a/drivers/staging/lustre/lustre/lov/lov_ea.c +++ b/drivers/staging/lustre/lustre/lov/lov_ea.c @@ -110,7 +110,7 @@ struct lov_stripe_md *lsm_alloc_plain(__u16 stripe_count, int *size) err: while (--i >= 0) - OBD_SLAB_FREE(lsm->lsm_oinfo[i], lov_oinfo_slab, sizeof(*loi)); + kmem_cache_free(lov_oinfo_slab, lsm->lsm_oinfo[i]); kvfree(lsm); return NULL; } @@ -121,8 +121,7 @@ void lsm_free_plain(struct lov_stripe_md *lsm) int i; for (i = 0; i < stripe_count; i++) - OBD_SLAB_FREE(lsm->lsm_oinfo[i], lov_oinfo_slab, - sizeof(struct lov_oinfo)); + kmem_cache_free(lov_oinfo_slab, lsm->lsm_oinfo[i]); kvfree(lsm); } -- 2.1.0 _______________________________________________ devel mailing list devel@xxxxxxxxxxxxxxxxxxxxxx http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel