diff options
Diffstat (limited to 'fs/nfs/write.c')
-rw-r--r-- | fs/nfs/write.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/fs/nfs/write.c b/fs/nfs/write.c index 5f4fd53e5764..9283a96b9fb8 100644 --- a/fs/nfs/write.c +++ b/fs/nfs/write.c | |||
@@ -804,7 +804,7 @@ nfs_page_search_commits_for_head_request_locked(struct nfs_inode *nfsi, | |||
804 | * number of outstanding requests requiring a commit as well as | 804 | * number of outstanding requests requiring a commit as well as |
805 | * the MM page stats. | 805 | * the MM page stats. |
806 | * | 806 | * |
807 | * The caller must hold the cinfo->lock, and the nfs_page lock. | 807 | * The caller must hold cinfo->inode->i_lock, and the nfs_page lock. |
808 | */ | 808 | */ |
809 | void | 809 | void |
810 | nfs_request_add_commit_list_locked(struct nfs_page *req, struct list_head *dst, | 810 | nfs_request_add_commit_list_locked(struct nfs_page *req, struct list_head *dst, |
@@ -832,9 +832,9 @@ EXPORT_SYMBOL_GPL(nfs_request_add_commit_list_locked); | |||
832 | void | 832 | void |
833 | nfs_request_add_commit_list(struct nfs_page *req, struct nfs_commit_info *cinfo) | 833 | nfs_request_add_commit_list(struct nfs_page *req, struct nfs_commit_info *cinfo) |
834 | { | 834 | { |
835 | spin_lock(cinfo->lock); | 835 | spin_lock(&cinfo->inode->i_lock); |
836 | nfs_request_add_commit_list_locked(req, &cinfo->mds->list, cinfo); | 836 | nfs_request_add_commit_list_locked(req, &cinfo->mds->list, cinfo); |
837 | spin_unlock(cinfo->lock); | 837 | spin_unlock(&cinfo->inode->i_lock); |
838 | nfs_mark_page_unstable(req->wb_page, cinfo); | 838 | nfs_mark_page_unstable(req->wb_page, cinfo); |
839 | } | 839 | } |
840 | EXPORT_SYMBOL_GPL(nfs_request_add_commit_list); | 840 | EXPORT_SYMBOL_GPL(nfs_request_add_commit_list); |
@@ -864,7 +864,7 @@ EXPORT_SYMBOL_GPL(nfs_request_remove_commit_list); | |||
864 | static void nfs_init_cinfo_from_inode(struct nfs_commit_info *cinfo, | 864 | static void nfs_init_cinfo_from_inode(struct nfs_commit_info *cinfo, |
865 | struct inode *inode) | 865 | struct inode *inode) |
866 | { | 866 | { |
867 | cinfo->lock = &inode->i_lock; | 867 | cinfo->inode = inode; |
868 | cinfo->mds = &NFS_I(inode)->commit_info; | 868 | cinfo->mds = &NFS_I(inode)->commit_info; |
869 | cinfo->ds = pnfs_get_ds_info(inode); | 869 | cinfo->ds = pnfs_get_ds_info(inode); |
870 | cinfo->dreq = NULL; | 870 | cinfo->dreq = NULL; |
@@ -967,7 +967,7 @@ nfs_reqs_to_commit(struct nfs_commit_info *cinfo) | |||
967 | return cinfo->mds->ncommit; | 967 | return cinfo->mds->ncommit; |
968 | } | 968 | } |
969 | 969 | ||
970 | /* cinfo->lock held by caller */ | 970 | /* cinfo->inode->i_lock held by caller */ |
971 | int | 971 | int |
972 | nfs_scan_commit_list(struct list_head *src, struct list_head *dst, | 972 | nfs_scan_commit_list(struct list_head *src, struct list_head *dst, |
973 | struct nfs_commit_info *cinfo, int max) | 973 | struct nfs_commit_info *cinfo, int max) |
@@ -979,7 +979,7 @@ nfs_scan_commit_list(struct list_head *src, struct list_head *dst, | |||
979 | if (!nfs_lock_request(req)) | 979 | if (!nfs_lock_request(req)) |
980 | continue; | 980 | continue; |
981 | kref_get(&req->wb_kref); | 981 | kref_get(&req->wb_kref); |
982 | if (cond_resched_lock(cinfo->lock)) | 982 | if (cond_resched_lock(&cinfo->inode->i_lock)) |
983 | list_safe_reset_next(req, tmp, wb_list); | 983 | list_safe_reset_next(req, tmp, wb_list); |
984 | nfs_request_remove_commit_list(req, cinfo); | 984 | nfs_request_remove_commit_list(req, cinfo); |
985 | nfs_list_add_request(req, dst); | 985 | nfs_list_add_request(req, dst); |
@@ -1005,7 +1005,7 @@ nfs_scan_commit(struct inode *inode, struct list_head *dst, | |||
1005 | { | 1005 | { |
1006 | int ret = 0; | 1006 | int ret = 0; |
1007 | 1007 | ||
1008 | spin_lock(cinfo->lock); | 1008 | spin_lock(&cinfo->inode->i_lock); |
1009 | if (cinfo->mds->ncommit > 0) { | 1009 | if (cinfo->mds->ncommit > 0) { |
1010 | const int max = INT_MAX; | 1010 | const int max = INT_MAX; |
1011 | 1011 | ||
@@ -1013,7 +1013,7 @@ nfs_scan_commit(struct inode *inode, struct list_head *dst, | |||
1013 | cinfo, max); | 1013 | cinfo, max); |
1014 | ret += pnfs_scan_commit_lists(inode, cinfo, max - ret); | 1014 | ret += pnfs_scan_commit_lists(inode, cinfo, max - ret); |
1015 | } | 1015 | } |
1016 | spin_unlock(cinfo->lock); | 1016 | spin_unlock(&cinfo->inode->i_lock); |
1017 | return ret; | 1017 | return ret; |
1018 | } | 1018 | } |
1019 | 1019 | ||