diff options
author | Weston Andros Adamson <dros@primarydata.com> | 2014-09-05 18:20:21 -0400 |
---|---|---|
committer | Tom Haynes <loghyr@primarydata.com> | 2015-02-03 14:06:45 -0500 |
commit | b57ff1303a2d4d1484c7a82bd80a3e014d6cdf5e (patch) | |
tree | da3d760d94a39ecbf89e4ea5b0ed5e5017f26fde /fs/nfs/write.c | |
parent | 6cccbb6f52dceec5f4faed8846ac05ae830640e6 (diff) |
pnfs: pass ds_commit_idx through the commit path
Pass ds_commit_idx through the nfs commit path. It's used to select
the commit bucket when using pnfs and is ignored when not using pnfs.
Several functions had to be changed: nfs_retry_commit,
nfs_mark_request_commit, pnfs_mark_request_commit and the pnfs layout
driver .mark_request_commit functions.
Signed-off-by: Tom Haynes <loghyr@primarydata.com>
Diffstat (limited to 'fs/nfs/write.c')
-rw-r--r-- | fs/nfs/write.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/fs/nfs/write.c b/fs/nfs/write.c index e9974574b19a..2bee165fddcf 100644 --- a/fs/nfs/write.c +++ b/fs/nfs/write.c | |||
@@ -847,9 +847,9 @@ EXPORT_SYMBOL_GPL(nfs_init_cinfo); | |||
847 | */ | 847 | */ |
848 | void | 848 | void |
849 | nfs_mark_request_commit(struct nfs_page *req, struct pnfs_layout_segment *lseg, | 849 | nfs_mark_request_commit(struct nfs_page *req, struct pnfs_layout_segment *lseg, |
850 | struct nfs_commit_info *cinfo) | 850 | struct nfs_commit_info *cinfo, u32 ds_commit_idx) |
851 | { | 851 | { |
852 | if (pnfs_mark_request_commit(req, lseg, cinfo)) | 852 | if (pnfs_mark_request_commit(req, lseg, cinfo, ds_commit_idx)) |
853 | return; | 853 | return; |
854 | nfs_request_add_commit_list(req, &cinfo->mds->list, cinfo); | 854 | nfs_request_add_commit_list(req, &cinfo->mds->list, cinfo); |
855 | } | 855 | } |
@@ -905,7 +905,8 @@ static void nfs_write_completion(struct nfs_pgio_header *hdr) | |||
905 | } | 905 | } |
906 | if (nfs_write_need_commit(hdr)) { | 906 | if (nfs_write_need_commit(hdr)) { |
907 | memcpy(&req->wb_verf, &hdr->verf.verifier, sizeof(req->wb_verf)); | 907 | memcpy(&req->wb_verf, &hdr->verf.verifier, sizeof(req->wb_verf)); |
908 | nfs_mark_request_commit(req, hdr->lseg, &cinfo); | 908 | nfs_mark_request_commit(req, hdr->lseg, &cinfo, |
909 | 0); | ||
909 | goto next; | 910 | goto next; |
910 | } | 911 | } |
911 | remove_req: | 912 | remove_req: |
@@ -1560,14 +1561,15 @@ EXPORT_SYMBOL_GPL(nfs_init_commit); | |||
1560 | 1561 | ||
1561 | void nfs_retry_commit(struct list_head *page_list, | 1562 | void nfs_retry_commit(struct list_head *page_list, |
1562 | struct pnfs_layout_segment *lseg, | 1563 | struct pnfs_layout_segment *lseg, |
1563 | struct nfs_commit_info *cinfo) | 1564 | struct nfs_commit_info *cinfo, |
1565 | u32 ds_commit_idx) | ||
1564 | { | 1566 | { |
1565 | struct nfs_page *req; | 1567 | struct nfs_page *req; |
1566 | 1568 | ||
1567 | while (!list_empty(page_list)) { | 1569 | while (!list_empty(page_list)) { |
1568 | req = nfs_list_entry(page_list->next); | 1570 | req = nfs_list_entry(page_list->next); |
1569 | nfs_list_remove_request(req); | 1571 | nfs_list_remove_request(req); |
1570 | nfs_mark_request_commit(req, lseg, cinfo); | 1572 | nfs_mark_request_commit(req, lseg, cinfo, ds_commit_idx); |
1571 | if (!cinfo->dreq) { | 1573 | if (!cinfo->dreq) { |
1572 | dec_zone_page_state(req->wb_page, NR_UNSTABLE_NFS); | 1574 | dec_zone_page_state(req->wb_page, NR_UNSTABLE_NFS); |
1573 | dec_bdi_stat(page_file_mapping(req->wb_page)->backing_dev_info, | 1575 | dec_bdi_stat(page_file_mapping(req->wb_page)->backing_dev_info, |
@@ -1598,7 +1600,7 @@ nfs_commit_list(struct inode *inode, struct list_head *head, int how, | |||
1598 | return nfs_initiate_commit(NFS_CLIENT(inode), data, NFS_PROTO(inode), | 1600 | return nfs_initiate_commit(NFS_CLIENT(inode), data, NFS_PROTO(inode), |
1599 | data->mds_ops, how, 0); | 1601 | data->mds_ops, how, 0); |
1600 | out_bad: | 1602 | out_bad: |
1601 | nfs_retry_commit(head, NULL, cinfo); | 1603 | nfs_retry_commit(head, NULL, cinfo, 0); |
1602 | cinfo->completion_ops->error_cleanup(NFS_I(inode)); | 1604 | cinfo->completion_ops->error_cleanup(NFS_I(inode)); |
1603 | return -ENOMEM; | 1605 | return -ENOMEM; |
1604 | } | 1606 | } |