aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/write.c
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2007-10-25 18:42:54 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2008-01-30 02:05:39 -0500
commit0773769191d943358a8392fa86abd756d004c4b6 (patch)
tree2eeba848f7c1e6ba90696190f05db26c2f31655e /fs/nfs/write.c
parente8f5d77c8029ff8f5dcd1dfc133aac0bbbffd92b (diff)
NFS/SUNRPC: Convert users of rpc_init_task+rpc_execute to rpc_run_task()
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/write.c')
-rw-r--r--fs/nfs/write.c24
1 files changed, 10 insertions, 14 deletions
diff --git a/fs/nfs/write.c b/fs/nfs/write.c
index 9a69469274ae..fbd64f2fa7f9 100644
--- a/fs/nfs/write.c
+++ b/fs/nfs/write.c
@@ -764,16 +764,6 @@ static int flush_task_priority(int how)
764 return RPC_PRIORITY_NORMAL; 764 return RPC_PRIORITY_NORMAL;
765} 765}
766 766
767static void nfs_execute_write(struct nfs_write_data *data)
768{
769 struct rpc_clnt *clnt = NFS_CLIENT(data->inode);
770 sigset_t oldset;
771
772 rpc_clnt_sigmask(clnt, &oldset);
773 rpc_execute(&data->task);
774 rpc_clnt_sigunmask(clnt, &oldset);
775}
776
777/* 767/*
778 * Set up the argument/result storage required for the RPC call. 768 * Set up the argument/result storage required for the RPC call.
779 */ 769 */
@@ -786,6 +776,7 @@ static void nfs_write_rpcsetup(struct nfs_page *req,
786 struct inode *inode = req->wb_context->path.dentry->d_inode; 776 struct inode *inode = req->wb_context->path.dentry->d_inode;
787 int flags = (how & FLUSH_SYNC) ? 0 : RPC_TASK_ASYNC; 777 int flags = (how & FLUSH_SYNC) ? 0 : RPC_TASK_ASYNC;
788 int priority = flush_task_priority(how); 778 int priority = flush_task_priority(how);
779 struct rpc_task *task;
789 struct rpc_message msg = { 780 struct rpc_message msg = {
790 .rpc_argp = &data->args, 781 .rpc_argp = &data->args,
791 .rpc_resp = &data->res, 782 .rpc_resp = &data->res,
@@ -793,6 +784,7 @@ static void nfs_write_rpcsetup(struct nfs_page *req,
793 }; 784 };
794 struct rpc_task_setup task_setup_data = { 785 struct rpc_task_setup task_setup_data = {
795 .rpc_client = NFS_CLIENT(inode), 786 .rpc_client = NFS_CLIENT(inode),
787 .task = &data->task,
796 .rpc_message = &msg, 788 .rpc_message = &msg,
797 .callback_ops = call_ops, 789 .callback_ops = call_ops,
798 .callback_data = data, 790 .callback_data = data,
@@ -827,7 +819,6 @@ static void nfs_write_rpcsetup(struct nfs_page *req,
827 819
828 /* Set up the initial task struct. */ 820 /* Set up the initial task struct. */
829 NFS_PROTO(inode)->write_setup(data, &msg); 821 NFS_PROTO(inode)->write_setup(data, &msg);
830 rpc_init_task(&data->task, &task_setup_data);
831 822
832 dprintk("NFS: %5u initiated write call " 823 dprintk("NFS: %5u initiated write call "
833 "(req %s/%Ld, %u bytes @ offset %Lu)\n", 824 "(req %s/%Ld, %u bytes @ offset %Lu)\n",
@@ -837,7 +828,9 @@ static void nfs_write_rpcsetup(struct nfs_page *req,
837 count, 828 count,
838 (unsigned long long)data->args.offset); 829 (unsigned long long)data->args.offset);
839 830
840 nfs_execute_write(data); 831 task = rpc_run_task(&task_setup_data);
832 if (!IS_ERR(task))
833 rpc_put_task(task);
841} 834}
842 835
843/* 836/*
@@ -1164,12 +1157,14 @@ static void nfs_commit_rpcsetup(struct list_head *head,
1164 struct inode *inode = first->wb_context->path.dentry->d_inode; 1157 struct inode *inode = first->wb_context->path.dentry->d_inode;
1165 int flags = (how & FLUSH_SYNC) ? 0 : RPC_TASK_ASYNC; 1158 int flags = (how & FLUSH_SYNC) ? 0 : RPC_TASK_ASYNC;
1166 int priority = flush_task_priority(how); 1159 int priority = flush_task_priority(how);
1160 struct rpc_task *task;
1167 struct rpc_message msg = { 1161 struct rpc_message msg = {
1168 .rpc_argp = &data->args, 1162 .rpc_argp = &data->args,
1169 .rpc_resp = &data->res, 1163 .rpc_resp = &data->res,
1170 .rpc_cred = first->wb_context->cred, 1164 .rpc_cred = first->wb_context->cred,
1171 }; 1165 };
1172 struct rpc_task_setup task_setup_data = { 1166 struct rpc_task_setup task_setup_data = {
1167 .task = &data->task,
1173 .rpc_client = NFS_CLIENT(inode), 1168 .rpc_client = NFS_CLIENT(inode),
1174 .rpc_message = &msg, 1169 .rpc_message = &msg,
1175 .callback_ops = &nfs_commit_ops, 1170 .callback_ops = &nfs_commit_ops,
@@ -1197,11 +1192,12 @@ static void nfs_commit_rpcsetup(struct list_head *head,
1197 1192
1198 /* Set up the initial task struct. */ 1193 /* Set up the initial task struct. */
1199 NFS_PROTO(inode)->commit_setup(data, &msg); 1194 NFS_PROTO(inode)->commit_setup(data, &msg);
1200 rpc_init_task(&data->task, &task_setup_data);
1201 1195
1202 dprintk("NFS: %5u initiated commit call\n", data->task.tk_pid); 1196 dprintk("NFS: %5u initiated commit call\n", data->task.tk_pid);
1203 1197
1204 nfs_execute_write(data); 1198 task = rpc_run_task(&task_setup_data);
1199 if (!IS_ERR(task))
1200 rpc_put_task(task);
1205} 1201}
1206 1202
1207/* 1203/*