staging: lustre: replace OBD_SLAB_FREE with kmem_cache_free

Use kmem_cache_free directly instead of wrapping macro.

Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Mike Rapoport 2015-10-20 12:39:52 +03:00 committed by Greg Kroah-Hartman
parent 50d3036294
commit 5c4d8ed8e8
5 changed files with 9 additions and 11 deletions

View File

@ -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);
}
}

View File

@ -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 = {

View File

@ -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;

View File

@ -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)

View File

@ -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);
}