init.c 1.07 KB
Newer Older
Ian Kent's avatar
Ian Kent committed
1 2
/*
 * Copyright 1997-1998 Transmeta Corporation -- All Rights Reserved
Linus Torvalds's avatar
Linus Torvalds committed
3 4 5 6
 *
 * This file is part of the Linux kernel and is made available under
 * the terms of the GNU General Public License, version 2, or at your
 * option, any later version, incorporated herein by reference.
Ian Kent's avatar
Ian Kent committed
7
 */
Linus Torvalds's avatar
Linus Torvalds committed
8 9 10 11 12

#include <linux/module.h>
#include <linux/init.h>
#include "autofs_i.h"

Al Viro's avatar
Al Viro committed
13 14
static struct dentry *autofs_mount(struct file_system_type *fs_type,
	int flags, const char *dev_name, void *data)
Linus Torvalds's avatar
Linus Torvalds committed
15
{
Al Viro's avatar
Al Viro committed
16
	return mount_nodev(fs_type, flags, data, autofs4_fill_super);
Linus Torvalds's avatar
Linus Torvalds committed
17 18 19 20 21
}

static struct file_system_type autofs_fs_type = {
	.owner		= THIS_MODULE,
	.name		= "autofs",
Al Viro's avatar
Al Viro committed
22
	.mount		= autofs_mount,
23
	.kill_sb	= autofs4_kill_sb,
Linus Torvalds's avatar
Linus Torvalds committed
24
};
25
MODULE_ALIAS_FS("autofs");
Linus Torvalds's avatar
Linus Torvalds committed
26 27 28

static int __init init_autofs4_fs(void)
{
29 30
	int err;

31 32
	autofs_dev_ioctl_init();

33 34
	err = register_filesystem(&autofs_fs_type);
	if (err)
35
		autofs_dev_ioctl_exit();
36 37

	return err;
Linus Torvalds's avatar
Linus Torvalds committed
38 39 40 41
}

static void __exit exit_autofs4_fs(void)
{
42
	autofs_dev_ioctl_exit();
Linus Torvalds's avatar
Linus Torvalds committed
43 44 45 46 47 48
	unregister_filesystem(&autofs_fs_type);
}

module_init(init_autofs4_fs) 
module_exit(exit_autofs4_fs)
MODULE_LICENSE("GPL");