aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/nfs/pagelist.c10
-rw-r--r--fs/nfs/write.c2
2 files changed, 7 insertions, 5 deletions
diff --git a/fs/nfs/pagelist.c b/fs/nfs/pagelist.c
index d6e076c9dbe1..106aca388ebc 100644
--- a/fs/nfs/pagelist.c
+++ b/fs/nfs/pagelist.c
@@ -88,7 +88,6 @@ nfs_create_request(struct nfs_open_context *ctx, struct inode *inode,
88 BUG_ON(PagePrivate(page)); 88 BUG_ON(PagePrivate(page));
89 BUG_ON(!PageLocked(page)); 89 BUG_ON(!PageLocked(page));
90 BUG_ON(page->mapping->host != inode); 90 BUG_ON(page->mapping->host != inode);
91 SetPagePrivate(page);
92 req->wb_offset = offset; 91 req->wb_offset = offset;
93 req->wb_pgbase = offset; 92 req->wb_pgbase = offset;
94 req->wb_bytes = count; 93 req->wb_bytes = count;
@@ -136,9 +135,11 @@ void nfs_clear_page_writeback(struct nfs_page *req)
136{ 135{
137 struct nfs_inode *nfsi = NFS_I(req->wb_context->dentry->d_inode); 136 struct nfs_inode *nfsi = NFS_I(req->wb_context->dentry->d_inode);
138 137
139 spin_lock(&nfsi->req_lock); 138 if (req->wb_page != NULL) {
140 radix_tree_tag_clear(&nfsi->nfs_page_tree, req->wb_index, NFS_PAGE_TAG_WRITEBACK); 139 spin_lock(&nfsi->req_lock);
141 spin_unlock(&nfsi->req_lock); 140 radix_tree_tag_clear(&nfsi->nfs_page_tree, req->wb_index, NFS_PAGE_TAG_WRITEBACK);
141 spin_unlock(&nfsi->req_lock);
142 }
142 nfs_unlock_request(req); 143 nfs_unlock_request(req);
143} 144}
144 145
@@ -153,7 +154,6 @@ void nfs_clear_request(struct nfs_page *req)
153{ 154{
154 struct page *page = req->wb_page; 155 struct page *page = req->wb_page;
155 if (page != NULL) { 156 if (page != NULL) {
156 ClearPagePrivate(page);
157 page_cache_release(page); 157 page_cache_release(page);
158 req->wb_page = NULL; 158 req->wb_page = NULL;
159 } 159 }
diff --git a/fs/nfs/write.c b/fs/nfs/write.c
index 647e3217c2e1..d9e5ee594572 100644
--- a/fs/nfs/write.c
+++ b/fs/nfs/write.c
@@ -429,6 +429,7 @@ static int nfs_inode_add_request(struct inode *inode, struct nfs_page *req)
429 if (nfs_have_delegation(inode, FMODE_WRITE)) 429 if (nfs_have_delegation(inode, FMODE_WRITE))
430 nfsi->change_attr++; 430 nfsi->change_attr++;
431 } 431 }
432 SetPagePrivate(req->wb_page);
432 nfsi->npages++; 433 nfsi->npages++;
433 atomic_inc(&req->wb_count); 434 atomic_inc(&req->wb_count);
434 return 0; 435 return 0;
@@ -445,6 +446,7 @@ static void nfs_inode_remove_request(struct nfs_page *req)
445 BUG_ON (!NFS_WBACK_BUSY(req)); 446 BUG_ON (!NFS_WBACK_BUSY(req));
446 447
447 spin_lock(&nfsi->req_lock); 448 spin_lock(&nfsi->req_lock);
449 ClearPagePrivate(req->wb_page);
448 radix_tree_delete(&nfsi->nfs_page_tree, req->wb_index); 450 radix_tree_delete(&nfsi->nfs_page_tree, req->wb_index);
449 nfsi->npages--; 451 nfsi->npages--;
450 if (!nfsi->npages) { 452 if (!nfsi->npages) {