Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 267208
b: refs/heads/master
c: 2da9565
h: refs/heads/master
v: v3
  • Loading branch information
Jeff Layton authored and Trond Myklebust committed Oct 18, 2011
1 parent 0cf4cee commit b1b69e6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 26 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b9dd3abbbc708da5e3c53424a5b2c66ab580f97e
refs/heads/master: 2da956523526e440ef4f4dd174e26f5ac06fe011
36 changes: 11 additions & 25 deletions trunk/fs/nfs/write.c
Original file line number Diff line number Diff line change
Expand Up @@ -1691,34 +1691,20 @@ int nfs_wb_page(struct inode *inode, struct page *page)
int nfs_migrate_page(struct address_space *mapping, struct page *newpage,
struct page *page)
{
struct nfs_page *req;
int ret;
/*
* If PagePrivate is set, then the page is currently associated with
* an in-progress read or write request. Don't try to migrate it.
*
* FIXME: we could do this in principle, but we'll need a way to ensure
* that we can safely release the inode reference while holding
* the page lock.
*/
if (PagePrivate(page))
return -EBUSY;

nfs_fscache_release_page(page, GFP_KERNEL);

req = nfs_find_and_lock_request(page, false);
ret = PTR_ERR(req);
if (IS_ERR(req))
goto out;

ret = migrate_page(mapping, newpage, page);
if (!req)
goto out;
if (ret)
goto out_unlock;
page_cache_get(newpage);
spin_lock(&mapping->host->i_lock);
req->wb_page = newpage;
SetPagePrivate(newpage);
set_page_private(newpage, (unsigned long)req);
ClearPagePrivate(page);
set_page_private(page, 0);
spin_unlock(&mapping->host->i_lock);
page_cache_release(page);
out_unlock:
nfs_clear_page_tag_locked(req);
out:
return ret;
return migrate_page(mapping, newpage, page);
}
#endif

Expand Down

0 comments on commit b1b69e6

Please sign in to comment.