blob: 8cf0e63389ae34c2b86716a674974727629fc63e [file] [log] [blame]
Ian Kente9a7c2f2016-03-15 14:58:25 -07001/*
2 * Copyright 1997-1998 Transmeta Corporation -- All Rights Reserved
Linus Torvalds1da177e2005-04-16 15:20:36 -07003 *
4 * This file is part of the Linux kernel and is made available under
5 * the terms of the GNU General Public License, version 2, or at your
6 * option, any later version, incorporated herein by reference.
Ian Kente9a7c2f2016-03-15 14:58:25 -07007 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07008
9#include <linux/module.h>
10#include <linux/init.h>
11#include "autofs_i.h"
12
Al Viro3c26ff62010-07-25 11:46:36 +040013static struct dentry *autofs_mount(struct file_system_type *fs_type,
14 int flags, const char *dev_name, void *data)
Linus Torvalds1da177e2005-04-16 15:20:36 -070015{
Al Viro3c26ff62010-07-25 11:46:36 +040016 return mount_nodev(fs_type, flags, data, autofs4_fill_super);
Linus Torvalds1da177e2005-04-16 15:20:36 -070017}
18
19static struct file_system_type autofs_fs_type = {
20 .owner = THIS_MODULE,
21 .name = "autofs",
Al Viro3c26ff62010-07-25 11:46:36 +040022 .mount = autofs_mount,
David Howells6ce31522006-10-11 01:22:15 -070023 .kill_sb = autofs4_kill_sb,
Linus Torvalds1da177e2005-04-16 15:20:36 -070024};
Eric W. Biederman7f78e032013-03-02 19:39:14 -080025MODULE_ALIAS_FS("autofs");
Linus Torvalds1da177e2005-04-16 15:20:36 -070026
27static int __init init_autofs4_fs(void)
28{
Ian Kent8d7b48e2008-10-15 22:02:54 -070029 int err;
30
Al Viro54bf5862012-03-17 02:55:49 -040031 autofs_dev_ioctl_init();
32
Ian Kent8d7b48e2008-10-15 22:02:54 -070033 err = register_filesystem(&autofs_fs_type);
34 if (err)
Al Viro54bf5862012-03-17 02:55:49 -040035 autofs_dev_ioctl_exit();
Ian Kent8d7b48e2008-10-15 22:02:54 -070036
37 return err;
Linus Torvalds1da177e2005-04-16 15:20:36 -070038}
39
40static void __exit exit_autofs4_fs(void)
41{
Ian Kent8d7b48e2008-10-15 22:02:54 -070042 autofs_dev_ioctl_exit();
Linus Torvalds1da177e2005-04-16 15:20:36 -070043 unregister_filesystem(&autofs_fs_type);
44}
45
46module_init(init_autofs4_fs)
47module_exit(exit_autofs4_fs)
48MODULE_LICENSE("GPL");