aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/internal.h
diff options
context:
space:
mode:
authorMel Gorman <mgorman@suse.de>2012-07-31 19:45:06 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-07-31 21:42:47 -0400
commitd56b4ddf7781ef8dd050542781cc7f55673af002 (patch)
treeafda2689b4944e5dc7fd6d4a2b31f901080ca977 /fs/nfs/internal.h
parent5a178119b0fbe37f7dfb602b37df9cc4b1dc9d71 (diff)
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>
Diffstat (limited to 'fs/nfs/internal.h')
-rw-r--r--fs/nfs/internal.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/fs/nfs/internal.h b/fs/nfs/internal.h
index cfafd13b6fe9..4be14b3e0a18 100644
--- a/fs/nfs/internal.h
+++ b/fs/nfs/internal.h
@@ -546,13 +546,14 @@ void nfs_super_set_maxbytes(struct super_block *sb, __u64 maxfilesize)
546static inline 546static inline
547unsigned int nfs_page_length(struct page *page) 547unsigned int nfs_page_length(struct page *page)
548{ 548{
549 loff_t i_size = i_size_read(page->mapping->host); 549 loff_t i_size = i_size_read(page_file_mapping(page)->host);
550 550
551 if (i_size > 0) { 551 if (i_size > 0) {
552 pgoff_t page_index = page_file_index(page);
552 pgoff_t end_index = (i_size - 1) >> PAGE_CACHE_SHIFT; 553 pgoff_t end_index = (i_size - 1) >> PAGE_CACHE_SHIFT;
553 if (page->index < end_index) 554 if (page_index < end_index)
554 return PAGE_CACHE_SIZE; 555 return PAGE_CACHE_SIZE;
555 if (page->index == end_index) 556 if (page_index == end_index)
556 return ((i_size - 1) & ~PAGE_CACHE_MASK) + 1; 557 return ((i_size - 1) & ~PAGE_CACHE_MASK) + 1;
557 } 558 }
558 return 0; 559 return 0;