aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFred Isaman <iisaman@netapp.com>2011-03-03 10:13:43 -0500
committerTrond Myklebust <Trond.Myklebust@netapp.com>2011-03-11 15:38:44 -0500
commit5053aa568d4017aeb1fa35247d4ad96be262920f (patch)
treea15850e0465c555310a41880c7e9454109a1f952
parentb029bc9b0880cbaf999f580c0ea8f06dd274fc77 (diff)
NFSv4.1: Send lseg down into nfs_write_rpcsetup
We grab the lseg sent in from the doio function and attach it to each struct nfs_write_data created. This is how the lseg will be sent to the layout driver. Signed-off-by: Fred Isaman <iisaman@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
-rw-r--r--fs/nfs/write.c7
-rw-r--r--include/linux/nfs_xdr.h1
2 files changed, 6 insertions, 2 deletions
diff --git a/fs/nfs/write.c b/fs/nfs/write.c
index ae035990941..72b0ec0bb0e 100644
--- a/fs/nfs/write.c
+++ b/fs/nfs/write.c
@@ -97,6 +97,7 @@ void nfs_writedata_free(struct nfs_write_data *p)
97 97
98static void nfs_writedata_release(struct nfs_write_data *wdata) 98static void nfs_writedata_release(struct nfs_write_data *wdata)
99{ 99{
100 put_lseg(wdata->lseg);
100 put_nfs_open_context(wdata->args.context); 101 put_nfs_open_context(wdata->args.context);
101 nfs_writedata_free(wdata); 102 nfs_writedata_free(wdata);
102} 103}
@@ -840,6 +841,7 @@ static int nfs_write_rpcsetup(struct nfs_page *req,
840 struct nfs_write_data *data, 841 struct nfs_write_data *data,
841 const struct rpc_call_ops *call_ops, 842 const struct rpc_call_ops *call_ops,
842 unsigned int count, unsigned int offset, 843 unsigned int count, unsigned int offset,
844 struct pnfs_layout_segment *lseg,
843 int how) 845 int how)
844{ 846{
845 struct inode *inode = req->wb_context->path.dentry->d_inode; 847 struct inode *inode = req->wb_context->path.dentry->d_inode;
@@ -850,6 +852,7 @@ static int nfs_write_rpcsetup(struct nfs_page *req,
850 data->req = req; 852 data->req = req;
851 data->inode = inode = req->wb_context->path.dentry->d_inode; 853 data->inode = inode = req->wb_context->path.dentry->d_inode;
852 data->cred = req->wb_context->cred; 854 data->cred = req->wb_context->cred;
855 data->lseg = get_lseg(lseg);
853 856
854 data->args.fh = NFS_FH(inode); 857 data->args.fh = NFS_FH(inode);
855 data->args.offset = req_offset(req) + offset; 858 data->args.offset = req_offset(req) + offset;
@@ -930,7 +933,7 @@ static int nfs_flush_multi(struct inode *inode, struct list_head *head, unsigned
930 if (nbytes < wsize) 933 if (nbytes < wsize)
931 wsize = nbytes; 934 wsize = nbytes;
932 ret2 = nfs_write_rpcsetup(req, data, &nfs_write_partial_ops, 935 ret2 = nfs_write_rpcsetup(req, data, &nfs_write_partial_ops,
933 wsize, offset, how); 936 wsize, offset, lseg, how);
934 if (ret == 0) 937 if (ret == 0)
935 ret = ret2; 938 ret = ret2;
936 offset += wsize; 939 offset += wsize;
@@ -978,7 +981,7 @@ static int nfs_flush_one(struct inode *inode, struct list_head *head, unsigned i
978 req = nfs_list_entry(data->pages.next); 981 req = nfs_list_entry(data->pages.next);
979 982
980 /* Set up the argument struct */ 983 /* Set up the argument struct */
981 return nfs_write_rpcsetup(req, data, &nfs_write_full_ops, count, 0, how); 984 return nfs_write_rpcsetup(req, data, &nfs_write_full_ops, count, 0, lseg, how);
982 out_bad: 985 out_bad:
983 while (!list_empty(head)) { 986 while (!list_empty(head)) {
984 req = nfs_list_entry(head->next); 987 req = nfs_list_entry(head->next);
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h
index 21cd41ddbca..09d96812d6d 100644
--- a/include/linux/nfs_xdr.h
+++ b/include/linux/nfs_xdr.h
@@ -1038,6 +1038,7 @@ struct nfs_write_data {
1038 unsigned int npages; /* Max length of pagevec */ 1038 unsigned int npages; /* Max length of pagevec */
1039 struct nfs_writeargs args; /* argument struct */ 1039 struct nfs_writeargs args; /* argument struct */
1040 struct nfs_writeres res; /* result struct */ 1040 struct nfs_writeres res; /* result struct */
1041 struct pnfs_layout_segment *lseg;
1041 int (*write_done_cb) (struct rpc_task *task, struct nfs_write_data *data); 1042 int (*write_done_cb) (struct rpc_task *task, struct nfs_write_data *data);
1042#ifdef CONFIG_NFS_V4 1043#ifdef CONFIG_NFS_V4
1043 unsigned long timestamp; /* For lease renewal */ 1044 unsigned long timestamp; /* For lease renewal */