diff options
Diffstat (limited to 'fs/hugetlbfs/inode.c')
-rw-r--r-- | fs/hugetlbfs/inode.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c index 6e5bd42f386..b14be3f781c 100644 --- a/fs/hugetlbfs/inode.c +++ b/fs/hugetlbfs/inode.c | |||
@@ -31,6 +31,7 @@ | |||
31 | #include <linux/statfs.h> | 31 | #include <linux/statfs.h> |
32 | #include <linux/security.h> | 32 | #include <linux/security.h> |
33 | #include <linux/magic.h> | 33 | #include <linux/magic.h> |
34 | #include <linux/migrate.h> | ||
34 | 35 | ||
35 | #include <asm/uaccess.h> | 36 | #include <asm/uaccess.h> |
36 | 37 | ||
@@ -455,6 +456,7 @@ static struct inode *hugetlbfs_get_inode(struct super_block *sb, uid_t uid, | |||
455 | inode = new_inode(sb); | 456 | inode = new_inode(sb); |
456 | if (inode) { | 457 | if (inode) { |
457 | struct hugetlbfs_inode_info *info; | 458 | struct hugetlbfs_inode_info *info; |
459 | inode->i_ino = get_next_ino(); | ||
458 | inode->i_mode = mode; | 460 | inode->i_mode = mode; |
459 | inode->i_uid = uid; | 461 | inode->i_uid = uid; |
460 | inode->i_gid = gid; | 462 | inode->i_gid = gid; |
@@ -573,6 +575,19 @@ static int hugetlbfs_set_page_dirty(struct page *page) | |||
573 | return 0; | 575 | return 0; |
574 | } | 576 | } |
575 | 577 | ||
578 | static int hugetlbfs_migrate_page(struct address_space *mapping, | ||
579 | struct page *newpage, struct page *page) | ||
580 | { | ||
581 | int rc; | ||
582 | |||
583 | rc = migrate_huge_page_move_mapping(mapping, newpage, page); | ||
584 | if (rc) | ||
585 | return rc; | ||
586 | migrate_page_copy(newpage, page); | ||
587 | |||
588 | return 0; | ||
589 | } | ||
590 | |||
576 | static int hugetlbfs_statfs(struct dentry *dentry, struct kstatfs *buf) | 591 | static int hugetlbfs_statfs(struct dentry *dentry, struct kstatfs *buf) |
577 | { | 592 | { |
578 | struct hugetlbfs_sb_info *sbinfo = HUGETLBFS_SB(dentry->d_sb); | 593 | struct hugetlbfs_sb_info *sbinfo = HUGETLBFS_SB(dentry->d_sb); |
@@ -659,6 +674,7 @@ static const struct address_space_operations hugetlbfs_aops = { | |||
659 | .write_begin = hugetlbfs_write_begin, | 674 | .write_begin = hugetlbfs_write_begin, |
660 | .write_end = hugetlbfs_write_end, | 675 | .write_end = hugetlbfs_write_end, |
661 | .set_page_dirty = hugetlbfs_set_page_dirty, | 676 | .set_page_dirty = hugetlbfs_set_page_dirty, |
677 | .migratepage = hugetlbfs_migrate_page, | ||
662 | }; | 678 | }; |
663 | 679 | ||
664 | 680 | ||
@@ -674,6 +690,7 @@ const struct file_operations hugetlbfs_file_operations = { | |||
674 | .mmap = hugetlbfs_file_mmap, | 690 | .mmap = hugetlbfs_file_mmap, |
675 | .fsync = noop_fsync, | 691 | .fsync = noop_fsync, |
676 | .get_unmapped_area = hugetlb_get_unmapped_area, | 692 | .get_unmapped_area = hugetlb_get_unmapped_area, |
693 | .llseek = default_llseek, | ||
677 | }; | 694 | }; |
678 | 695 | ||
679 | static const struct inode_operations hugetlbfs_dir_inode_operations = { | 696 | static const struct inode_operations hugetlbfs_dir_inode_operations = { |