aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/proc.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/nfs/proc.c')
-rw-r--r--fs/nfs/proc.c24
1 files changed, 5 insertions, 19 deletions
diff --git a/fs/nfs/proc.c b/fs/nfs/proc.c
index 2b051ab8bea8..608aa5932a1d 100644
--- a/fs/nfs/proc.c
+++ b/fs/nfs/proc.c
@@ -654,26 +654,15 @@ nfs_proc_read_setup(struct nfs_read_data *data)
654 rpc_call_setup(task, &msg, 0); 654 rpc_call_setup(task, &msg, 0);
655} 655}
656 656
657static void nfs_write_done(struct rpc_task *task, void *calldata) 657static int nfs_write_done(struct rpc_task *task, struct nfs_write_data *data)
658{ 658{
659 struct nfs_write_data *data = calldata;
660
661 if (task->tk_status >= 0) 659 if (task->tk_status >= 0)
662 nfs_post_op_update_inode(data->inode, data->res.fattr); 660 nfs_post_op_update_inode(data->inode, data->res.fattr);
663 nfs_writeback_done(task, calldata); 661 return 0;
664} 662}
665 663
666static const struct rpc_call_ops nfs_write_ops = { 664static void nfs_proc_write_setup(struct nfs_write_data *data, int how)
667 .rpc_call_done = nfs_write_done,
668 .rpc_release = nfs_writedata_release,
669};
670
671static void
672nfs_proc_write_setup(struct nfs_write_data *data, int how)
673{ 665{
674 struct rpc_task *task = &data->task;
675 struct inode *inode = data->inode;
676 int flags;
677 struct rpc_message msg = { 666 struct rpc_message msg = {
678 .rpc_proc = &nfs_procedures[NFSPROC_WRITE], 667 .rpc_proc = &nfs_procedures[NFSPROC_WRITE],
679 .rpc_argp = &data->args, 668 .rpc_argp = &data->args,
@@ -684,12 +673,8 @@ nfs_proc_write_setup(struct nfs_write_data *data, int how)
684 /* Note: NFSv2 ignores @stable and always uses NFS_FILE_SYNC */ 673 /* Note: NFSv2 ignores @stable and always uses NFS_FILE_SYNC */
685 data->args.stable = NFS_FILE_SYNC; 674 data->args.stable = NFS_FILE_SYNC;
686 675
687 /* Set the initial flags for the task. */
688 flags = (how & FLUSH_SYNC) ? 0 : RPC_TASK_ASYNC;
689
690 /* Finalize the task. */ 676 /* Finalize the task. */
691 rpc_init_task(task, NFS_CLIENT(inode), flags, &nfs_write_ops, data); 677 rpc_call_setup(&data->task, &msg, 0);
692 rpc_call_setup(task, &msg, 0);
693} 678}
694 679
695static void 680static void
@@ -736,6 +721,7 @@ struct nfs_rpc_ops nfs_v2_clientops = {
736 .decode_dirent = nfs_decode_dirent, 721 .decode_dirent = nfs_decode_dirent,
737 .read_setup = nfs_proc_read_setup, 722 .read_setup = nfs_proc_read_setup,
738 .write_setup = nfs_proc_write_setup, 723 .write_setup = nfs_proc_write_setup,
724 .write_done = nfs_write_done,
739 .commit_setup = nfs_proc_commit_setup, 725 .commit_setup = nfs_proc_commit_setup,
740 .file_open = nfs_open, 726 .file_open = nfs_open,
741 .file_release = nfs_release, 727 .file_release = nfs_release,