diff options
-rw-r--r-- | fs/nfs/internal.h | 15 | ||||
-rw-r--r-- | fs/nfs/pnfs_nfs.c | 5 | ||||
-rw-r--r-- | fs/nfs/write.c | 29 |
3 files changed, 37 insertions, 12 deletions
diff --git a/fs/nfs/internal.h b/fs/nfs/internal.h index 9b372b845f6a..1dad18105ed0 100644 --- a/fs/nfs/internal.h +++ b/fs/nfs/internal.h | |||
@@ -490,6 +490,9 @@ void nfs_retry_commit(struct list_head *page_list, | |||
490 | void nfs_commitdata_release(struct nfs_commit_data *data); | 490 | void nfs_commitdata_release(struct nfs_commit_data *data); |
491 | void nfs_request_add_commit_list(struct nfs_page *req, struct list_head *dst, | 491 | void nfs_request_add_commit_list(struct nfs_page *req, struct list_head *dst, |
492 | struct nfs_commit_info *cinfo); | 492 | struct nfs_commit_info *cinfo); |
493 | void nfs_request_add_commit_list_locked(struct nfs_page *req, | ||
494 | struct list_head *dst, | ||
495 | struct nfs_commit_info *cinfo); | ||
493 | void nfs_request_remove_commit_list(struct nfs_page *req, | 496 | void nfs_request_remove_commit_list(struct nfs_page *req, |
494 | struct nfs_commit_info *cinfo); | 497 | struct nfs_commit_info *cinfo); |
495 | void nfs_init_cinfo(struct nfs_commit_info *cinfo, | 498 | void nfs_init_cinfo(struct nfs_commit_info *cinfo, |
@@ -623,13 +626,15 @@ void nfs_super_set_maxbytes(struct super_block *sb, __u64 maxfilesize) | |||
623 | * Record the page as unstable and mark its inode as dirty. | 626 | * Record the page as unstable and mark its inode as dirty. |
624 | */ | 627 | */ |
625 | static inline | 628 | static inline |
626 | void nfs_mark_page_unstable(struct page *page) | 629 | void nfs_mark_page_unstable(struct page *page, struct nfs_commit_info *cinfo) |
627 | { | 630 | { |
628 | struct inode *inode = page_file_mapping(page)->host; | 631 | if (!cinfo->dreq) { |
632 | struct inode *inode = page_file_mapping(page)->host; | ||
629 | 633 | ||
630 | inc_zone_page_state(page, NR_UNSTABLE_NFS); | 634 | inc_zone_page_state(page, NR_UNSTABLE_NFS); |
631 | inc_wb_stat(&inode_to_bdi(inode)->wb, WB_RECLAIMABLE); | 635 | inc_wb_stat(&inode_to_bdi(inode)->wb, WB_RECLAIMABLE); |
632 | __mark_inode_dirty(inode, I_DIRTY_DATASYNC); | 636 | __mark_inode_dirty(inode, I_DIRTY_DATASYNC); |
637 | } | ||
633 | } | 638 | } |
634 | 639 | ||
635 | /* | 640 | /* |
diff --git a/fs/nfs/pnfs_nfs.c b/fs/nfs/pnfs_nfs.c index f37e25b6311c..7a282876662f 100644 --- a/fs/nfs/pnfs_nfs.c +++ b/fs/nfs/pnfs_nfs.c | |||
@@ -863,9 +863,10 @@ pnfs_layout_mark_request_commit(struct nfs_page *req, | |||
863 | } | 863 | } |
864 | set_bit(PG_COMMIT_TO_DS, &req->wb_flags); | 864 | set_bit(PG_COMMIT_TO_DS, &req->wb_flags); |
865 | cinfo->ds->nwritten++; | 865 | cinfo->ds->nwritten++; |
866 | spin_unlock(cinfo->lock); | ||
867 | 866 | ||
868 | nfs_request_add_commit_list(req, list, cinfo); | 867 | nfs_request_add_commit_list_locked(req, list, cinfo); |
868 | spin_unlock(cinfo->lock); | ||
869 | nfs_mark_page_unstable(req->wb_page, cinfo); | ||
869 | } | 870 | } |
870 | EXPORT_SYMBOL_GPL(pnfs_layout_mark_request_commit); | 871 | EXPORT_SYMBOL_GPL(pnfs_layout_mark_request_commit); |
871 | 872 | ||
diff --git a/fs/nfs/write.c b/fs/nfs/write.c index 75a35a1afa79..fdee9270ca15 100644 --- a/fs/nfs/write.c +++ b/fs/nfs/write.c | |||
@@ -768,6 +768,28 @@ nfs_page_search_commits_for_head_request_locked(struct nfs_inode *nfsi, | |||
768 | } | 768 | } |
769 | 769 | ||
770 | /** | 770 | /** |
771 | * nfs_request_add_commit_list_locked - add request to a commit list | ||
772 | * @req: pointer to a struct nfs_page | ||
773 | * @dst: commit list head | ||
774 | * @cinfo: holds list lock and accounting info | ||
775 | * | ||
776 | * This sets the PG_CLEAN bit, updates the cinfo count of | ||
777 | * number of outstanding requests requiring a commit as well as | ||
778 | * the MM page stats. | ||
779 | * | ||
780 | * The caller must hold the cinfo->lock, and the nfs_page lock. | ||
781 | */ | ||
782 | void | ||
783 | nfs_request_add_commit_list_locked(struct nfs_page *req, struct list_head *dst, | ||
784 | struct nfs_commit_info *cinfo) | ||
785 | { | ||
786 | set_bit(PG_CLEAN, &req->wb_flags); | ||
787 | nfs_list_add_request(req, dst); | ||
788 | cinfo->mds->ncommit++; | ||
789 | } | ||
790 | EXPORT_SYMBOL_GPL(nfs_request_add_commit_list_locked); | ||
791 | |||
792 | /** | ||
771 | * nfs_request_add_commit_list - add request to a commit list | 793 | * nfs_request_add_commit_list - add request to a commit list |
772 | * @req: pointer to a struct nfs_page | 794 | * @req: pointer to a struct nfs_page |
773 | * @dst: commit list head | 795 | * @dst: commit list head |
@@ -784,13 +806,10 @@ void | |||
784 | nfs_request_add_commit_list(struct nfs_page *req, struct list_head *dst, | 806 | nfs_request_add_commit_list(struct nfs_page *req, struct list_head *dst, |
785 | struct nfs_commit_info *cinfo) | 807 | struct nfs_commit_info *cinfo) |
786 | { | 808 | { |
787 | set_bit(PG_CLEAN, &(req)->wb_flags); | ||
788 | spin_lock(cinfo->lock); | 809 | spin_lock(cinfo->lock); |
789 | nfs_list_add_request(req, dst); | 810 | nfs_request_add_commit_list_locked(req, dst, cinfo); |
790 | cinfo->mds->ncommit++; | ||
791 | spin_unlock(cinfo->lock); | 811 | spin_unlock(cinfo->lock); |
792 | if (!cinfo->dreq) | 812 | nfs_mark_page_unstable(req->wb_page, cinfo); |
793 | nfs_mark_page_unstable(req->wb_page); | ||
794 | } | 813 | } |
795 | EXPORT_SYMBOL_GPL(nfs_request_add_commit_list); | 814 | EXPORT_SYMBOL_GPL(nfs_request_add_commit_list); |
796 | 815 | ||