Commit a635179e authored by Trond Myklebust's avatar Trond Myklebust

Subject: [PATCH] NFS: Sync NFS writes still use kmalloc

 Replace the kmalloc() and kfree() calls in this path with appropriate
 invocations of nfs_writedata_alloc() and nfs_writedata_free().  This
 makes nfs_writepage_sync match all the other write paths in fs/nfs/write.c.

 Category: Maintainability, performance
Signed-off-by: default avatarChuck Lever <cel@netapp.com>
Signed-off-by: default avatarTrond Myklebust <trond.myklebust@fys.uio.no>
parent ce168911
...@@ -184,11 +184,10 @@ static int nfs_writepage_sync(struct nfs_open_context *ctx, struct inode *inode, ...@@ -184,11 +184,10 @@ static int nfs_writepage_sync(struct nfs_open_context *ctx, struct inode *inode,
int result, written = 0; int result, written = 0;
struct nfs_write_data *wdata; struct nfs_write_data *wdata;
wdata = kmalloc(sizeof(*wdata), GFP_NOFS); wdata = nfs_writedata_alloc();
if (!wdata) if (!wdata)
return -ENOMEM; return -ENOMEM;
memset(wdata, 0, sizeof(*wdata));
wdata->flags = how; wdata->flags = how;
wdata->cred = ctx->cred; wdata->cred = ctx->cred;
wdata->inode = inode; wdata->inode = inode;
...@@ -238,8 +237,7 @@ static int nfs_writepage_sync(struct nfs_open_context *ctx, struct inode *inode, ...@@ -238,8 +237,7 @@ static int nfs_writepage_sync(struct nfs_open_context *ctx, struct inode *inode,
io_error: io_error:
nfs_end_data_update_defer(inode); nfs_end_data_update_defer(inode);
nfs_writedata_free(wdata);
kfree(wdata);
return written ? written : result; return written ? written : result;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment