aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/write.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/nfs/write.c')
-rw-r--r--fs/nfs/write.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/fs/nfs/write.c b/fs/nfs/write.c
index de92b9509d94..af344a158e01 100644
--- a/fs/nfs/write.c
+++ b/fs/nfs/write.c
@@ -58,7 +58,7 @@ struct nfs_write_data *nfs_commit_alloc(void)
58 return p; 58 return p;
59} 59}
60 60
61void nfs_commit_rcu_free(struct rcu_head *head) 61static void nfs_commit_rcu_free(struct rcu_head *head)
62{ 62{
63 struct nfs_write_data *p = container_of(head, struct nfs_write_data, task.u.tk_rcu); 63 struct nfs_write_data *p = container_of(head, struct nfs_write_data, task.u.tk_rcu);
64 if (p && (p->pagevec != &p->page_array[0])) 64 if (p && (p->pagevec != &p->page_array[0]))
@@ -168,7 +168,7 @@ static void nfs_mark_uptodate(struct page *page, unsigned int base, unsigned int
168 if (count != nfs_page_length(page)) 168 if (count != nfs_page_length(page))
169 return; 169 return;
170 if (count != PAGE_CACHE_SIZE) 170 if (count != PAGE_CACHE_SIZE)
171 memclear_highpage_flush(page, count, PAGE_CACHE_SIZE - count); 171 zero_user_page(page, count, PAGE_CACHE_SIZE - count, KM_USER0);
172 SetPageUptodate(page); 172 SetPageUptodate(page);
173} 173}
174 174
@@ -273,8 +273,6 @@ static int nfs_page_async_flush(struct nfs_pageio_descriptor *pgio,
273 * request as dirty (in which case we don't care). 273 * request as dirty (in which case we don't care).
274 */ 274 */
275 spin_unlock(req_lock); 275 spin_unlock(req_lock);
276 /* Prevent deadlock! */
277 nfs_pageio_complete(pgio);
278 ret = nfs_wait_on_request(req); 276 ret = nfs_wait_on_request(req);
279 nfs_release_request(req); 277 nfs_release_request(req);
280 if (ret != 0) 278 if (ret != 0)
@@ -321,6 +319,8 @@ static int nfs_writepage_locked(struct page *page, struct writeback_control *wbc
321 pgio = &mypgio; 319 pgio = &mypgio;
322 } 320 }
323 321
322 nfs_pageio_cond_complete(pgio, page->index);
323
324 err = nfs_page_async_flush(pgio, page); 324 err = nfs_page_async_flush(pgio, page);
325 if (err <= 0) 325 if (err <= 0)
326 goto out; 326 goto out;
@@ -329,6 +329,8 @@ static int nfs_writepage_locked(struct page *page, struct writeback_control *wbc
329 if (!offset) 329 if (!offset)
330 goto out; 330 goto out;
331 331
332 nfs_pageio_cond_complete(pgio, page->index);
333
332 ctx = nfs_find_open_context(inode, NULL, FMODE_WRITE); 334 ctx = nfs_find_open_context(inode, NULL, FMODE_WRITE);
333 if (ctx == NULL) { 335 if (ctx == NULL) {
334 err = -EBADF; 336 err = -EBADF;
@@ -922,7 +924,7 @@ static int nfs_flush_one(struct inode *inode, struct list_head *head, unsigned i
922 return 0; 924 return 0;
923 out_bad: 925 out_bad:
924 while (!list_empty(head)) { 926 while (!list_empty(head)) {
925 struct nfs_page *req = nfs_list_entry(head->next); 927 req = nfs_list_entry(head->next);
926 nfs_list_remove_request(req); 928 nfs_list_remove_request(req);
927 nfs_redirty_request(req); 929 nfs_redirty_request(req);
928 nfs_end_page_writeback(req->wb_page); 930 nfs_end_page_writeback(req->wb_page);