aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/write.c
diff options
context:
space:
mode:
authorFred Isaman <iisaman@netapp.com>2011-03-03 10:13:47 -0500
committerTrond Myklebust <Trond.Myklebust@netapp.com>2011-03-11 15:38:44 -0500
commita69aef1496726ed88386dad65abfcc8cd3195304 (patch)
tree66766c9eed54e6dc7ddf9ecaf8765a7bc833685e /fs/nfs/write.c
parent7ffd10640dc008f6d5a375bd6450755745c63c7d (diff)
NFSv4.1: pnfs filelayout driver write
Allows the pnfs filelayout driver to write to the data servers. Note that COMMIT to data servers will be implemented in a future patch. To avoid improper behavior, for the moment any WRITE to a data server that would also require a COMMIT to the data server is sent NFS_FILE_SYNC. Signed-off-by: Andy Adamson <andros@citi.umich.edu> Signed-off-by: Dean Hildebrand <dhildeb@us.ibm.com> Signed-off-by: Fred Isaman <iisaman@citi.umich.edu> Signed-off-by: Mingyang Guo <guomingyang@nrchpc.ac.cn> Signed-off-by: Oleg Drokin <green@linuxhacker.ru> Signed-off-by: Ricardo Labiaga <Ricardo.Labiaga@netapp.com> Signed-off-by: Andy Adamson <andros@netapp.com> Signed-off-by: Benny Halevy <bhalevy@panasas.com> Signed-off-by: Fred Isaman <iisaman@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/write.c')
-rw-r--r--fs/nfs/write.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/nfs/write.c b/fs/nfs/write.c
index df99c5b0ee65..ee62ddf60e7a 100644
--- a/fs/nfs/write.c
+++ b/fs/nfs/write.c
@@ -783,7 +783,7 @@ static int flush_task_priority(int how)
783 return RPC_PRIORITY_NORMAL; 783 return RPC_PRIORITY_NORMAL;
784} 784}
785 785
786static int nfs_initiate_write(struct nfs_write_data *data, 786int nfs_initiate_write(struct nfs_write_data *data,
787 struct rpc_clnt *clnt, 787 struct rpc_clnt *clnt,
788 const struct rpc_call_ops *call_ops, 788 const struct rpc_call_ops *call_ops,
789 int how) 789 int how)
@@ -833,6 +833,7 @@ static int nfs_initiate_write(struct nfs_write_data *data,
833out: 833out:
834 return ret; 834 return ret;
835} 835}
836EXPORT_SYMBOL_GPL(nfs_initiate_write);
836 837
837/* 838/*
838 * Set up the argument/result storage required for the RPC call. 839 * Set up the argument/result storage required for the RPC call.
@@ -1194,6 +1195,7 @@ void nfs_writeback_done(struct rpc_task *task, struct nfs_write_data *data)
1194 */ 1195 */
1195 static unsigned long complain; 1196 static unsigned long complain;
1196 1197
1198 /* Note this will print the MDS for a DS write */
1197 if (time_before(complain, jiffies)) { 1199 if (time_before(complain, jiffies)) {
1198 dprintk("NFS: faulty NFS server %s:" 1200 dprintk("NFS: faulty NFS server %s:"
1199 " (committed = %d) != (stable = %d)\n", 1201 " (committed = %d) != (stable = %d)\n",
@@ -1214,6 +1216,7 @@ void nfs_writeback_done(struct rpc_task *task, struct nfs_write_data *data)
1214 /* Was this an NFSv2 write or an NFSv3 stable write? */ 1216 /* Was this an NFSv2 write or an NFSv3 stable write? */
1215 if (resp->verf->committed != NFS_UNSTABLE) { 1217 if (resp->verf->committed != NFS_UNSTABLE) {
1216 /* Resend from where the server left off */ 1218 /* Resend from where the server left off */
1219 data->mds_offset += resp->count;
1217 argp->offset += resp->count; 1220 argp->offset += resp->count;
1218 argp->pgbase += resp->count; 1221 argp->pgbase += resp->count;
1219 argp->count -= resp->count; 1222 argp->count -= resp->count;