aboutsummaryrefslogtreecommitdiffstats
path: root/fs/hugetlbfs
diff options
context:
space:
mode:
authorMel Gorman <mel@csn.ul.ie>2009-05-13 10:56:10 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-05-13 11:04:45 -0400
commitf2deae9d4e70793568ef9e85d227abb7bef5b622 (patch)
tree213082dc5352efdcf10a834287ab5ec5f645abb3 /fs/hugetlbfs
parenta4f1cb9f3c42e5d278b0678ed5225d9331a8dcff (diff)
Remove implementation of readpage from the hugetlbfs_aops
The core VM assumes the page size used by the address_space in inode->i_mapping is PAGE_SIZE but hugetlbfs breaks this assumption by inserting pages into the page cache at offsets the core VM considers unexpected. This would not be a problem except that hugetlbfs also provide a ->readpage implementation. As it exists, the core VM can assume the base page size is being used, allocate pages on behalf of the filesystem, insert them into the page cache and call ->readpage to populate them. These pages are the wrong size and at the wrong offset for hugetlbfs causing confusion. This patch deletes the ->readpage implementation for hugetlbfs on the grounds the core VM should not be allocating and populating pages on behalf of hugetlbfs. There should be no existing users of the ->readpage implementation so it should not cause a regression. Signed-off-by: Mel Gorman <mel@csn.ul.ie> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/hugetlbfs')
-rw-r--r--fs/hugetlbfs/inode.c11
1 files changed, 0 insertions, 11 deletions
diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c
index 153d9681192b..c1462d43e721 100644
--- a/fs/hugetlbfs/inode.c
+++ b/fs/hugetlbfs/inode.c
@@ -312,16 +312,6 @@ out:
312 return retval; 312 return retval;
313} 313}
314 314
315/*
316 * Read a page. Again trivial. If it didn't already exist
317 * in the page cache, it is zero-filled.
318 */
319static int hugetlbfs_readpage(struct file *file, struct page * page)
320{
321 unlock_page(page);
322 return -EINVAL;
323}
324
325static int hugetlbfs_write_begin(struct file *file, 315static int hugetlbfs_write_begin(struct file *file,
326 struct address_space *mapping, 316 struct address_space *mapping,
327 loff_t pos, unsigned len, unsigned flags, 317 loff_t pos, unsigned len, unsigned flags,
@@ -701,7 +691,6 @@ static void hugetlbfs_destroy_inode(struct inode *inode)
701} 691}
702 692
703static const struct address_space_operations hugetlbfs_aops = { 693static const struct address_space_operations hugetlbfs_aops = {
704 .readpage = hugetlbfs_readpage,
705 .write_begin = hugetlbfs_write_begin, 694 .write_begin = hugetlbfs_write_begin,
706 .write_end = hugetlbfs_write_end, 695 .write_end = hugetlbfs_write_end,
707 .set_page_dirty = hugetlbfs_set_page_dirty, 696 .set_page_dirty = hugetlbfs_set_page_dirty,