nfs: teach the NFS client how to treat PG_swapcache pages
Replace all relevant occurences of page->index and page->mapping in the NFS client with the new page_file_index() and page_file_mapping() functions. Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Signed-off-by: Mel Gorman <mgorman@suse.de> Acked-by: Rik van Riel <riel@redhat.com> Cc: Christoph Hellwig <hch@infradead.org> Cc: David S. Miller <davem@davemloft.net> Cc: Eric B Munson <emunson@mgebm.net> Cc: Eric Paris <eparis@redhat.com> Cc: James Morris <jmorris@namei.org> Cc: Mel Gorman <mgorman@suse.de> Cc: Mike Christie <michaelc@cs.wisc.edu> Cc: Neil Brown <neilb@suse.de> Cc: Sebastian Andrzej Siewior <sebastian@breakpoint.cc> Cc: Trond Myklebust <Trond.Myklebust@netapp.com> Cc: Xiaotian Feng <dfeng@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:

committed by
Linus Torvalds

parent
5a178119b0
commit
d56b4ddf77
@@ -430,7 +430,7 @@ static void nfs_invalidate_page(struct page *page, unsigned long offset)
|
||||
if (offset != 0)
|
||||
return;
|
||||
/* Cancel any unstarted writes on this page */
|
||||
nfs_wb_page_cancel(page->mapping->host, page);
|
||||
nfs_wb_page_cancel(page_file_mapping(page)->host, page);
|
||||
|
||||
nfs_fscache_invalidate_page(page, page->mapping->host);
|
||||
}
|
||||
@@ -472,7 +472,7 @@ static int nfs_release_page(struct page *page, gfp_t gfp)
|
||||
*/
|
||||
static int nfs_launder_page(struct page *page)
|
||||
{
|
||||
struct inode *inode = page->mapping->host;
|
||||
struct inode *inode = page_file_mapping(page)->host;
|
||||
struct nfs_inode *nfsi = NFS_I(inode);
|
||||
|
||||
dfprintk(PAGECACHE, "NFS: launder_page(%ld, %llu)\n",
|
||||
@@ -521,7 +521,7 @@ static int nfs_vm_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf)
|
||||
nfs_fscache_wait_on_page_write(NFS_I(dentry->d_inode), page);
|
||||
|
||||
lock_page(page);
|
||||
mapping = page->mapping;
|
||||
mapping = page_file_mapping(page);
|
||||
if (mapping != dentry->d_inode->i_mapping)
|
||||
goto out_unlock;
|
||||
|
||||
|
Reference in New Issue
Block a user