summaryrefslogtreecommitdiffstats
path: root/fs/hugetlbfs
diff options
context:
space:
mode:
authorPaul Gortmaker <paul.gortmaker@windriver.com>2016-01-14 18:21:52 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2016-01-14 19:00:49 -0500
commit3e89e1c5ea84211b99199c7636a7d73c50c6b512 (patch)
tree9b29a9f8d6919a890edf22921d107dfbd3b95c6c /fs/hugetlbfs
parent0d576d20ccdeffbb7ba28053107fa6f838b67f3a (diff)
hugetlb: make mm and fs code explicitly non-modular
The Kconfig currently controlling compilation of this code is: config HUGETLBFS bool "HugeTLB file system support" ...meaning that it currently is not being built as a module by anyone. Lets remove the modular code that is essentially orphaned, so that when reading the driver there is no doubt it is builtin-only. Since module_init translates to device_initcall in the non-modular case, the init ordering gets moved to earlier levels when we use the more appropriate initcalls here. Originally I had the fs part and the mm part as separate commits, just by happenstance of the nature of how I detected these non-modular use cases. But that can possibly introduce regressions if the patch merge ordering puts the fs part 1st -- as the 0-day testing reported a splat at mount time. Investigating with "initcall_debug" showed that the delta was init_hugetlbfs_fs being called _before_ hugetlb_init instead of after. So both the fs change and the mm change are here together. In addition, it worked before due to luck of link order, since they were both in the same initcall category. So we now have the fs part using fs_initcall, and the mm part using subsys_initcall, which puts it one bucket earlier. It now passes the basic sanity test that failed in earlier 0-day testing. We delete the MODULE_LICENSE tag and capture that information at the top of the file alongside author comments, etc. We don't replace module.h with init.h since the file already has that. Also note that MODULE_ALIAS is a no-op for non-modular code. Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> Reported-by: kernel test robot <ying.huang@linux.intel.com> Cc: Nadia Yvette Chambers <nyc@holomorphy.com> Cc: Alexander Viro <viro@zeniv.linux.org.uk> Cc: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com> Reviewed-by: Mike Kravetz <mike.kravetz@oracle.com> Cc: David Rientjes <rientjes@google.com> Cc: Hillf Danton <hillf.zj@alibaba-inc.com> Acked-by: Davidlohr Bueso <dave@stgolabs.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/hugetlbfs')
-rw-r--r--fs/hugetlbfs/inode.c27
1 files changed, 2 insertions, 25 deletions
diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c
index a1cb8fd2289b..47789292a582 100644
--- a/fs/hugetlbfs/inode.c
+++ b/fs/hugetlbfs/inode.c
@@ -4,11 +4,11 @@
4 * Nadia Yvette Chambers, 2002 4 * Nadia Yvette Chambers, 2002
5 * 5 *
6 * Copyright (C) 2002 Linus Torvalds. 6 * Copyright (C) 2002 Linus Torvalds.
7 * License: GPL
7 */ 8 */
8 9
9#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 10#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
10 11
11#include <linux/module.h>
12#include <linux/thread_info.h> 12#include <linux/thread_info.h>
13#include <asm/current.h> 13#include <asm/current.h>
14#include <linux/sched.h> /* remove ASAP */ 14#include <linux/sched.h> /* remove ASAP */
@@ -1202,7 +1202,6 @@ static struct file_system_type hugetlbfs_fs_type = {
1202 .mount = hugetlbfs_mount, 1202 .mount = hugetlbfs_mount,
1203 .kill_sb = kill_litter_super, 1203 .kill_sb = kill_litter_super,
1204}; 1204};
1205MODULE_ALIAS_FS("hugetlbfs");
1206 1205
1207static struct vfsmount *hugetlbfs_vfsmount[HUGE_MAX_HSTATE]; 1206static struct vfsmount *hugetlbfs_vfsmount[HUGE_MAX_HSTATE];
1208 1207
@@ -1356,26 +1355,4 @@ static int __init init_hugetlbfs_fs(void)
1356 out2: 1355 out2:
1357 return error; 1356 return error;
1358} 1357}
1359 1358fs_initcall(init_hugetlbfs_fs)
1360static void __exit exit_hugetlbfs_fs(void)
1361{
1362 struct hstate *h;
1363 int i;
1364
1365
1366 /*
1367 * Make sure all delayed rcu free inodes are flushed before we
1368 * destroy cache.
1369 */
1370 rcu_barrier();
1371 kmem_cache_destroy(hugetlbfs_inode_cachep);
1372 i = 0;
1373 for_each_hstate(h)
1374 kern_unmount(hugetlbfs_vfsmount[i++]);
1375 unregister_filesystem(&hugetlbfs_fs_type);
1376}
1377
1378module_init(init_hugetlbfs_fs)
1379module_exit(exit_hugetlbfs_fs)
1380
1381MODULE_LICENSE("GPL");