diff options
Diffstat (limited to 'drivers/staging/lustre/lustre/lov/lov_dev.c')
-rw-r--r-- | drivers/staging/lustre/lustre/lov/lov_dev.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/staging/lustre/lustre/lov/lov_dev.c b/drivers/staging/lustre/lustre/lov/lov_dev.c index 8c3bbe574..2e8b56645 100644 --- a/drivers/staging/lustre/lustre/lov/lov_dev.c +++ b/drivers/staging/lustre/lustre/lov/lov_dev.c @@ -46,7 +46,6 @@ #include "lov_cl_internal.h" #include "lov_internal.h" - struct kmem_cache *lov_lock_kmem; struct kmem_cache *lov_object_kmem; struct kmem_cache *lov_thread_kmem; @@ -125,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 = { @@ -143,7 +142,7 @@ static void *lov_key_init(const struct lu_context *ctx, { struct lov_thread_info *info; - OBD_SLAB_ALLOC_PTR_GFP(info, lov_thread_kmem, GFP_NOFS); + info = kmem_cache_alloc(lov_thread_kmem, GFP_NOFS | __GFP_ZERO); if (info != NULL) INIT_LIST_HEAD(&info->lti_closure.clc_list); else @@ -155,8 +154,9 @@ static void lov_key_fini(const struct lu_context *ctx, struct lu_context_key *key, void *data) { 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 = { @@ -170,7 +170,7 @@ static void *lov_session_key_init(const struct lu_context *ctx, { struct lov_session *info; - OBD_SLAB_ALLOC_PTR_GFP(info, lov_session_kmem, GFP_NOFS); + info = kmem_cache_alloc(lov_session_kmem, GFP_NOFS | __GFP_ZERO); if (info == NULL) info = ERR_PTR(-ENOMEM); return info; @@ -180,7 +180,8 @@ static void lov_session_key_fini(const struct lu_context *ctx, struct lu_context_key *key, void *data) { 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 = { @@ -260,7 +261,7 @@ static int lov_req_init(const struct lu_env *env, struct cl_device *dev, struct lov_req *lr; int result; - OBD_SLAB_ALLOC_PTR_GFP(lr, lov_req_kmem, GFP_NOFS); + lr = kmem_cache_alloc(lov_req_kmem, GFP_NOFS | __GFP_ZERO); if (lr != NULL) { cl_req_slice_add(req, &lr->lr_cl, dev, &lov_req_ops); result = 0; |