Skip to content

Commit

Permalink
orangefs: replace vmalloc and memset with vzalloc
Browse files Browse the repository at this point in the history
Use vzalloc instead of the vmalloc, memset combo

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Mike Marshall <hubcap@omnibond.com>
  • Loading branch information
Colin Ian King authored and Mike Marshall committed Apr 2, 2018
1 parent c2676ef commit 81e3d02
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions fs/orangefs/devorangefs-req.c
Original file line number Diff line number Diff line change
Expand Up @@ -463,11 +463,10 @@ 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)
goto Enomem;

memset(op->downcall.trailer_buf, 0, op->downcall.trailer_size);
if (!copy_from_iter_full(op->downcall.trailer_buf,
op->downcall.trailer_size, iter)) {
gossip_err("%s: failed to copy trailer.\n", __func__);
Expand Down

0 comments on commit 81e3d02

Please sign in to comment.