diff options
Diffstat (limited to 'fs/hugetlbfs/inode.c')
-rw-r--r-- | fs/hugetlbfs/inode.c | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c index 6e5bd42f3860..a5fe68189eed 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 = { |
@@ -879,15 +896,15 @@ void hugetlb_put_quota(struct address_space *mapping, long delta) | |||
879 | } | 896 | } |
880 | } | 897 | } |
881 | 898 | ||
882 | static int hugetlbfs_get_sb(struct file_system_type *fs_type, | 899 | static struct dentry *hugetlbfs_mount(struct file_system_type *fs_type, |
883 | int flags, const char *dev_name, void *data, struct vfsmount *mnt) | 900 | int flags, const char *dev_name, void *data) |
884 | { | 901 | { |
885 | return get_sb_nodev(fs_type, flags, data, hugetlbfs_fill_super, mnt); | 902 | return mount_nodev(fs_type, flags, data, hugetlbfs_fill_super); |
886 | } | 903 | } |
887 | 904 | ||
888 | static struct file_system_type hugetlbfs_fs_type = { | 905 | static struct file_system_type hugetlbfs_fs_type = { |
889 | .name = "hugetlbfs", | 906 | .name = "hugetlbfs", |
890 | .get_sb = hugetlbfs_get_sb, | 907 | .mount = hugetlbfs_mount, |
891 | .kill_sb = kill_litter_super, | 908 | .kill_sb = kill_litter_super, |
892 | }; | 909 | }; |
893 | 910 | ||
@@ -915,8 +932,7 @@ struct file *hugetlb_file_setup(const char *name, size_t size, int acctflag, | |||
915 | if (creat_flags == HUGETLB_SHMFS_INODE && !can_do_hugetlb_shm()) { | 932 | if (creat_flags == HUGETLB_SHMFS_INODE && !can_do_hugetlb_shm()) { |
916 | *user = current_user(); | 933 | *user = current_user(); |
917 | if (user_shm_lock(size, *user)) { | 934 | if (user_shm_lock(size, *user)) { |
918 | WARN_ONCE(1, | 935 | printk_once(KERN_WARNING "Using mlock ulimits for SHM_HUGETLB is deprecated\n"); |
919 | "Using mlock ulimits for SHM_HUGETLB deprecated\n"); | ||
920 | } else { | 936 | } else { |
921 | *user = NULL; | 937 | *user = NULL; |
922 | return ERR_PTR(-EPERM); | 938 | return ERR_PTR(-EPERM); |