diff options
Diffstat (limited to 'fs/nfs/internal.h')
-rw-r--r-- | fs/nfs/internal.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/fs/nfs/internal.h b/fs/nfs/internal.h index 8865538b26b6..31fdb03225cd 100644 --- a/fs/nfs/internal.h +++ b/fs/nfs/internal.h | |||
@@ -554,13 +554,14 @@ void nfs_super_set_maxbytes(struct super_block *sb, __u64 maxfilesize) | |||
554 | static inline | 554 | static inline |
555 | unsigned int nfs_page_length(struct page *page) | 555 | unsigned int nfs_page_length(struct page *page) |
556 | { | 556 | { |
557 | loff_t i_size = i_size_read(page->mapping->host); | 557 | loff_t i_size = i_size_read(page_file_mapping(page)->host); |
558 | 558 | ||
559 | if (i_size > 0) { | 559 | if (i_size > 0) { |
560 | pgoff_t page_index = page_file_index(page); | ||
560 | pgoff_t end_index = (i_size - 1) >> PAGE_CACHE_SHIFT; | 561 | pgoff_t end_index = (i_size - 1) >> PAGE_CACHE_SHIFT; |
561 | if (page->index < end_index) | 562 | if (page_index < end_index) |
562 | return PAGE_CACHE_SIZE; | 563 | return PAGE_CACHE_SIZE; |
563 | if (page->index == end_index) | 564 | if (page_index == end_index) |
564 | return ((i_size - 1) & ~PAGE_CACHE_MASK) + 1; | 565 | return ((i_size - 1) & ~PAGE_CACHE_MASK) + 1; |
565 | } | 566 | } |
566 | return 0; | 567 | return 0; |