All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH -next] orangefs: use vzalloc() instead of vmalloc()/memset(0)
@ 2016-07-06 13:23 weiyj_lk
  2016-07-06 17:28 ` Mike Marshall
  0 siblings, 1 reply; 6+ messages in thread
From: weiyj_lk @ 2016-07-06 13:23 UTC (permalink / raw)
  To: Mike Marshall; +Cc: Wei Yongjun, linux-kernel

From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

Use vzalloc() instead of vmalloc() and memset(0).

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
---
 fs/orangefs/devorangefs-req.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/fs/orangefs/devorangefs-req.c b/fs/orangefs/devorangefs-req.c
index a287a66..e839073 100644
--- a/fs/orangefs/devorangefs-req.c
+++ b/fs/orangefs/devorangefs-req.c
@@ -442,14 +442,12 @@ static ssize_t orangefs_devreq_write_iter(struct kiocb *iocb,
 	if (op->downcall.type != ORANGEFS_VFS_OP_READDIR)
 		goto wakeup;
 
-	op->downcall.trailer_buf =
-		vmalloc(op->downcall.trailer_size);
+	op->downcall.trailer_buf = vzalloc(op->downcall.trailer_size);
 	if (op->downcall.trailer_buf == NULL) {
 		gossip_err("%s: failed trailer vmalloc.\n",
 			   __func__);
 		goto Enomem;
 	}
-	memset(op->downcall.trailer_buf, 0, op->downcall.trailer_size);
 	n = copy_from_iter(op->downcall.trailer_buf,
 			   op->downcall.trailer_size,
 			   iter);

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

end of thread, other threads:[~2016-07-06 19:01 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-06 13:23 [PATCH -next] orangefs: use vzalloc() instead of vmalloc()/memset(0) weiyj_lk
2016-07-06 17:28 ` Mike Marshall
2016-07-06 17:49   ` Joe Perches
2016-07-06 18:00     ` Mike Marshall
2016-07-06 18:11       ` Joe Perches
2016-07-06 19:01         ` Mike Marshall

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.