aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnna Schumaker <Anna.Schumaker@netapp.com>2014-05-06 09:12:28 -0400
committerTrond Myklebust <trond.myklebust@primarydata.com>2014-05-28 18:39:38 -0400
commitf79d06f544a797d75cbf5256a5d06c4b3d2759cc (patch)
treead080d398b71acc7b802d7635933740645778ff9
parentc0752cdfbbb691cfe98812f7aed8ce1e766823c4 (diff)
NFS: Move the write verifier into the nfs_pgio_header
The header had a pointer to the verifier that was set from the old write data struct. We don't need to keep the pointer around now that we have shared structures. Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com> Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
-rw-r--r--fs/nfs/direct.c4
-rw-r--r--fs/nfs/write.c7
-rw-r--r--include/linux/nfs_xdr.h3
3 files changed, 6 insertions, 8 deletions
diff --git a/fs/nfs/direct.c b/fs/nfs/direct.c
index bbe688e2cc89..164b0167677b 100644
--- a/fs/nfs/direct.c
+++ b/fs/nfs/direct.c
@@ -813,12 +813,12 @@ static void nfs_direct_write_completion(struct nfs_pgio_header *hdr)
813 if (dreq->flags == NFS_ODIRECT_RESCHED_WRITES) 813 if (dreq->flags == NFS_ODIRECT_RESCHED_WRITES)
814 bit = NFS_IOHDR_NEED_RESCHED; 814 bit = NFS_IOHDR_NEED_RESCHED;
815 else if (dreq->flags == 0) { 815 else if (dreq->flags == 0) {
816 memcpy(&dreq->verf, hdr->verf, 816 memcpy(&dreq->verf, &hdr->verf,
817 sizeof(dreq->verf)); 817 sizeof(dreq->verf));
818 bit = NFS_IOHDR_NEED_COMMIT; 818 bit = NFS_IOHDR_NEED_COMMIT;
819 dreq->flags = NFS_ODIRECT_DO_COMMIT; 819 dreq->flags = NFS_ODIRECT_DO_COMMIT;
820 } else if (dreq->flags == NFS_ODIRECT_DO_COMMIT) { 820 } else if (dreq->flags == NFS_ODIRECT_DO_COMMIT) {
821 if (memcmp(&dreq->verf, hdr->verf, sizeof(dreq->verf))) { 821 if (memcmp(&dreq->verf, &hdr->verf, sizeof(dreq->verf))) {
822 dreq->flags = NFS_ODIRECT_RESCHED_WRITES; 822 dreq->flags = NFS_ODIRECT_RESCHED_WRITES;
823 bit = NFS_IOHDR_NEED_RESCHED; 823 bit = NFS_IOHDR_NEED_RESCHED;
824 } else 824 } else
diff --git a/fs/nfs/write.c b/fs/nfs/write.c
index 37c4c988519c..321a791c72bf 100644
--- a/fs/nfs/write.c
+++ b/fs/nfs/write.c
@@ -82,7 +82,6 @@ struct nfs_rw_header *nfs_writehdr_alloc(void)
82 INIT_LIST_HEAD(&hdr->rpc_list); 82 INIT_LIST_HEAD(&hdr->rpc_list);
83 spin_lock_init(&hdr->lock); 83 spin_lock_init(&hdr->lock);
84 atomic_set(&hdr->refcnt, 0); 84 atomic_set(&hdr->refcnt, 0);
85 hdr->verf = &p->verf;
86 } 85 }
87 return p; 86 return p;
88} 87}
@@ -644,7 +643,7 @@ static void nfs_write_completion(struct nfs_pgio_header *hdr)
644 goto next; 643 goto next;
645 } 644 }
646 if (test_bit(NFS_IOHDR_NEED_COMMIT, &hdr->flags)) { 645 if (test_bit(NFS_IOHDR_NEED_COMMIT, &hdr->flags)) {
647 memcpy(&req->wb_verf, &hdr->verf->verifier, sizeof(req->wb_verf)); 646 memcpy(&req->wb_verf, &hdr->verf.verifier, sizeof(req->wb_verf));
648 nfs_mark_request_commit(req, hdr->lseg, &cinfo); 647 nfs_mark_request_commit(req, hdr->lseg, &cinfo);
649 goto next; 648 goto next;
650 } 649 }
@@ -1344,8 +1343,8 @@ static void nfs_writeback_release_common(void *calldata)
1344 if (test_bit(NFS_IOHDR_NEED_RESCHED, &hdr->flags)) 1343 if (test_bit(NFS_IOHDR_NEED_RESCHED, &hdr->flags))
1345 ; /* Do nothing */ 1344 ; /* Do nothing */
1346 else if (!test_and_set_bit(NFS_IOHDR_NEED_COMMIT, &hdr->flags)) 1345 else if (!test_and_set_bit(NFS_IOHDR_NEED_COMMIT, &hdr->flags))
1347 memcpy(hdr->verf, &data->verf, sizeof(*hdr->verf)); 1346 memcpy(&hdr->verf, &data->verf, sizeof(hdr->verf));
1348 else if (memcmp(hdr->verf, &data->verf, sizeof(*hdr->verf))) 1347 else if (memcmp(&hdr->verf, &data->verf, sizeof(hdr->verf)))
1349 set_bit(NFS_IOHDR_NEED_RESCHED, &hdr->flags); 1348 set_bit(NFS_IOHDR_NEED_RESCHED, &hdr->flags);
1350 spin_unlock(&hdr->lock); 1349 spin_unlock(&hdr->lock);
1351 } 1350 }
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h
index 2d34e0dc1870..965c2aa6b33f 100644
--- a/include/linux/nfs_xdr.h
+++ b/include/linux/nfs_xdr.h
@@ -1263,7 +1263,7 @@ struct nfs_pgio_header {
1263 struct list_head rpc_list; 1263 struct list_head rpc_list;
1264 atomic_t refcnt; 1264 atomic_t refcnt;
1265 struct nfs_page *req; 1265 struct nfs_page *req;
1266 struct nfs_writeverf *verf; 1266 struct nfs_writeverf verf; /* Used for writes */
1267 struct pnfs_layout_segment *lseg; 1267 struct pnfs_layout_segment *lseg;
1268 loff_t io_start; 1268 loff_t io_start;
1269 const struct rpc_call_ops *mds_ops; 1269 const struct rpc_call_ops *mds_ops;
@@ -1297,7 +1297,6 @@ struct nfs_pgio_data {
1297struct nfs_rw_header { 1297struct nfs_rw_header {
1298 struct nfs_pgio_header header; 1298 struct nfs_pgio_header header;
1299 struct nfs_pgio_data rpc_data; 1299 struct nfs_pgio_data rpc_data;
1300 struct nfs_writeverf verf;
1301}; 1300};
1302 1301
1303struct nfs_mds_commit_info { 1302struct nfs_mds_commit_info {