xref: /openbmc/linux/fs/autofs/init.c (revision d02d21ea)
1ebc921caSIan Kent /*
2ebc921caSIan Kent  * Copyright 1997-1998 Transmeta Corporation -- All Rights Reserved
3ebc921caSIan Kent  *
4ebc921caSIan Kent  * This file is part of the Linux kernel and is made available under
5ebc921caSIan Kent  * the terms of the GNU General Public License, version 2, or at your
6ebc921caSIan Kent  * option, any later version, incorporated herein by reference.
7ebc921caSIan Kent  */
8ebc921caSIan Kent 
9ebc921caSIan Kent #include <linux/module.h>
10ebc921caSIan Kent #include <linux/init.h>
11ebc921caSIan Kent #include "autofs_i.h"
12ebc921caSIan Kent 
13ebc921caSIan Kent static struct dentry *autofs_mount(struct file_system_type *fs_type,
14ebc921caSIan Kent 	int flags, const char *dev_name, void *data)
15ebc921caSIan Kent {
16ebc921caSIan Kent 	return mount_nodev(fs_type, flags, data, autofs_fill_super);
17ebc921caSIan Kent }
18ebc921caSIan Kent 
19ebc921caSIan Kent static struct file_system_type autofs_fs_type = {
20ebc921caSIan Kent 	.owner		= THIS_MODULE,
21ebc921caSIan Kent 	.name		= "autofs",
22ebc921caSIan Kent 	.mount		= autofs_mount,
23ebc921caSIan Kent 	.kill_sb	= autofs_kill_sb,
24ebc921caSIan Kent };
25ebc921caSIan Kent MODULE_ALIAS_FS("autofs");
26d02d21eaSLinus Torvalds MODULE_ALIAS("autofs");
27ebc921caSIan Kent 
28ebc921caSIan Kent static int __init init_autofs_fs(void)
29ebc921caSIan Kent {
30ebc921caSIan Kent 	int err;
31ebc921caSIan Kent 
32ebc921caSIan Kent 	autofs_dev_ioctl_init();
33ebc921caSIan Kent 
34ebc921caSIan Kent 	err = register_filesystem(&autofs_fs_type);
35ebc921caSIan Kent 	if (err)
36ebc921caSIan Kent 		autofs_dev_ioctl_exit();
37ebc921caSIan Kent 
38ebc921caSIan Kent 	return err;
39ebc921caSIan Kent }
40ebc921caSIan Kent 
41ebc921caSIan Kent static void __exit exit_autofs_fs(void)
42ebc921caSIan Kent {
43ebc921caSIan Kent 	autofs_dev_ioctl_exit();
44ebc921caSIan Kent 	unregister_filesystem(&autofs_fs_type);
45ebc921caSIan Kent }
46ebc921caSIan Kent 
47ebc921caSIan Kent module_init(init_autofs_fs)
48ebc921caSIan Kent module_exit(exit_autofs_fs)
49ebc921caSIan Kent MODULE_LICENSE("GPL");
50