aboutsummaryrefslogtreecommitdiff
path: root/kernel/util.c
blob: 3e7b6eff1850dae44d28bfdf400ec60fd8268ba8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/*
    FUSE: Filesystem in Userspace
    Copyright (C) 2001  Miklos Szeredi (mszeredi@inf.bme.hu)

    This program can be distributed under the terms of the GNU GPL.
    See the file COPYING.
*/

#include "fuse_i.h"

#include <linux/init.h>
#include <linux/slab.h>

MODULE_AUTHOR("Miklos Szeredi <mszeredi@inf.bme.hu>");
MODULE_DESCRIPTION("Filesystem in Userspace");
#ifdef MODULE_LICENSE
MODULE_LICENSE("GPL");
#endif

spinlock_t fuse_lock = SPIN_LOCK_UNLOCKED;

int __init fuse_init(void)
{
	int res;

	printk(KERN_DEBUG "fuse init %s (API version %i.%i)\n",
	       FUSE_VERSION,
	       FUSE_KERNEL_VERSION, FUSE_KERNEL_MINOR_VERSION);

	res = fuse_fs_init();
	if (res)
		goto err;
	
	res = fuse_dev_init();
	if (res)
		goto err_fs_cleanup;
	
	return 0;

  err_fs_cleanup:
	fuse_fs_cleanup();
  err:
	return res;
}

void __exit fuse_exit(void)
{
	printk(KERN_DEBUG "fuse exit\n");
	
	fuse_fs_cleanup();
	fuse_dev_cleanup();
}

module_init(fuse_init);
module_exit(fuse_exit);

/*
 * Local Variables:
 * indent-tabs-mode: t
 * c-basic-offset: 8
 * End:
 */