aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/write.c
diff options
context:
space:
mode:
authorAndy Adamson <andros@netapp.com>2012-04-27 17:53:44 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2012-05-19 17:54:19 -0400
commit9f0ec176b3071e0472582c07ae1e68055b28184d (patch)
treea767381b136e8ac9f7839917b477fd7cd8cf9dc3 /fs/nfs/write.c
parent90fecfcb3437dfc9bec4ee3306584dcd6843701b (diff)
NFSv4.1 set RPC_TASK_SOFTCONN for filelayout DS RPC calls
RPC_TASK_SOFTCONN returns connection errors to the caller which allows the pNFS file layout to quickly try the MDS or perhaps another DS. Signed-off-by: Andy Adamson <andros@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/write.c')
-rw-r--r--fs/nfs/write.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/fs/nfs/write.c b/fs/nfs/write.c
index 8ffd7d5ed58b..e6fe3d69d14c 100644
--- a/fs/nfs/write.c
+++ b/fs/nfs/write.c
@@ -916,7 +916,7 @@ static int flush_task_priority(int how)
916int nfs_initiate_write(struct rpc_clnt *clnt, 916int nfs_initiate_write(struct rpc_clnt *clnt,
917 struct nfs_write_data *data, 917 struct nfs_write_data *data,
918 const struct rpc_call_ops *call_ops, 918 const struct rpc_call_ops *call_ops,
919 int how) 919 int how, int flags)
920{ 920{
921 struct inode *inode = data->header->inode; 921 struct inode *inode = data->header->inode;
922 int priority = flush_task_priority(how); 922 int priority = flush_task_priority(how);
@@ -933,7 +933,7 @@ int nfs_initiate_write(struct rpc_clnt *clnt,
933 .callback_ops = call_ops, 933 .callback_ops = call_ops,
934 .callback_data = data, 934 .callback_data = data,
935 .workqueue = nfsiod_workqueue, 935 .workqueue = nfsiod_workqueue,
936 .flags = RPC_TASK_ASYNC, 936 .flags = RPC_TASK_ASYNC | flags,
937 .priority = priority, 937 .priority = priority,
938 }; 938 };
939 int ret = 0; 939 int ret = 0;
@@ -1009,7 +1009,7 @@ static int nfs_do_write(struct nfs_write_data *data,
1009{ 1009{
1010 struct inode *inode = data->header->inode; 1010 struct inode *inode = data->header->inode;
1011 1011
1012 return nfs_initiate_write(NFS_CLIENT(inode), data, call_ops, how); 1012 return nfs_initiate_write(NFS_CLIENT(inode), data, call_ops, how, 0);
1013} 1013}
1014 1014
1015static int nfs_do_multiple_writes(struct list_head *head, 1015static int nfs_do_multiple_writes(struct list_head *head,
@@ -1394,7 +1394,7 @@ EXPORT_SYMBOL_GPL(nfs_commitdata_release);
1394 1394
1395int nfs_initiate_commit(struct rpc_clnt *clnt, struct nfs_commit_data *data, 1395int nfs_initiate_commit(struct rpc_clnt *clnt, struct nfs_commit_data *data,
1396 const struct rpc_call_ops *call_ops, 1396 const struct rpc_call_ops *call_ops,
1397 int how) 1397 int how, int flags)
1398{ 1398{
1399 struct rpc_task *task; 1399 struct rpc_task *task;
1400 int priority = flush_task_priority(how); 1400 int priority = flush_task_priority(how);
@@ -1410,7 +1410,7 @@ int nfs_initiate_commit(struct rpc_clnt *clnt, struct nfs_commit_data *data,
1410 .callback_ops = call_ops, 1410 .callback_ops = call_ops,
1411 .callback_data = data, 1411 .callback_data = data,
1412 .workqueue = nfsiod_workqueue, 1412 .workqueue = nfsiod_workqueue,
1413 .flags = RPC_TASK_ASYNC, 1413 .flags = RPC_TASK_ASYNC | flags,
1414 .priority = priority, 1414 .priority = priority,
1415 }; 1415 };
1416 /* Set up the initial task struct. */ 1416 /* Set up the initial task struct. */
@@ -1499,7 +1499,8 @@ nfs_commit_list(struct inode *inode, struct list_head *head, int how,
1499 /* Set up the argument struct */ 1499 /* Set up the argument struct */
1500 nfs_init_commit(data, head, NULL, cinfo); 1500 nfs_init_commit(data, head, NULL, cinfo);
1501 atomic_inc(&cinfo->mds->rpcs_out); 1501 atomic_inc(&cinfo->mds->rpcs_out);
1502 return nfs_initiate_commit(NFS_CLIENT(inode), data, data->mds_ops, how); 1502 return nfs_initiate_commit(NFS_CLIENT(inode), data, data->mds_ops,
1503 how, 0);
1503 out_bad: 1504 out_bad:
1504 nfs_retry_commit(head, NULL, cinfo); 1505 nfs_retry_commit(head, NULL, cinfo);
1505 cinfo->completion_ops->error_cleanup(NFS_I(inode)); 1506 cinfo->completion_ops->error_cleanup(NFS_I(inode));