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: Chuck Lever Signed-off-by: Trond Myklebust --- fs/nfs/write.c | 6 ++---- 1 files changed, 2 insertions(+), 4 deletions(-) diff -X /home/cel/src/linux/dont-diff -Naurp 04-nfs-dir-msgs/fs/nfs/write.c 05-nfs-sync-write-alloc/fs/nfs/write.c --- 04-nfs-dir-msgs/fs/nfs/write.c 2004-09-15 10:45:33.000000000 -0400 +++ 05-nfs-sync-write-alloc/fs/nfs/write.c 2004-09-15 12:28:17.000000000 -0400 @@ -184,11 +184,10 @@ static int nfs_writepage_sync(struct nfs int result, written = 0; struct nfs_write_data *wdata; - wdata = kmalloc(sizeof(*wdata), GFP_NOFS); + wdata = nfs_writedata_alloc(); if (!wdata) return -ENOMEM; - memset(wdata, 0, sizeof(*wdata)); wdata->flags = how; wdata->cred = ctx->cred; wdata->inode = inode; @@ -238,8 +237,7 @@ static int nfs_writepage_sync(struct nfs io_error: nfs_end_data_update_defer(inode); - - kfree(wdata); + nfs_writedata_free(wdata); return written ? written : result; }