]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - mm/shmem.c
USB: phy: tahvo: convert platform driver to use dev_groups
[linux.git] / mm / shmem.c
index f4dce9c8670dc2fff58c8ea6e41445c5b7a4269a..626d8c74b973f173d3062ee118580b649d35073a 100644 (file)
@@ -400,7 +400,7 @@ static bool shmem_confirm_swap(struct address_space *mapping,
 
 static int shmem_huge __read_mostly;
 
-#if defined(CONFIG_SYSFS) || defined(CONFIG_TMPFS)
+#if defined(CONFIG_SYSFS)
 static int shmem_parse_huge(const char *str)
 {
        if (!strcmp(str, "never"))
@@ -417,7 +417,9 @@ static int shmem_parse_huge(const char *str)
                return SHMEM_HUGE_FORCE;
        return -EINVAL;
 }
+#endif
 
+#if defined(CONFIG_SYSFS) || defined(CONFIG_TMPFS)
 static const char *shmem_format_huge(int huge)
 {
        switch (huge) {
@@ -3775,10 +3777,6 @@ int __init shmem_init(void)
 {
        int error;
 
-       /* If rootfs called this, don't re-init */
-       if (shmem_inode_cachep)
-               return 0;
-
        shmem_init_inodecache();
 
        error = register_filesystem(&shmem_fs_type);
@@ -3872,6 +3870,9 @@ bool shmem_huge_enabled(struct vm_area_struct *vma)
        loff_t i_size;
        pgoff_t off;
 
+       if ((vma->vm_flags & VM_NOHUGEPAGE) ||
+           test_bit(MMF_DISABLE_THP, &vma->vm_mm->flags))
+               return false;
        if (shmem_huge == SHMEM_HUGE_FORCE)
                return true;
        if (shmem_huge == SHMEM_HUGE_DENY)