staging: lustre: replace OBD_SLAB_FREE with kmem_cache_free
authorMike Rapoport <mike.rapoport@gmail.com>
Tue, 20 Oct 2015 09:39:52 +0000 (12:39 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 25 Oct 2015 01:46:17 +0000 (18:46 -0700)
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>
drivers/staging/lustre/lustre/ldlm/ldlm_extent.c
drivers/staging/lustre/lustre/ldlm/ldlm_lock.c
drivers/staging/lustre/lustre/ldlm/ldlm_resource.c
drivers/staging/lustre/lustre/llite/remote_perm.c
drivers/staging/lustre/lustre/lov/lov_ea.c

index 644a413ac768cffccaf991f1ed66a29040417f88..c787888eb8af4dcd3c4e6663f15d39c510e084a2 100644 (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);
        }
 }
 
index b1a347f883f98506976b13ff4343207c1da95b45..7f8c70056ffdeb011db2e175904025714e174a3e 100644 (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 = {
index 6077ffb4283f0fe2427ca279563790d9b3f9f171..342c465ed9b251b3756f2b2d64cf85dc3652f938 100644 (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;
index 4257d74c212aaa8ebc92e3eace3298318ef248b6..c902133dfc97256f1444c6ba69f540f66d988324 100644 (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)
index a453cb942176c56835de6b579fa0eaa4715e644d..34c1346f0dc76e9c1f05d3651676cd2098ddea23 100644 (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);
 }