Commit 50d30362 authored by Mike Rapoport's avatar Mike Rapoport Committed by Greg Kroah-Hartman

staging: lustre: replace OBD_SLAB_FREE_PTR with kmem_cache_free

Use kmem_cache_free directly instead of wrapping macro.
Signed-off-by: default avatarMike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent ebbc7c8b
......@@ -127,7 +127,7 @@ void ccc_key_fini(const struct lu_context *ctx,
{
struct ccc_thread_info *info = data;
OBD_SLAB_FREE_PTR(info, ccc_thread_kmem);
kmem_cache_free(ccc_thread_kmem, info);
}
void *ccc_session_key_init(const struct lu_context *ctx,
......@@ -146,7 +146,7 @@ void ccc_session_key_fini(const struct lu_context *ctx,
{
struct ccc_session *session = data;
OBD_SLAB_FREE_PTR(session, ccc_session_kmem);
kmem_cache_free(ccc_session_kmem, session);
}
struct lu_context_key ccc_key = {
......@@ -383,7 +383,7 @@ void ccc_object_free(const struct lu_env *env, struct lu_object *obj)
lu_object_fini(obj);
lu_object_header_fini(obj->lo_header);
OBD_SLAB_FREE_PTR(vob, ccc_object_kmem);
kmem_cache_free(ccc_object_kmem, vob);
}
int ccc_lock_init(const struct lu_env *env,
......@@ -511,7 +511,7 @@ void ccc_lock_fini(const struct lu_env *env, struct cl_lock_slice *slice)
{
struct ccc_lock *clk = cl2ccc_lock(slice);
OBD_SLAB_FREE_PTR(clk, ccc_lock_kmem);
kmem_cache_free(ccc_lock_kmem, clk);
}
int ccc_lock_enqueue(const struct lu_env *env,
......@@ -804,7 +804,7 @@ void ccc_req_completion(const struct lu_env *env,
cl_stats_tally(slice->crs_dev, slice->crs_req->crq_type, ioret);
vrq = cl2ccc_req(slice);
OBD_SLAB_FREE_PTR(vrq, ccc_req_kmem);
kmem_cache_free(ccc_req_kmem, vrq);
}
/**
......
......@@ -74,7 +74,7 @@ static struct ll_file_data *ll_file_data_get(void)
static void ll_file_data_put(struct ll_file_data *fd)
{
if (fd != NULL)
OBD_SLAB_FREE_PTR(fd, ll_file_data_slab);
kmem_cache_free(ll_file_data_slab, fd);
}
void ll_pack_inode2opdata(struct inode *inode, struct md_op_data *op_data,
......
......@@ -66,7 +66,7 @@ static void ll_inode_destroy_callback(struct rcu_head *head)
struct inode *inode = container_of(head, struct inode, i_rcu);
struct ll_inode_info *ptr = ll_i2info(inode);
OBD_SLAB_FREE_PTR(ptr, ll_inode_cachep);
kmem_cache_free(ll_inode_cachep, ptr);
}
static void ll_destroy_inode(struct inode *inode)
......
......@@ -90,7 +90,7 @@ static void vvp_key_fini(const struct lu_context *ctx,
{
struct vvp_thread_info *info = data;
OBD_SLAB_FREE_PTR(info, vvp_thread_kmem);
kmem_cache_free(vvp_thread_kmem, info);
}
static void *vvp_session_key_init(const struct lu_context *ctx,
......@@ -109,7 +109,7 @@ static void vvp_session_key_fini(const struct lu_context *ctx,
{
struct vvp_session *session = data;
OBD_SLAB_FREE_PTR(session, vvp_session_kmem);
kmem_cache_free(vvp_session_kmem, session);
}
struct lu_context_key vvp_key = {
......
......@@ -141,7 +141,7 @@ static int ll_xattr_cache_add(struct list_head *cache,
err_value:
kfree(xattr->xe_name);
err_name:
OBD_SLAB_FREE_PTR(xattr, xattr_kmem);
kmem_cache_free(xattr_kmem, xattr);
return -ENOMEM;
}
......@@ -165,7 +165,7 @@ static int ll_xattr_cache_del(struct list_head *cache,
list_del(&xattr->xe_list);
kfree(xattr->xe_name);
kfree(xattr->xe_value);
OBD_SLAB_FREE_PTR(xattr, xattr_kmem);
kmem_cache_free(xattr_kmem, xattr);
return 0;
}
......
......@@ -124,7 +124,7 @@ static void lov_req_completion(const struct lu_env *env,
struct lov_req *lr;
lr = cl2lov_req(slice);
OBD_SLAB_FREE_PTR(lr, lov_req_kmem);
kmem_cache_free(lov_req_kmem, lr);
}
static const struct cl_req_operations lov_req_ops = {
......@@ -156,7 +156,7 @@ static void lov_key_fini(const struct lu_context *ctx,
struct lov_thread_info *info = data;
LINVRNT(list_empty(&info->lti_closure.clc_list));
OBD_SLAB_FREE_PTR(info, lov_thread_kmem);
kmem_cache_free(lov_thread_kmem, info);
}
struct lu_context_key lov_key = {
......@@ -181,7 +181,7 @@ static void lov_session_key_fini(const struct lu_context *ctx,
{
struct lov_session *info = data;
OBD_SLAB_FREE_PTR(info, lov_session_kmem);
kmem_cache_free(lov_session_kmem, info);
}
struct lu_context_key lov_session_key = {
......
......@@ -173,7 +173,7 @@ static struct cl_lock *lov_sublock_alloc(const struct lu_env *env,
if (!IS_ERR(sublock))
*out = link;
else
OBD_SLAB_FREE_PTR(link, lov_lock_link_kmem);
kmem_cache_free(lov_lock_link_kmem, link);
} else
sublock = ERR_PTR(-ENOMEM);
return sublock;
......@@ -444,7 +444,7 @@ static void lov_lock_fini(const struct lu_env *env,
LASSERT(lck->lls_sub[i].sub_lock == NULL);
kvfree(lck->lls_sub);
}
OBD_SLAB_FREE_PTR(lck, lov_lock_kmem);
kmem_cache_free(lov_lock_kmem, lck);
}
static int lov_lock_enqueue_wait(const struct lu_env *env,
......@@ -518,7 +518,7 @@ static int lov_sublock_fill(const struct lu_env *env, struct cl_lock *parent,
lck->lls_sub[idx].sub_lock == NULL) {
lov_sublock_adopt(env, lck, sublock, idx, link);
} else {
OBD_SLAB_FREE_PTR(link, lov_lock_link_kmem);
kmem_cache_free(lov_lock_link_kmem, link);
/* other thread allocated sub-lock, or enqueue is no
* longer going on */
cl_lock_mutex_put(env, parent);
......@@ -1027,7 +1027,7 @@ void lov_lock_unlink(const struct lu_env *env,
lck->lls_nr_filled--;
lu_ref_del(&parent->cll_reference, "lov-child", sub->lss_cl.cls_lock);
cl_lock_put(env, parent);
OBD_SLAB_FREE_PTR(link, lov_lock_link_kmem);
kmem_cache_free(lov_lock_link_kmem, link);
}
struct lov_lock_link *lov_lock_link_find(const struct lu_env *env,
......@@ -1153,7 +1153,7 @@ static void lov_empty_lock_fini(const struct lu_env *env,
{
struct lov_lock *lck = cl2lov_lock(slice);
OBD_SLAB_FREE_PTR(lck, lov_lock_kmem);
kmem_cache_free(lov_lock_kmem, lck);
}
static int lov_empty_lock_print(const struct lu_env *env, void *cookie,
......
......@@ -808,7 +808,7 @@ static void lov_object_free(const struct lu_env *env, struct lu_object *obj)
LOV_2DISPATCH_VOID(lov, llo_fini, env, lov, &lov->u);
lu_object_fini(obj);
OBD_SLAB_FREE_PTR(lov, lov_object_kmem);
kmem_cache_free(lov_object_kmem, lov);
}
static int lov_object_print(const struct lu_env *env, void *cookie,
......
......@@ -56,7 +56,7 @@ static void lovsub_req_completion(const struct lu_env *env,
struct lovsub_req *lsr;
lsr = cl2lovsub_req(slice);
OBD_SLAB_FREE_PTR(lsr, lovsub_req_kmem);
kmem_cache_free(lovsub_req_kmem, lsr);
}
/**
......
......@@ -59,7 +59,7 @@ static void lovsub_lock_fini(const struct lu_env *env,
lsl = cl2lovsub_lock(slice);
LASSERT(list_empty(&lsl->lss_parents));
OBD_SLAB_FREE_PTR(lsl, lovsub_lock_kmem);
kmem_cache_free(lovsub_lock_kmem, lsl);
}
static void lovsub_parent_lock(const struct lu_env *env, struct lov_lock *lov)
......
......@@ -91,7 +91,7 @@ static void lovsub_object_free(const struct lu_env *env, struct lu_object *obj)
lu_object_fini(obj);
lu_object_header_fini(&los->lso_header.coh_lu);
OBD_SLAB_FREE_PTR(los, lovsub_object_kmem);
kmem_cache_free(lovsub_object_kmem, los);
}
static int lovsub_object_print(const struct lu_env *env, void *cookie,
......
......@@ -270,7 +270,7 @@ static void cl_lock_free(const struct lu_env *env, struct cl_lock *lock)
lu_ref_fini(&lock->cll_reference);
lu_ref_fini(&lock->cll_holders);
mutex_destroy(&lock->cll_guard);
OBD_SLAB_FREE_PTR(lock, cl_lock_kmem);
kmem_cache_free(cl_lock_kmem, lock);
}
/**
......
......@@ -680,7 +680,7 @@ static struct lu_env *cl_env_new(__u32 ctx_tags, __u32 ses_tags, void *debug)
lu_env_fini(env);
}
if (rc != 0) {
OBD_SLAB_FREE_PTR(cle, cl_env_kmem);
kmem_cache_free(cl_env_kmem, cle);
env = ERR_PTR(rc);
} else {
CL_ENV_INC(create);
......@@ -696,7 +696,7 @@ static void cl_env_fini(struct cl_env *cle)
CL_ENV_DEC(total);
lu_context_fini(&cle->ce_lu.le_ctx);
lu_context_fini(&cle->ce_ses);
OBD_SLAB_FREE_PTR(cle, cl_env_kmem);
kmem_cache_free(cl_env_kmem, cle);
}
static inline struct cl_env *cl_env_container(struct lu_env *env)
......
......@@ -85,7 +85,7 @@ static void obd_device_free(struct obd_device *obd)
LBUG();
}
lu_ref_fini(&obd->obd_reference);
OBD_SLAB_FREE_PTR(obd, obd_device_cachep);
kmem_cache_free(obd_device_cachep, obd);
}
static struct obd_type *class_search_type(const char *name)
......
......@@ -337,7 +337,7 @@ static void echo_lock_fini(const struct lu_env *env,
struct echo_lock *ecl = cl2echo_lock(slice);
LASSERT(list_empty(&ecl->el_chain));
OBD_SLAB_FREE_PTR(ecl, echo_lock_kmem);
kmem_cache_free(echo_lock_kmem, ecl);
}
static void echo_lock_delete(const struct lu_env *env,
......@@ -530,7 +530,7 @@ static void echo_object_free(const struct lu_env *env, struct lu_object *obj)
if (eco->eo_lsm)
echo_free_memmd(eco->eo_dev, &eco->eo_lsm);
OBD_SLAB_FREE_PTR(eco, echo_object_kmem);
kmem_cache_free(echo_object_kmem, eco);
}
static int echo_object_print(const struct lu_env *env, void *cookie,
......@@ -641,7 +641,7 @@ static void echo_thread_key_fini(const struct lu_context *ctx,
{
struct echo_thread_info *info = data;
OBD_SLAB_FREE_PTR(info, echo_thread_kmem);
kmem_cache_free(echo_thread_kmem, info);
}
static void echo_thread_key_exit(const struct lu_context *ctx,
......@@ -672,7 +672,7 @@ static void echo_session_key_fini(const struct lu_context *ctx,
{
struct echo_session_info *session = data;
OBD_SLAB_FREE_PTR(session, echo_session_kmem);
kmem_cache_free(echo_session_kmem, session);
}
static void echo_session_key_exit(const struct lu_context *ctx,
......
......@@ -365,7 +365,7 @@ static struct osc_extent *osc_extent_alloc(struct osc_object *obj)
static void osc_extent_free(struct osc_extent *ext)
{
OBD_SLAB_FREE_PTR(ext, osc_extent_kmem);
kmem_cache_free(osc_extent_kmem, ext);
}
static struct osc_extent *osc_extent_get(struct osc_extent *ext)
......
......@@ -133,7 +133,7 @@ static void osc_key_fini(const struct lu_context *ctx,
{
struct osc_thread_info *info = data;
OBD_SLAB_FREE_PTR(info, osc_thread_kmem);
kmem_cache_free(osc_thread_kmem, info);
}
struct lu_context_key osc_key = {
......@@ -158,7 +158,7 @@ static void osc_session_fini(const struct lu_context *ctx,
{
struct osc_session *info = data;
OBD_SLAB_FREE_PTR(info, osc_session_kmem);
kmem_cache_free(osc_session_kmem, info);
}
struct lu_context_key osc_session_key = {
......
......@@ -700,7 +700,7 @@ static void osc_req_completion(const struct lu_env *env,
struct osc_req *or;
or = cl2osc_req(slice);
OBD_SLAB_FREE_PTR(or, osc_req_kmem);
kmem_cache_free(osc_req_kmem, or);
}
/**
......
......@@ -251,7 +251,7 @@ static void osc_lock_fini(const struct lu_env *env,
LASSERT(atomic_read(&ols->ols_pageref) == 0 ||
atomic_read(&ols->ols_pageref) == _PAGEREF_MAGIC);
OBD_SLAB_FREE_PTR(ols, osc_lock_kmem);
kmem_cache_free(osc_lock_kmem, ols);
}
static void osc_lock_build_policy(const struct lu_env *env,
......
......@@ -122,7 +122,7 @@ static void osc_object_free(const struct lu_env *env, struct lu_object *obj)
LASSERT(atomic_read(&osc->oo_nr_writes) == 0);
lu_object_fini(obj);
OBD_SLAB_FREE_PTR(osc, osc_object_kmem);
kmem_cache_free(osc_object_kmem, osc);
}
int osc_lvb_print(const struct lu_env *env, void *cookie,
......
......@@ -104,7 +104,7 @@ int osc_quota_setdq(struct client_obd *cli, const unsigned int qid[],
/* race with others? */
if (rc == -EALREADY) {
rc = 0;
OBD_SLAB_FREE_PTR(oqi, osc_quota_kmem);
kmem_cache_free(osc_quota_kmem, oqi);
}
CDEBUG(D_QUOTA, "%s: setdq to insert for %s %d (%d)\n",
......@@ -120,7 +120,7 @@ int osc_quota_setdq(struct client_obd *cli, const unsigned int qid[],
oqi = cfs_hash_del_key(cli->cl_quota_hash[type],
&qid[type]);
if (oqi)
OBD_SLAB_FREE_PTR(oqi, osc_quota_kmem);
kmem_cache_free(osc_quota_kmem, oqi);
CDEBUG(D_QUOTA, "%s: setdq to remove for %s %d (%p)\n",
cli->cl_import->imp_obd->obd_name,
......@@ -186,7 +186,7 @@ oqi_exit(struct cfs_hash *hs, struct hlist_node *hnode)
oqi = hlist_entry(hnode, struct osc_quota_info, oqi_hash);
OBD_SLAB_FREE_PTR(oqi, osc_quota_kmem);
kmem_cache_free(osc_quota_kmem, oqi);
}
#define HASH_QUOTA_BKT_BITS 5
......
......@@ -429,7 +429,7 @@ struct ptlrpc_request *ptlrpc_request_cache_alloc(gfp_t flags)
void ptlrpc_request_cache_free(struct ptlrpc_request *req)
{
OBD_SLAB_FREE_PTR(req, request_cache);
kmem_cache_free(request_cache, req);
}
/**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment