All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/8] staging: lustre: Replace kmem_cache_alloc with kmem_cache_zalloc
@ 2016-02-26  8:54 Amitoj Kaur Chawla
  2016-02-26  8:54 ` [PATCH 1/8] staging: lustre: lclient: " Amitoj Kaur Chawla
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: Amitoj Kaur Chawla @ 2016-02-26  8:54 UTC (permalink / raw)
  To: outreachy-kernel

This patchset replaces kmem_cache_alloc with kmem_cache_zalloc.

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>

Amitoj Kaur Chawla (8):
  staging: lustre: lclient: Replace kmem_cache_alloc with
    kmem_cache_zalloc
  staging: lustre: obdclass: Replace kmem_cache_alloc with
    kmem_cache_zalloc
  staging: lustre: lov: Replace kmem_cache_alloc with kmem_cache_zalloc
  staging: lustre: obdecho: Replace kmem_cache_alloc with
    kmem_cache_zalloc
  staging: lustre: ptlrpc: Replace kmem_cache_alloc with
    kmem_cache_zalloc
  staging: lustre: osc: Replace kmem_cache_alloc with kmem_cache_zalloc
  staging: lustre: ldlm: Replace kmem_cache_alloc with kmem_cache_zalloc
  staging: lustre: llite: Replace kmem_cache_alloc with
    kmem_cache_zalloc

 drivers/staging/lustre/lustre/lclient/lcommon_cl.c  | 10 +++++-----
 drivers/staging/lustre/lustre/ldlm/ldlm_extent.c    |  2 +-
 drivers/staging/lustre/lustre/ldlm/ldlm_lock.c      |  2 +-
 drivers/staging/lustre/lustre/ldlm/ldlm_resource.c  |  2 +-
 drivers/staging/lustre/lustre/llite/file.c          |  4 ++--
 drivers/staging/lustre/lustre/llite/llite_close.c   |  2 +-
 drivers/staging/lustre/lustre/llite/llite_lib.c     |  3 +--
 drivers/staging/lustre/lustre/llite/namei.c         |  2 +-
 drivers/staging/lustre/lustre/llite/remote_perm.c   |  4 ++--
 drivers/staging/lustre/lustre/llite/super25.c       |  2 +-
 drivers/staging/lustre/lustre/llite/vvp_dev.c       |  4 ++--
 drivers/staging/lustre/lustre/llite/xattr_cache.c   |  2 +-
 drivers/staging/lustre/lustre/lov/lov_dev.c         |  6 +++---
 drivers/staging/lustre/lustre/lov/lov_ea.c          |  2 +-
 drivers/staging/lustre/lustre/lov/lov_lock.c        |  6 +++---
 drivers/staging/lustre/lustre/lov/lov_object.c      |  2 +-
 drivers/staging/lustre/lustre/lov/lov_request.c     | 11 ++++-------
 drivers/staging/lustre/lustre/lov/lovsub_dev.c      |  2 +-
 drivers/staging/lustre/lustre/lov/lovsub_lock.c     |  2 +-
 drivers/staging/lustre/lustre/lov/lovsub_object.c   |  2 +-
 drivers/staging/lustre/lustre/obdclass/cl_lock.c    |  2 +-
 drivers/staging/lustre/lustre/obdclass/cl_object.c  |  2 +-
 drivers/staging/lustre/lustre/obdclass/genops.c     |  2 +-
 drivers/staging/lustre/lustre/obdecho/echo_client.c |  8 ++++----
 drivers/staging/lustre/lustre/osc/osc_cache.c       |  2 +-
 drivers/staging/lustre/lustre/osc/osc_dev.c         |  4 ++--
 drivers/staging/lustre/lustre/osc/osc_io.c          |  2 +-
 drivers/staging/lustre/lustre/osc/osc_lock.c        |  2 +-
 drivers/staging/lustre/lustre/osc/osc_object.c      |  2 +-
 drivers/staging/lustre/lustre/osc/osc_quota.c       |  2 +-
 drivers/staging/lustre/lustre/osc/osc_request.c     |  4 ++--
 drivers/staging/lustre/lustre/ptlrpc/client.c       |  2 +-
 32 files changed, 51 insertions(+), 55 deletions(-)

-- 
1.9.1



^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH 1/8] staging: lustre: lclient: Replace kmem_cache_alloc with kmem_cache_zalloc
  2016-02-26  8:54 [PATCH 0/8] staging: lustre: Replace kmem_cache_alloc with kmem_cache_zalloc Amitoj Kaur Chawla
@ 2016-02-26  8:54 ` Amitoj Kaur Chawla
  2016-02-26  8:54 ` [PATCH 2/8] staging: lustre: obdclass: " Amitoj Kaur Chawla
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Amitoj Kaur Chawla @ 2016-02-26  8:54 UTC (permalink / raw)
  To: outreachy-kernel

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>
---
 drivers/staging/lustre/lustre/lclient/lcommon_cl.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/lustre/lustre/lclient/lcommon_cl.c b/drivers/staging/lustre/lustre/lclient/lcommon_cl.c
index 30651f2..aced41a 100644
--- a/drivers/staging/lustre/lustre/lclient/lcommon_cl.c
+++ b/drivers/staging/lustre/lustre/lclient/lcommon_cl.c
@@ -116,7 +116,7 @@ void *ccc_key_init(const struct lu_context *ctx, struct lu_context_key *key)
 {
 	struct ccc_thread_info *info;
 
-	info = kmem_cache_alloc(ccc_thread_kmem, GFP_NOFS | __GFP_ZERO);
+	info = kmem_cache_zalloc(ccc_thread_kmem, GFP_NOFS);
 	if (!info)
 		info = ERR_PTR(-ENOMEM);
 	return info;
@@ -135,7 +135,7 @@ void *ccc_session_key_init(const struct lu_context *ctx,
 {
 	struct ccc_session *session;
 
-	session = kmem_cache_alloc(ccc_session_kmem, GFP_NOFS | __GFP_ZERO);
+	session = kmem_cache_zalloc(ccc_session_kmem, GFP_NOFS);
 	if (!session)
 		session = ERR_PTR(-ENOMEM);
 	return session;
@@ -251,7 +251,7 @@ int ccc_req_init(const struct lu_env *env, struct cl_device *dev,
 	struct ccc_req *vrq;
 	int result;
 
-	vrq = kmem_cache_alloc(ccc_req_kmem, GFP_NOFS | __GFP_ZERO);
+	vrq = kmem_cache_zalloc(ccc_req_kmem, GFP_NOFS);
 	if (vrq) {
 		cl_req_slice_add(req, &vrq->crq_cl, dev, &ccc_req_ops);
 		result = 0;
@@ -327,7 +327,7 @@ struct lu_object *ccc_object_alloc(const struct lu_env *env,
 	struct ccc_object *vob;
 	struct lu_object  *obj;
 
-	vob = kmem_cache_alloc(ccc_object_kmem, GFP_NOFS | __GFP_ZERO);
+	vob = kmem_cache_zalloc(ccc_object_kmem, GFP_NOFS);
 	if (vob) {
 		struct cl_object_header *hdr;
 
@@ -396,7 +396,7 @@ int ccc_lock_init(const struct lu_env *env,
 
 	CLOBINVRNT(env, obj, ccc_object_invariant(obj));
 
-	clk = kmem_cache_alloc(ccc_lock_kmem, GFP_NOFS | __GFP_ZERO);
+	clk = kmem_cache_zalloc(ccc_lock_kmem, GFP_NOFS);
 	if (clk) {
 		cl_lock_slice_add(lock, &clk->clk_cl, obj, lkops);
 		result = 0;
-- 
1.9.1



^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 2/8] staging: lustre: obdclass: Replace kmem_cache_alloc with kmem_cache_zalloc
  2016-02-26  8:54 [PATCH 0/8] staging: lustre: Replace kmem_cache_alloc with kmem_cache_zalloc Amitoj Kaur Chawla
  2016-02-26  8:54 ` [PATCH 1/8] staging: lustre: lclient: " Amitoj Kaur Chawla
@ 2016-02-26  8:54 ` Amitoj Kaur Chawla
  2016-02-26  8:54 ` [PATCH 3/8] staging: lustre: lov: " Amitoj Kaur Chawla
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Amitoj Kaur Chawla @ 2016-02-26  8:54 UTC (permalink / raw)
  To: outreachy-kernel

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>
---
 drivers/staging/lustre/lustre/obdclass/cl_lock.c   | 2 +-
 drivers/staging/lustre/lustre/obdclass/cl_object.c | 2 +-
 drivers/staging/lustre/lustre/obdclass/genops.c    | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/lustre/lustre/obdclass/cl_lock.c b/drivers/staging/lustre/lustre/obdclass/cl_lock.c
index 7b7f344..e5cb29c 100644
--- a/drivers/staging/lustre/lustre/obdclass/cl_lock.c
+++ b/drivers/staging/lustre/lustre/obdclass/cl_lock.c
@@ -361,7 +361,7 @@ static struct cl_lock *cl_lock_alloc(const struct lu_env *env,
 	struct cl_lock	  *lock;
 	struct lu_object_header *head;
 
-	lock = kmem_cache_alloc(cl_lock_kmem, GFP_NOFS | __GFP_ZERO);
+	lock = kmem_cache_zalloc(cl_lock_kmem, GFP_NOFS);
 	if (lock) {
 		atomic_set(&lock->cll_ref, 1);
 		lock->cll_descr = *descr;
diff --git a/drivers/staging/lustre/lustre/obdclass/cl_object.c b/drivers/staging/lustre/lustre/obdclass/cl_object.c
index 39b4fd0..0abac20 100644
--- a/drivers/staging/lustre/lustre/obdclass/cl_object.c
+++ b/drivers/staging/lustre/lustre/obdclass/cl_object.c
@@ -662,7 +662,7 @@ static struct lu_env *cl_env_new(__u32 ctx_tags, __u32 ses_tags, void *debug)
 	struct lu_env *env;
 	struct cl_env *cle;
 
-	cle = kmem_cache_alloc(cl_env_kmem, GFP_NOFS | __GFP_ZERO);
+	cle = kmem_cache_zalloc(cl_env_kmem, GFP_NOFS);
 	if (cle) {
 		int rc;
 
diff --git a/drivers/staging/lustre/lustre/obdclass/genops.c b/drivers/staging/lustre/lustre/obdclass/genops.c
index 9042632..4b04828 100644
--- a/drivers/staging/lustre/lustre/obdclass/genops.c
+++ b/drivers/staging/lustre/lustre/obdclass/genops.c
@@ -69,7 +69,7 @@ static struct obd_device *obd_device_alloc(void)
 {
 	struct obd_device *obd;
 
-	obd = kmem_cache_alloc(obd_device_cachep, GFP_NOFS | __GFP_ZERO);
+	obd = kmem_cache_zalloc(obd_device_cachep, GFP_NOFS);
 	if (obd)
 		obd->obd_magic = OBD_DEVICE_MAGIC;
 	return obd;
-- 
1.9.1



^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 3/8] staging: lustre: lov: Replace kmem_cache_alloc with kmem_cache_zalloc
  2016-02-26  8:54 [PATCH 0/8] staging: lustre: Replace kmem_cache_alloc with kmem_cache_zalloc Amitoj Kaur Chawla
  2016-02-26  8:54 ` [PATCH 1/8] staging: lustre: lclient: " Amitoj Kaur Chawla
  2016-02-26  8:54 ` [PATCH 2/8] staging: lustre: obdclass: " Amitoj Kaur Chawla
@ 2016-02-26  8:54 ` Amitoj Kaur Chawla
  2016-02-26  8:54 ` [PATCH 4/8] staging: lustre: obdecho: " Amitoj Kaur Chawla
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Amitoj Kaur Chawla @ 2016-02-26  8:54 UTC (permalink / raw)
  To: outreachy-kernel

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>
---
 drivers/staging/lustre/lustre/lov/lov_dev.c       |  6 +++---
 drivers/staging/lustre/lustre/lov/lov_ea.c        |  2 +-
 drivers/staging/lustre/lustre/lov/lov_lock.c      |  6 +++---
 drivers/staging/lustre/lustre/lov/lov_object.c    |  2 +-
 drivers/staging/lustre/lustre/lov/lov_request.c   | 11 ++++-------
 drivers/staging/lustre/lustre/lov/lovsub_dev.c    |  2 +-
 drivers/staging/lustre/lustre/lov/lovsub_lock.c   |  2 +-
 drivers/staging/lustre/lustre/lov/lovsub_object.c |  2 +-
 8 files changed, 15 insertions(+), 18 deletions(-)

diff --git a/drivers/staging/lustre/lustre/lov/lov_dev.c b/drivers/staging/lustre/lustre/lov/lov_dev.c
index ee093e0..532ef87 100644
--- a/drivers/staging/lustre/lustre/lov/lov_dev.c
+++ b/drivers/staging/lustre/lustre/lov/lov_dev.c
@@ -142,7 +142,7 @@ static void *lov_key_init(const struct lu_context *ctx,
 {
 	struct lov_thread_info *info;
 
-	info = kmem_cache_alloc(lov_thread_kmem, GFP_NOFS | __GFP_ZERO);
+	info = kmem_cache_zalloc(lov_thread_kmem, GFP_NOFS);
 	if (info)
 		INIT_LIST_HEAD(&info->lti_closure.clc_list);
 	else
@@ -170,7 +170,7 @@ static void *lov_session_key_init(const struct lu_context *ctx,
 {
 	struct lov_session *info;
 
-	info = kmem_cache_alloc(lov_session_kmem, GFP_NOFS | __GFP_ZERO);
+	info = kmem_cache_zalloc(lov_session_kmem, GFP_NOFS);
 	if (!info)
 		info = ERR_PTR(-ENOMEM);
 	return info;
@@ -261,7 +261,7 @@ static int lov_req_init(const struct lu_env *env, struct cl_device *dev,
 	struct lov_req *lr;
 	int result;
 
-	lr = kmem_cache_alloc(lov_req_kmem, GFP_NOFS | __GFP_ZERO);
+	lr = kmem_cache_zalloc(lov_req_kmem, GFP_NOFS);
 	if (lr) {
 		cl_req_slice_add(req, &lr->lr_cl, dev, &lov_req_ops);
 		result = 0;
diff --git a/drivers/staging/lustre/lustre/lov/lov_ea.c b/drivers/staging/lustre/lustre/lov/lov_ea.c
index c27b884..973bb79 100644
--- a/drivers/staging/lustre/lustre/lov/lov_ea.c
+++ b/drivers/staging/lustre/lustre/lov/lov_ea.c
@@ -100,7 +100,7 @@ struct lov_stripe_md *lsm_alloc_plain(__u16 stripe_count, int *size)
 		return NULL;
 
 	for (i = 0; i < stripe_count; i++) {
-		loi = kmem_cache_alloc(lov_oinfo_slab, GFP_NOFS | __GFP_ZERO);
+		loi = kmem_cache_zalloc(lov_oinfo_slab, GFP_NOFS);
 		if (!loi)
 			goto err;
 		lsm->lsm_oinfo[i] = loi;
diff --git a/drivers/staging/lustre/lustre/lov/lov_lock.c b/drivers/staging/lustre/lustre/lov/lov_lock.c
index e0a6438..d3a30ce 100644
--- a/drivers/staging/lustre/lustre/lov/lov_lock.c
+++ b/drivers/staging/lustre/lustre/lov/lov_lock.c
@@ -144,7 +144,7 @@ static struct cl_lock *lov_sublock_alloc(const struct lu_env *env,
 
 	LASSERT(idx < lck->lls_nr);
 
-	link = kmem_cache_alloc(lov_lock_link_kmem, GFP_NOFS | __GFP_ZERO);
+	link = kmem_cache_zalloc(lov_lock_link_kmem, GFP_NOFS);
 	if (link) {
 		struct lov_sublock_env *subenv;
 		struct lov_lock_sub  *lls;
@@ -1107,7 +1107,7 @@ int lov_lock_init_raid0(const struct lu_env *env, struct cl_object *obj,
 	struct lov_lock *lck;
 	int result;
 
-	lck = kmem_cache_alloc(lov_lock_kmem, GFP_NOFS | __GFP_ZERO);
+	lck = kmem_cache_zalloc(lov_lock_kmem, GFP_NOFS);
 	if (lck) {
 		cl_lock_slice_add(lock, &lck->lls_cl, obj, &lov_lock_ops);
 		result = lov_lock_sub_init(env, lck, io);
@@ -1143,7 +1143,7 @@ int lov_lock_init_empty(const struct lu_env *env, struct cl_object *obj,
 	struct lov_lock *lck;
 	int result = -ENOMEM;
 
-	lck = kmem_cache_alloc(lov_lock_kmem, GFP_NOFS | __GFP_ZERO);
+	lck = kmem_cache_zalloc(lov_lock_kmem, GFP_NOFS);
 	if (lck) {
 		cl_lock_slice_add(lock, &lck->lls_cl, obj, &lov_empty_lock_ops);
 		lck->lls_orig = lock->cll_descr;
diff --git a/drivers/staging/lustre/lustre/lov/lov_object.c b/drivers/staging/lustre/lustre/lov/lov_object.c
index 4101696..843f4aa 100644
--- a/drivers/staging/lustre/lustre/lov/lov_object.c
+++ b/drivers/staging/lustre/lustre/lov/lov_object.c
@@ -899,7 +899,7 @@ struct lu_object *lov_object_alloc(const struct lu_env *env,
 	struct lov_object *lov;
 	struct lu_object  *obj;
 
-	lov = kmem_cache_alloc(lov_object_kmem, GFP_NOFS | __GFP_ZERO);
+	lov = kmem_cache_zalloc(lov_object_kmem, GFP_NOFS);
 	if (lov) {
 		obj = lov2lu(lov);
 		lu_object_init(obj, NULL, dev);
diff --git a/drivers/staging/lustre/lustre/lov/lov_request.c b/drivers/staging/lustre/lustre/lov/lov_request.c
index 42660f2..4f568f0 100644
--- a/drivers/staging/lustre/lustre/lov/lov_request.c
+++ b/drivers/staging/lustre/lustre/lov/lov_request.c
@@ -200,7 +200,7 @@ static int common_attr_done(struct lov_request_set *set)
 	if (!atomic_read(&set->set_success))
 		return -EIO;
 
-	tmp_oa = kmem_cache_alloc(obdo_cachep, GFP_NOFS | __GFP_ZERO);
+	tmp_oa = kmem_cache_zalloc(obdo_cachep, GFP_NOFS);
 	if (!tmp_oa) {
 		rc = -ENOMEM;
 		goto out;
@@ -307,8 +307,7 @@ int lov_prep_getattr_set(struct obd_export *exp, struct obd_info *oinfo,
 		req->rq_stripe = i;
 		req->rq_idx = loi->loi_ost_idx;
 
-		req->rq_oi.oi_oa = kmem_cache_alloc(obdo_cachep,
-						    GFP_NOFS | __GFP_ZERO);
+		req->rq_oi.oi_oa = kmem_cache_zalloc(obdo_cachep, GFP_NOFS);
 		if (!req->rq_oi.oi_oa) {
 			kfree(req);
 			rc = -ENOMEM;
@@ -390,8 +389,7 @@ int lov_prep_destroy_set(struct obd_export *exp, struct obd_info *oinfo,
 		req->rq_stripe = i;
 		req->rq_idx = loi->loi_ost_idx;
 
-		req->rq_oi.oi_oa = kmem_cache_alloc(obdo_cachep,
-						    GFP_NOFS | __GFP_ZERO);
+		req->rq_oi.oi_oa = kmem_cache_zalloc(obdo_cachep, GFP_NOFS);
 		if (!req->rq_oi.oi_oa) {
 			kfree(req);
 			rc = -ENOMEM;
@@ -507,8 +505,7 @@ int lov_prep_setattr_set(struct obd_export *exp, struct obd_info *oinfo,
 		req->rq_stripe = i;
 		req->rq_idx = loi->loi_ost_idx;
 
-		req->rq_oi.oi_oa = kmem_cache_alloc(obdo_cachep,
-						    GFP_NOFS | __GFP_ZERO);
+		req->rq_oi.oi_oa = kmem_cache_zalloc(obdo_cachep, GFP_NOFS);
 		if (!req->rq_oi.oi_oa) {
 			kfree(req);
 			rc = -ENOMEM;
diff --git a/drivers/staging/lustre/lustre/lov/lovsub_dev.c b/drivers/staging/lustre/lustre/lov/lovsub_dev.c
index 233740c..c335c02 100644
--- a/drivers/staging/lustre/lustre/lov/lovsub_dev.c
+++ b/drivers/staging/lustre/lustre/lov/lovsub_dev.c
@@ -147,7 +147,7 @@ static int lovsub_req_init(const struct lu_env *env, struct cl_device *dev,
 	struct lovsub_req *lsr;
 	int result;
 
-	lsr = kmem_cache_alloc(lovsub_req_kmem, GFP_NOFS | __GFP_ZERO);
+	lsr = kmem_cache_zalloc(lovsub_req_kmem, GFP_NOFS);
 	if (lsr) {
 		cl_req_slice_add(req, &lsr->lsrq_cl, dev, &lovsub_req_ops);
 		result = 0;
diff --git a/drivers/staging/lustre/lustre/lov/lovsub_lock.c b/drivers/staging/lustre/lustre/lov/lovsub_lock.c
index 0046812..4213957 100644
--- a/drivers/staging/lustre/lustre/lov/lovsub_lock.c
+++ b/drivers/staging/lustre/lustre/lov/lovsub_lock.c
@@ -455,7 +455,7 @@ int lovsub_lock_init(const struct lu_env *env, struct cl_object *obj,
 	struct lovsub_lock *lsk;
 	int result;
 
-	lsk = kmem_cache_alloc(lovsub_lock_kmem, GFP_NOFS | __GFP_ZERO);
+	lsk = kmem_cache_zalloc(lovsub_lock_kmem, GFP_NOFS);
 	if (lsk) {
 		INIT_LIST_HEAD(&lsk->lss_parents);
 		cl_lock_slice_add(lock, &lsk->lss_cl, obj, &lovsub_lock_ops);
diff --git a/drivers/staging/lustre/lustre/lov/lovsub_object.c b/drivers/staging/lustre/lustre/lov/lovsub_object.c
index 0a9bf51..6c5430d 100644
--- a/drivers/staging/lustre/lustre/lov/lovsub_object.c
+++ b/drivers/staging/lustre/lustre/lov/lovsub_object.c
@@ -143,7 +143,7 @@ struct lu_object *lovsub_object_alloc(const struct lu_env *env,
 	struct lovsub_object *los;
 	struct lu_object     *obj;
 
-	los = kmem_cache_alloc(lovsub_object_kmem, GFP_NOFS | __GFP_ZERO);
+	los = kmem_cache_zalloc(lovsub_object_kmem, GFP_NOFS);
 	if (los) {
 		struct cl_object_header *hdr;
 
-- 
1.9.1



^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 4/8] staging: lustre: obdecho: Replace kmem_cache_alloc with kmem_cache_zalloc
  2016-02-26  8:54 [PATCH 0/8] staging: lustre: Replace kmem_cache_alloc with kmem_cache_zalloc Amitoj Kaur Chawla
                   ` (2 preceding siblings ...)
  2016-02-26  8:54 ` [PATCH 3/8] staging: lustre: lov: " Amitoj Kaur Chawla
@ 2016-02-26  8:54 ` Amitoj Kaur Chawla
  2016-02-26  8:54 ` [PATCH 5/8] staging: lustre: ptlrpc: " Amitoj Kaur Chawla
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Amitoj Kaur Chawla @ 2016-02-26  8:54 UTC (permalink / raw)
  To: outreachy-kernel

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>
---
 drivers/staging/lustre/lustre/obdecho/echo_client.c | 8 ++++----
 1 file 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 3be28c5..1cd85d7 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;
-- 
1.9.1



^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 5/8] staging: lustre: ptlrpc: Replace kmem_cache_alloc with kmem_cache_zalloc
  2016-02-26  8:54 [PATCH 0/8] staging: lustre: Replace kmem_cache_alloc with kmem_cache_zalloc Amitoj Kaur Chawla
                   ` (3 preceding siblings ...)
  2016-02-26  8:54 ` [PATCH 4/8] staging: lustre: obdecho: " Amitoj Kaur Chawla
@ 2016-02-26  8:54 ` Amitoj Kaur Chawla
  2016-02-26  8:54 ` [PATCH 6/8] staging: lustre: osc: " Amitoj Kaur Chawla
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Amitoj Kaur Chawla @ 2016-02-26  8:54 UTC (permalink / raw)
  To: outreachy-kernel

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>
---
 drivers/staging/lustre/lustre/ptlrpc/client.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/lustre/lustre/ptlrpc/client.c b/drivers/staging/lustre/lustre/ptlrpc/client.c
index 9b89068..87d62e1 100644
--- a/drivers/staging/lustre/lustre/ptlrpc/client.c
+++ b/drivers/staging/lustre/lustre/ptlrpc/client.c
@@ -423,7 +423,7 @@ struct ptlrpc_request *ptlrpc_request_cache_alloc(gfp_t flags)
 {
 	struct ptlrpc_request *req;
 
-	req = kmem_cache_alloc(request_cache, flags | __GFP_ZERO);
+	req = kmem_cache_zalloc(request_cache, flags);
 	return req;
 }
 
-- 
1.9.1



^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 6/8] staging: lustre: osc: Replace kmem_cache_alloc with kmem_cache_zalloc
  2016-02-26  8:54 [PATCH 0/8] staging: lustre: Replace kmem_cache_alloc with kmem_cache_zalloc Amitoj Kaur Chawla
                   ` (4 preceding siblings ...)
  2016-02-26  8:54 ` [PATCH 5/8] staging: lustre: ptlrpc: " Amitoj Kaur Chawla
@ 2016-02-26  8:54 ` Amitoj Kaur Chawla
  2016-02-26  8:55 ` [PATCH 7/8] staging: lustre: ldlm: " Amitoj Kaur Chawla
  2016-02-26  8:55 ` [PATCH 8/8] staging: lustre: llite: " Amitoj Kaur Chawla
  7 siblings, 0 replies; 9+ messages in thread
From: Amitoj Kaur Chawla @ 2016-02-26  8:54 UTC (permalink / raw)
  To: outreachy-kernel

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>
---
 drivers/staging/lustre/lustre/osc/osc_cache.c   | 2 +-
 drivers/staging/lustre/lustre/osc/osc_dev.c     | 4 ++--
 drivers/staging/lustre/lustre/osc/osc_io.c      | 2 +-
 drivers/staging/lustre/lustre/osc/osc_lock.c    | 2 +-
 drivers/staging/lustre/lustre/osc/osc_object.c  | 2 +-
 drivers/staging/lustre/lustre/osc/osc_quota.c   | 2 +-
 drivers/staging/lustre/lustre/osc/osc_request.c | 4 ++--
 7 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/lustre/lustre/osc/osc_cache.c b/drivers/staging/lustre/lustre/osc/osc_cache.c
index c6623c1..c2c795f 100644
--- a/drivers/staging/lustre/lustre/osc/osc_cache.c
+++ b/drivers/staging/lustre/lustre/osc/osc_cache.c
@@ -347,7 +347,7 @@ static struct osc_extent *osc_extent_alloc(struct osc_object *obj)
 {
 	struct osc_extent *ext;
 
-	ext = kmem_cache_alloc(osc_extent_kmem, GFP_NOFS | __GFP_ZERO);
+	ext = kmem_cache_zalloc(osc_extent_kmem, GFP_NOFS);
 	if (!ext)
 		return NULL;
 
diff --git a/drivers/staging/lustre/lustre/osc/osc_dev.c b/drivers/staging/lustre/lustre/osc/osc_dev.c
index 67cb6e4..d4fe507 100644
--- a/drivers/staging/lustre/lustre/osc/osc_dev.c
+++ b/drivers/staging/lustre/lustre/osc/osc_dev.c
@@ -122,7 +122,7 @@ static void *osc_key_init(const struct lu_context *ctx,
 {
 	struct osc_thread_info *info;
 
-	info = kmem_cache_alloc(osc_thread_kmem, GFP_NOFS | __GFP_ZERO);
+	info = kmem_cache_zalloc(osc_thread_kmem, GFP_NOFS);
 	if (!info)
 		info = ERR_PTR(-ENOMEM);
 	return info;
@@ -147,7 +147,7 @@ static void *osc_session_init(const struct lu_context *ctx,
 {
 	struct osc_session *info;
 
-	info = kmem_cache_alloc(osc_session_kmem, GFP_NOFS | __GFP_ZERO);
+	info = kmem_cache_zalloc(osc_session_kmem, GFP_NOFS);
 	if (!info)
 		info = ERR_PTR(-ENOMEM);
 	return info;
diff --git a/drivers/staging/lustre/lustre/osc/osc_io.c b/drivers/staging/lustre/lustre/osc/osc_io.c
index 2d8d93c..489d73d 100644
--- a/drivers/staging/lustre/lustre/osc/osc_io.c
+++ b/drivers/staging/lustre/lustre/osc/osc_io.c
@@ -804,7 +804,7 @@ int osc_req_init(const struct lu_env *env, struct cl_device *dev,
 	struct osc_req *or;
 	int result;
 
-	or = kmem_cache_alloc(osc_req_kmem, GFP_NOFS | __GFP_ZERO);
+	or = kmem_cache_zalloc(osc_req_kmem, GFP_NOFS);
 	if (or) {
 		cl_req_slice_add(req, &or->or_cl, dev, &osc_req_ops);
 		result = 0;
diff --git a/drivers/staging/lustre/lustre/osc/osc_lock.c b/drivers/staging/lustre/lustre/osc/osc_lock.c
index 87f3522..870ca16 100644
--- a/drivers/staging/lustre/lustre/osc/osc_lock.c
+++ b/drivers/staging/lustre/lustre/osc/osc_lock.c
@@ -1567,7 +1567,7 @@ int osc_lock_init(const struct lu_env *env,
 	struct osc_lock *clk;
 	int result;
 
-	clk = kmem_cache_alloc(osc_lock_kmem, GFP_NOFS | __GFP_ZERO);
+	clk = kmem_cache_zalloc(osc_lock_kmem, GFP_NOFS);
 	if (clk) {
 		__u32 enqflags = lock->cll_descr.cld_enq_flags;
 
diff --git a/drivers/staging/lustre/lustre/osc/osc_object.c b/drivers/staging/lustre/lustre/osc/osc_object.c
index 60d8230..9d474fc 100644
--- a/drivers/staging/lustre/lustre/osc/osc_object.c
+++ b/drivers/staging/lustre/lustre/osc/osc_object.c
@@ -255,7 +255,7 @@ struct lu_object *osc_object_alloc(const struct lu_env *env,
 	struct osc_object *osc;
 	struct lu_object *obj;
 
-	osc = kmem_cache_alloc(osc_object_kmem, GFP_NOFS | __GFP_ZERO);
+	osc = kmem_cache_zalloc(osc_object_kmem, GFP_NOFS);
 	if (osc) {
 		obj = osc2lu(osc);
 		lu_object_init(obj, NULL, dev);
diff --git a/drivers/staging/lustre/lustre/osc/osc_quota.c b/drivers/staging/lustre/lustre/osc/osc_quota.c
index 208f72b..194d8ed 100644
--- a/drivers/staging/lustre/lustre/osc/osc_quota.c
+++ b/drivers/staging/lustre/lustre/osc/osc_quota.c
@@ -30,7 +30,7 @@ static inline struct osc_quota_info *osc_oqi_alloc(u32 id)
 {
 	struct osc_quota_info *oqi;
 
-	oqi = kmem_cache_alloc(osc_quota_kmem, GFP_NOFS | __GFP_ZERO);
+	oqi = kmem_cache_zalloc(osc_quota_kmem, GFP_NOFS);
 	if (oqi)
 		oqi->oqi_id = id;
 
diff --git a/drivers/staging/lustre/lustre/osc/osc_request.c b/drivers/staging/lustre/lustre/osc/osc_request.c
index 10f262f..1ef31dc 100644
--- a/drivers/staging/lustre/lustre/osc/osc_request.c
+++ b/drivers/staging/lustre/lustre/osc/osc_request.c
@@ -1897,7 +1897,7 @@ int osc_build_rpc(const struct lu_env *env, struct client_obd *cli,
 		goto out;
 	}
 
-	oa = kmem_cache_alloc(obdo_cachep, GFP_NOFS | __GFP_ZERO);
+	oa = kmem_cache_zalloc(obdo_cachep, GFP_NOFS);
 	if (!oa) {
 		rc = -ENOMEM;
 		goto out;
@@ -2959,7 +2959,7 @@ static int osc_set_info_async(const struct lu_env *env, struct obd_export *exp,
 
 		CLASSERT(sizeof(*aa) <= sizeof(req->rq_async_args));
 		aa = ptlrpc_req_async_args(req);
-		oa = kmem_cache_alloc(obdo_cachep, GFP_NOFS | __GFP_ZERO);
+		oa = kmem_cache_zalloc(obdo_cachep, GFP_NOFS);
 		if (!oa) {
 			ptlrpc_req_finished(req);
 			return -ENOMEM;
-- 
1.9.1



^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 7/8] staging: lustre: ldlm: Replace kmem_cache_alloc with kmem_cache_zalloc
  2016-02-26  8:54 [PATCH 0/8] staging: lustre: Replace kmem_cache_alloc with kmem_cache_zalloc Amitoj Kaur Chawla
                   ` (5 preceding siblings ...)
  2016-02-26  8:54 ` [PATCH 6/8] staging: lustre: osc: " Amitoj Kaur Chawla
@ 2016-02-26  8:55 ` Amitoj Kaur Chawla
  2016-02-26  8:55 ` [PATCH 8/8] staging: lustre: llite: " Amitoj Kaur Chawla
  7 siblings, 0 replies; 9+ messages in thread
From: Amitoj Kaur Chawla @ 2016-02-26  8:55 UTC (permalink / raw)
  To: outreachy-kernel

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>
---
 drivers/staging/lustre/lustre/ldlm/ldlm_extent.c   | 2 +-
 drivers/staging/lustre/lustre/ldlm/ldlm_lock.c     | 2 +-
 drivers/staging/lustre/lustre/ldlm/ldlm_resource.c | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_extent.c b/drivers/staging/lustre/lustre/ldlm/ldlm_extent.c
index 222cb62..a803e20 100644
--- a/drivers/staging/lustre/lustre/ldlm/ldlm_extent.c
+++ b/drivers/staging/lustre/lustre/ldlm/ldlm_extent.c
@@ -115,7 +115,7 @@ struct ldlm_interval *ldlm_interval_alloc(struct ldlm_lock *lock)
 	struct ldlm_interval *node;
 
 	LASSERT(lock->l_resource->lr_type == LDLM_EXTENT);
-	node = kmem_cache_alloc(ldlm_interval_slab, GFP_NOFS | __GFP_ZERO);
+	node = kmem_cache_zalloc(ldlm_interval_slab, GFP_NOFS);
 	if (!node)
 		return NULL;
 
diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c b/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c
index 98975ef..488523d 100644
--- a/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c
+++ b/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c
@@ -406,7 +406,7 @@ static struct ldlm_lock *ldlm_lock_new(struct ldlm_resource *resource)
 
 	LASSERT(resource);
 
-	lock = kmem_cache_alloc(ldlm_lock_slab, GFP_NOFS | __GFP_ZERO);
+	lock = kmem_cache_zalloc(ldlm_lock_slab, GFP_NOFS);
 	if (!lock)
 		return NULL;
 
diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c b/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c
index 03b9726..9dede87 100644
--- a/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c
+++ b/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c
@@ -1041,7 +1041,7 @@ static struct ldlm_resource *ldlm_resource_new(void)
 	struct ldlm_resource *res;
 	int idx;
 
-	res = kmem_cache_alloc(ldlm_resource_slab, GFP_NOFS | __GFP_ZERO);
+	res = kmem_cache_zalloc(ldlm_resource_slab, GFP_NOFS);
 	if (!res)
 		return NULL;
 
-- 
1.9.1



^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 8/8] staging: lustre: llite: Replace kmem_cache_alloc with kmem_cache_zalloc
  2016-02-26  8:54 [PATCH 0/8] staging: lustre: Replace kmem_cache_alloc with kmem_cache_zalloc Amitoj Kaur Chawla
                   ` (6 preceding siblings ...)
  2016-02-26  8:55 ` [PATCH 7/8] staging: lustre: ldlm: " Amitoj Kaur Chawla
@ 2016-02-26  8:55 ` Amitoj Kaur Chawla
  7 siblings, 0 replies; 9+ messages in thread
From: Amitoj Kaur Chawla @ 2016-02-26  8:55 UTC (permalink / raw)
  To: outreachy-kernel

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>
---
 drivers/staging/lustre/lustre/llite/file.c        | 4 ++--
 drivers/staging/lustre/lustre/llite/llite_close.c | 2 +-
 drivers/staging/lustre/lustre/llite/llite_lib.c   | 3 +--
 drivers/staging/lustre/lustre/llite/namei.c       | 2 +-
 drivers/staging/lustre/lustre/llite/remote_perm.c | 4 ++--
 drivers/staging/lustre/lustre/llite/super25.c     | 2 +-
 drivers/staging/lustre/lustre/llite/vvp_dev.c     | 4 ++--
 drivers/staging/lustre/lustre/llite/xattr_cache.c | 2 +-
 8 files changed, 11 insertions(+), 12 deletions(-)

diff --git a/drivers/staging/lustre/lustre/llite/file.c b/drivers/staging/lustre/lustre/llite/file.c
index 4c25cf2..8acde52 100644
--- a/drivers/staging/lustre/lustre/llite/file.c
+++ b/drivers/staging/lustre/lustre/llite/file.c
@@ -64,7 +64,7 @@ static struct ll_file_data *ll_file_data_get(void)
 {
 	struct ll_file_data *fd;
 
-	fd = kmem_cache_alloc(ll_file_data_slab, GFP_NOFS | __GFP_ZERO);
+	fd = kmem_cache_zalloc(ll_file_data_slab, GFP_NOFS);
 	if (!fd)
 		return NULL;
 	fd->fd_write_failed = false;
@@ -1278,7 +1278,7 @@ static int ll_lov_recreate(struct inode *inode, struct ost_id *oi, u32 ost_idx)
 	int rc = 0;
 	struct lov_stripe_md *lsm = NULL, *lsm2;
 
-	oa = kmem_cache_alloc(obdo_cachep, GFP_NOFS | __GFP_ZERO);
+	oa = kmem_cache_zalloc(obdo_cachep, GFP_NOFS);
 	if (!oa)
 		return -ENOMEM;
 
diff --git a/drivers/staging/lustre/lustre/llite/llite_close.c b/drivers/staging/lustre/lustre/llite/llite_close.c
index fcb6657..624015e 100644
--- a/drivers/staging/lustre/lustre/llite/llite_close.c
+++ b/drivers/staging/lustre/lustre/llite/llite_close.c
@@ -226,7 +226,7 @@ int ll_som_update(struct inode *inode, struct md_op_data *op_data)
 		       inode->i_ino, inode->i_generation,
 		       lli->lli_flags);
 
-	oa = kmem_cache_alloc(obdo_cachep, GFP_NOFS | __GFP_ZERO);
+	oa = kmem_cache_zalloc(obdo_cachep, GFP_NOFS);
 	if (!oa) {
 		CERROR("can't allocate memory for Size-on-MDS update.\n");
 		return -ENOMEM;
diff --git a/drivers/staging/lustre/lustre/llite/llite_lib.c b/drivers/staging/lustre/lustre/llite/llite_lib.c
index 1f3e8e8..deb0495 100644
--- a/drivers/staging/lustre/lustre/llite/llite_lib.c
+++ b/drivers/staging/lustre/lustre/llite/llite_lib.c
@@ -1793,8 +1793,7 @@ int ll_iocontrol(struct inode *inode, struct file *file,
 			return 0;
 		}
 
-		oinfo.oi_oa = kmem_cache_alloc(obdo_cachep,
-					       GFP_NOFS | __GFP_ZERO);
+		oinfo.oi_oa = kmem_cache_zalloc(obdo_cachep, GFP_NOFS);
 		if (!oinfo.oi_oa) {
 			ccc_inode_lsm_put(inode, lsm);
 			return -ENOMEM;
diff --git a/drivers/staging/lustre/lustre/llite/namei.c b/drivers/staging/lustre/lustre/llite/namei.c
index 56d2d1d..647c81f 100644
--- a/drivers/staging/lustre/lustre/llite/namei.c
+++ b/drivers/staging/lustre/lustre/llite/namei.c
@@ -887,7 +887,7 @@ int ll_objects_destroy(struct ptlrpc_request *request, struct inode *dir)
 	}
 	LASSERT(rc >= sizeof(*lsm));
 
-	oa = kmem_cache_alloc(obdo_cachep, GFP_NOFS | __GFP_ZERO);
+	oa = kmem_cache_zalloc(obdo_cachep, GFP_NOFS);
 	if (!oa) {
 		rc = -ENOMEM;
 		goto out_free_memmd;
diff --git a/drivers/staging/lustre/lustre/llite/remote_perm.c b/drivers/staging/lustre/lustre/llite/remote_perm.c
index fe4a722..e9d2531 100644
--- a/drivers/staging/lustre/lustre/llite/remote_perm.c
+++ b/drivers/staging/lustre/lustre/llite/remote_perm.c
@@ -61,7 +61,7 @@ static inline struct ll_remote_perm *alloc_ll_remote_perm(void)
 {
 	struct ll_remote_perm *lrp;
 
-	lrp = kmem_cache_alloc(ll_remote_perm_cachep, GFP_KERNEL | __GFP_ZERO);
+	lrp = kmem_cache_zalloc(ll_remote_perm_cachep, GFP_KERNEL);
 	if (lrp)
 		INIT_HLIST_NODE(&lrp->lrp_list);
 	return lrp;
@@ -82,7 +82,7 @@ static struct hlist_head *alloc_rmtperm_hash(void)
 	struct hlist_head *hash;
 	int i;
 
-	hash = kmem_cache_alloc(ll_rmtperm_hash_cachep, GFP_NOFS | __GFP_ZERO);
+	hash = kmem_cache_zalloc(ll_rmtperm_hash_cachep, GFP_NOFS);
 	if (!hash)
 		return NULL;
 
diff --git a/drivers/staging/lustre/lustre/llite/super25.c b/drivers/staging/lustre/lustre/llite/super25.c
index 63f090a..8733e4a 100644
--- a/drivers/staging/lustre/lustre/llite/super25.c
+++ b/drivers/staging/lustre/lustre/llite/super25.c
@@ -53,7 +53,7 @@ static struct inode *ll_alloc_inode(struct super_block *sb)
 	struct ll_inode_info *lli;
 
 	ll_stats_ops_tally(ll_s2sbi(sb), LPROC_LL_ALLOC_INODE, 1);
-	lli = kmem_cache_alloc(ll_inode_cachep, GFP_NOFS | __GFP_ZERO);
+	lli = kmem_cache_zalloc(ll_inode_cachep, GFP_NOFS);
 	if (!lli)
 		return NULL;
 
diff --git a/drivers/staging/lustre/lustre/llite/vvp_dev.c b/drivers/staging/lustre/lustre/llite/vvp_dev.c
index 6075ccf..282b70b 100644
--- a/drivers/staging/lustre/lustre/llite/vvp_dev.c
+++ b/drivers/staging/lustre/lustre/llite/vvp_dev.c
@@ -79,7 +79,7 @@ static void *vvp_key_init(const struct lu_context *ctx,
 {
 	struct vvp_thread_info *info;
 
-	info = kmem_cache_alloc(vvp_thread_kmem, GFP_NOFS | __GFP_ZERO);
+	info = kmem_cache_zalloc(vvp_thread_kmem, GFP_NOFS);
 	if (!info)
 		info = ERR_PTR(-ENOMEM);
 	return info;
@@ -98,7 +98,7 @@ static void *vvp_session_key_init(const struct lu_context *ctx,
 {
 	struct vvp_session *session;
 
-	session = kmem_cache_alloc(vvp_session_kmem, GFP_NOFS | __GFP_ZERO);
+	session = kmem_cache_zalloc(vvp_session_kmem, GFP_NOFS);
 	if (!session)
 		session = ERR_PTR(-ENOMEM);
 	return session;
diff --git a/drivers/staging/lustre/lustre/llite/xattr_cache.c b/drivers/staging/lustre/lustre/llite/xattr_cache.c
index 460b7c5..44488af 100644
--- a/drivers/staging/lustre/lustre/llite/xattr_cache.c
+++ b/drivers/staging/lustre/lustre/llite/xattr_cache.c
@@ -114,7 +114,7 @@ static int ll_xattr_cache_add(struct list_head *cache,
 		return -EPROTO;
 	}
 
-	xattr = kmem_cache_alloc(xattr_kmem, GFP_NOFS | __GFP_ZERO);
+	xattr = kmem_cache_zalloc(xattr_kmem, GFP_NOFS);
 	if (!xattr) {
 		CDEBUG(D_CACHE, "failed to allocate xattr\n");
 		return -ENOMEM;
-- 
1.9.1



^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2016-02-26  8:55 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-26  8:54 [PATCH 0/8] staging: lustre: Replace kmem_cache_alloc with kmem_cache_zalloc Amitoj Kaur Chawla
2016-02-26  8:54 ` [PATCH 1/8] staging: lustre: lclient: " Amitoj Kaur Chawla
2016-02-26  8:54 ` [PATCH 2/8] staging: lustre: obdclass: " Amitoj Kaur Chawla
2016-02-26  8:54 ` [PATCH 3/8] staging: lustre: lov: " Amitoj Kaur Chawla
2016-02-26  8:54 ` [PATCH 4/8] staging: lustre: obdecho: " Amitoj Kaur Chawla
2016-02-26  8:54 ` [PATCH 5/8] staging: lustre: ptlrpc: " Amitoj Kaur Chawla
2016-02-26  8:54 ` [PATCH 6/8] staging: lustre: osc: " Amitoj Kaur Chawla
2016-02-26  8:55 ` [PATCH 7/8] staging: lustre: ldlm: " Amitoj Kaur Chawla
2016-02-26  8:55 ` [PATCH 8/8] staging: lustre: llite: " Amitoj Kaur Chawla

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.