To convert page->index to a byte index you need to cast it to loff_t first
so it's a 64bit value. There have been quite a few places that got it
wrong in the kernel. To make it easier a nice little helper would be nice,
and in fact the NFS code already has it. Let's move it to pagemap.h so
everyone can use it.
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
return NFS_FLAGS(inode) & NFS_INO_ADVISE_RDPLUS;
}
-static inline
-loff_t page_offset(struct page *page)
-{
- return ((loff_t)page->index) << PAGE_CACHE_SHIFT;
-}
-
/**
* nfs_save_change_attribute - Returns the inode attribute change cookie
* @inode - pointer to inode
return ret;
}
+/*
+ * Return byte-offset into filesystem object for page.
+ */
+static inline loff_t page_offset(struct page *page)
+{
+ return ((loff_t)page->index) << PAGE_CACHE_SHIFT;
+}
+
static inline pgoff_t linear_page_index(struct vm_area_struct *vma,
unsigned long address)
{