i386 mm: use pte_update() in ptep_test_and_clear_dirty()
[powerpc.git] / fs / nfs / write.c
index de92b95..af344a1 100644 (file)
@@ -58,7 +58,7 @@ struct nfs_write_data *nfs_commit_alloc(void)
        return p;
 }
 
-void nfs_commit_rcu_free(struct rcu_head *head)
+static void nfs_commit_rcu_free(struct rcu_head *head)
 {
        struct nfs_write_data *p = container_of(head, struct nfs_write_data, task.u.tk_rcu);
        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
        if (count != nfs_page_length(page))
                return;
        if (count != PAGE_CACHE_SIZE)
-               memclear_highpage_flush(page, count, PAGE_CACHE_SIZE - count);
+               zero_user_page(page, count, PAGE_CACHE_SIZE - count, KM_USER0);
        SetPageUptodate(page);
 }
 
@@ -273,8 +273,6 @@ static int nfs_page_async_flush(struct nfs_pageio_descriptor *pgio,
                 *       request as dirty (in which case we don't care).
                 */
                spin_unlock(req_lock);
-               /* Prevent deadlock! */
-               nfs_pageio_complete(pgio);
                ret = nfs_wait_on_request(req);
                nfs_release_request(req);
                if (ret != 0)
@@ -321,6 +319,8 @@ static int nfs_writepage_locked(struct page *page, struct writeback_control *wbc
                pgio = &mypgio;
        }
 
+       nfs_pageio_cond_complete(pgio, page->index);
+
        err = nfs_page_async_flush(pgio, page);
        if (err <= 0)
                goto out;
@@ -329,6 +329,8 @@ static int nfs_writepage_locked(struct page *page, struct writeback_control *wbc
        if (!offset)
                goto out;
 
+       nfs_pageio_cond_complete(pgio, page->index);
+
        ctx = nfs_find_open_context(inode, NULL, FMODE_WRITE);
        if (ctx == NULL) {
                err = -EBADF;
@@ -922,7 +924,7 @@ static int nfs_flush_one(struct inode *inode, struct list_head *head, unsigned i
        return 0;
  out_bad:
        while (!list_empty(head)) {
-               struct nfs_page *req = nfs_list_entry(head->next);
+               req = nfs_list_entry(head->next);
                nfs_list_remove_request(req);
                nfs_redirty_request(req);
                nfs_end_page_writeback(req->wb_page);