diff options
author | Amitoj Kaur Chawla <amitoj1606@gmail.com> | 2016-02-26 11:54:41 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-03-02 06:18:42 +0300 |
commit | 38cf948df1326f6ab82a536170a6b2e8f520a6b1 (patch) | |
tree | fc4d4e3deeccaaba0f3b0e1303d4bc5a3530f696 /drivers | |
parent | 8210132b230e926747596cad1a5ba9d59c08ae82 (diff) | |
download | linux-38cf948df1326f6ab82a536170a6b2e8f520a6b1.tar.xz |
staging: lustre: obdecho: Replace kmem_cache_alloc with kmem_cache_zalloc
Use kmem_cache_zalloc instead of manually setting kmem_cache_alloc
with flag GFP_ZERO since kmem_alloc_zalloc sets allocated memory
to zero.
The Coccinelle semantic patch used to make this change is as
follows:
// <smpl>
@@
expression e,f;
@@
- kmem_cache_alloc(e, f |__GFP_ZERO)
+ kmem_cache_zalloc(e, f)
// </smpl>
Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/staging/lustre/lustre/obdecho/echo_client.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/staging/lustre/lustre/obdecho/echo_client.c b/drivers/staging/lustre/lustre/obdecho/echo_client.c index ab56e67b6f96..5589b3c785ee 100644 --- a/drivers/staging/lustre/lustre/obdecho/echo_client.c +++ b/drivers/staging/lustre/lustre/obdecho/echo_client.c @@ -392,7 +392,7 @@ static int echo_lock_init(const struct lu_env *env, { struct echo_lock *el; - el = kmem_cache_alloc(echo_lock_kmem, GFP_NOFS | __GFP_ZERO); + el = kmem_cache_zalloc(echo_lock_kmem, GFP_NOFS); if (el) { cl_lock_slice_add(lock, &el->el_cl, obj, &echo_lock_ops); el->el_object = cl2echo_obj(obj); @@ -562,7 +562,7 @@ static struct lu_object *echo_object_alloc(const struct lu_env *env, /* we're the top dev. */ LASSERT(!hdr); - eco = kmem_cache_alloc(echo_object_kmem, GFP_NOFS | __GFP_ZERO); + eco = kmem_cache_zalloc(echo_object_kmem, GFP_NOFS); if (eco) { struct cl_object_header *hdr = &eco->eo_hdr; @@ -625,7 +625,7 @@ static void *echo_thread_key_init(const struct lu_context *ctx, { struct echo_thread_info *info; - info = kmem_cache_alloc(echo_thread_kmem, GFP_NOFS | __GFP_ZERO); + info = kmem_cache_zalloc(echo_thread_kmem, GFP_NOFS); if (!info) info = ERR_PTR(-ENOMEM); return info; @@ -656,7 +656,7 @@ static void *echo_session_key_init(const struct lu_context *ctx, { struct echo_session_info *session; - session = kmem_cache_alloc(echo_session_kmem, GFP_NOFS | __GFP_ZERO); + session = kmem_cache_zalloc(echo_session_kmem, GFP_NOFS); if (!session) session = ERR_PTR(-ENOMEM); return session; |