diff options
author | Peng Tao <tao.peng@primarydata.com> | 2014-06-08 19:10:14 -0400 |
---|---|---|
committer | Tom Haynes <loghyr@primarydata.com> | 2015-02-03 14:06:35 -0500 |
commit | c36aae9ad95afa2f9a9e9109d989c21af221fabd (patch) | |
tree | 60658de1393e59d61b66d143073faa17f92a6587 | |
parent | abde71f4d3c027a30f8d725e1e22001313b4481a (diff) |
nfs: allow different protocol in nfs_initiate_commit
pnfs flexfile layout client may want to use NFSv3 ops rather
than the default MDS v4 ops.
Signed-off-by: Peng Tao <tao.peng@primarydata.com>
Signed-off-by: Tom Haynes <Thomas.Haynes@primarydata.com>
-rw-r--r-- | fs/nfs/filelayout/filelayout.c | 2 | ||||
-rw-r--r-- | fs/nfs/internal.h | 1 | ||||
-rw-r--r-- | fs/nfs/pnfs_nfs.c | 1 | ||||
-rw-r--r-- | fs/nfs/write.c | 7 |
4 files changed, 7 insertions, 4 deletions
diff --git a/fs/nfs/filelayout/filelayout.c b/fs/nfs/filelayout/filelayout.c index 25c4896887ca..e5a3c5b1398f 100644 --- a/fs/nfs/filelayout/filelayout.c +++ b/fs/nfs/filelayout/filelayout.c | |||
@@ -1055,7 +1055,7 @@ static int filelayout_initiate_commit(struct nfs_commit_data *data, int how) | |||
1055 | fh = select_ds_fh_from_commit(lseg, data->ds_commit_index); | 1055 | fh = select_ds_fh_from_commit(lseg, data->ds_commit_index); |
1056 | if (fh) | 1056 | if (fh) |
1057 | data->args.fh = fh; | 1057 | data->args.fh = fh; |
1058 | return nfs_initiate_commit(ds_clnt, data, | 1058 | return nfs_initiate_commit(ds_clnt, data, NFS_PROTO(data->inode), |
1059 | &filelayout_commit_call_ops, how, | 1059 | &filelayout_commit_call_ops, how, |
1060 | RPC_TASK_SOFTCONN); | 1060 | RPC_TASK_SOFTCONN); |
1061 | out_err: | 1061 | out_err: |
diff --git a/fs/nfs/internal.h b/fs/nfs/internal.h index 1d15ffa94937..98dee834e9d6 100644 --- a/fs/nfs/internal.h +++ b/fs/nfs/internal.h | |||
@@ -436,6 +436,7 @@ extern void nfs_write_prepare(struct rpc_task *task, void *calldata); | |||
436 | extern void nfs_commit_prepare(struct rpc_task *task, void *calldata); | 436 | extern void nfs_commit_prepare(struct rpc_task *task, void *calldata); |
437 | extern int nfs_initiate_commit(struct rpc_clnt *clnt, | 437 | extern int nfs_initiate_commit(struct rpc_clnt *clnt, |
438 | struct nfs_commit_data *data, | 438 | struct nfs_commit_data *data, |
439 | const struct nfs_rpc_ops *nfs_ops, | ||
439 | const struct rpc_call_ops *call_ops, | 440 | const struct rpc_call_ops *call_ops, |
440 | int how, int flags); | 441 | int how, int flags); |
441 | extern void nfs_init_commit(struct nfs_commit_data *data, | 442 | extern void nfs_init_commit(struct nfs_commit_data *data, |
diff --git a/fs/nfs/pnfs_nfs.c b/fs/nfs/pnfs_nfs.c index 23c851d4c9a9..c87f664587ee 100644 --- a/fs/nfs/pnfs_nfs.c +++ b/fs/nfs/pnfs_nfs.c | |||
@@ -278,6 +278,7 @@ pnfs_generic_commit_pagelist(struct inode *inode, struct list_head *mds_pages, | |||
278 | if (!data->lseg) { | 278 | if (!data->lseg) { |
279 | nfs_init_commit(data, mds_pages, NULL, cinfo); | 279 | nfs_init_commit(data, mds_pages, NULL, cinfo); |
280 | nfs_initiate_commit(NFS_CLIENT(inode), data, | 280 | nfs_initiate_commit(NFS_CLIENT(inode), data, |
281 | NFS_PROTO(data->inode), | ||
281 | data->mds_ops, how, 0); | 282 | data->mds_ops, how, 0); |
282 | } else { | 283 | } else { |
283 | struct pnfs_commit_bucket *buckets; | 284 | struct pnfs_commit_bucket *buckets; |
diff --git a/fs/nfs/write.c b/fs/nfs/write.c index 54d4857e0e2b..8800bd3b235d 100644 --- a/fs/nfs/write.c +++ b/fs/nfs/write.c | |||
@@ -1465,6 +1465,7 @@ void nfs_commitdata_release(struct nfs_commit_data *data) | |||
1465 | EXPORT_SYMBOL_GPL(nfs_commitdata_release); | 1465 | EXPORT_SYMBOL_GPL(nfs_commitdata_release); |
1466 | 1466 | ||
1467 | int nfs_initiate_commit(struct rpc_clnt *clnt, struct nfs_commit_data *data, | 1467 | int nfs_initiate_commit(struct rpc_clnt *clnt, struct nfs_commit_data *data, |
1468 | const struct nfs_rpc_ops *nfs_ops, | ||
1468 | const struct rpc_call_ops *call_ops, | 1469 | const struct rpc_call_ops *call_ops, |
1469 | int how, int flags) | 1470 | int how, int flags) |
1470 | { | 1471 | { |
@@ -1486,7 +1487,7 @@ int nfs_initiate_commit(struct rpc_clnt *clnt, struct nfs_commit_data *data, | |||
1486 | .priority = priority, | 1487 | .priority = priority, |
1487 | }; | 1488 | }; |
1488 | /* Set up the initial task struct. */ | 1489 | /* Set up the initial task struct. */ |
1489 | NFS_PROTO(data->inode)->commit_setup(data, &msg); | 1490 | nfs_ops->commit_setup(data, &msg); |
1490 | 1491 | ||
1491 | dprintk("NFS: %5u initiated commit call\n", data->task.tk_pid); | 1492 | dprintk("NFS: %5u initiated commit call\n", data->task.tk_pid); |
1492 | 1493 | ||
@@ -1589,8 +1590,8 @@ nfs_commit_list(struct inode *inode, struct list_head *head, int how, | |||
1589 | /* Set up the argument struct */ | 1590 | /* Set up the argument struct */ |
1590 | nfs_init_commit(data, head, NULL, cinfo); | 1591 | nfs_init_commit(data, head, NULL, cinfo); |
1591 | atomic_inc(&cinfo->mds->rpcs_out); | 1592 | atomic_inc(&cinfo->mds->rpcs_out); |
1592 | return nfs_initiate_commit(NFS_CLIENT(inode), data, data->mds_ops, | 1593 | return nfs_initiate_commit(NFS_CLIENT(inode), data, NFS_PROTO(inode), |
1593 | how, 0); | 1594 | data->mds_ops, how, 0); |
1594 | out_bad: | 1595 | out_bad: |
1595 | nfs_retry_commit(head, NULL, cinfo); | 1596 | nfs_retry_commit(head, NULL, cinfo); |
1596 | cinfo->completion_ops->error_cleanup(NFS_I(inode)); | 1597 | cinfo->completion_ops->error_cleanup(NFS_I(inode)); |