blob: 458c62ca0fec1692a6e9917183716c2ebccb59ea [file] [log] [blame]
Miklos Szeredid8a5ba42005-09-09 13:10:26 -07001/*
2 FUSE: Filesystem in Userspace
3 Copyright (C) 2001-2005 Miklos Szeredi <miklos@szeredi.hu>
4
5 This program can be distributed under the terms of the GNU GPL.
6 See the file COPYING.
7*/
8
9#include "fuse_i.h"
10
11#include <linux/pagemap.h>
12#include <linux/slab.h>
13#include <linux/file.h>
14#include <linux/mount.h>
15#include <linux/seq_file.h>
16#include <linux/init.h>
17#include <linux/module.h>
Miklos Szeredid8a5ba42005-09-09 13:10:26 -070018#include <linux/parser.h>
19#include <linux/statfs.h>
20
21MODULE_AUTHOR("Miklos Szeredi <miklos@szeredi.hu>");
22MODULE_DESCRIPTION("Filesystem in Userspace");
23MODULE_LICENSE("GPL");
24
25spinlock_t fuse_lock;
26static kmem_cache_t *fuse_inode_cachep;
Miklos Szeredid8a5ba42005-09-09 13:10:26 -070027
28#define FUSE_SUPER_MAGIC 0x65735546
29
30struct fuse_mount_data {
31 int fd;
32 unsigned rootmode;
33 unsigned user_id;
Miklos Szeredi1e9a4ed2005-09-09 13:10:31 -070034 unsigned flags;
Miklos Szeredid8a5ba42005-09-09 13:10:26 -070035};
36
37static struct inode *fuse_alloc_inode(struct super_block *sb)
38{
39 struct inode *inode;
40 struct fuse_inode *fi;
41
42 inode = kmem_cache_alloc(fuse_inode_cachep, SLAB_KERNEL);
43 if (!inode)
44 return NULL;
45
46 fi = get_fuse_inode(inode);
47 fi->i_time = jiffies - 1;
48 fi->nodeid = 0;
Miklos Szeredi9e6268d2005-09-09 13:10:29 -070049 fi->nlookup = 0;
Miklos Szeredie5e55582005-09-09 13:10:28 -070050 fi->forget_req = fuse_request_alloc();
51 if (!fi->forget_req) {
52 kmem_cache_free(fuse_inode_cachep, inode);
53 return NULL;
54 }
Miklos Szeredid8a5ba42005-09-09 13:10:26 -070055
56 return inode;
57}
58
59static void fuse_destroy_inode(struct inode *inode)
60{
Miklos Szeredie5e55582005-09-09 13:10:28 -070061 struct fuse_inode *fi = get_fuse_inode(inode);
62 if (fi->forget_req)
63 fuse_request_free(fi->forget_req);
Miklos Szeredid8a5ba42005-09-09 13:10:26 -070064 kmem_cache_free(fuse_inode_cachep, inode);
65}
66
67static void fuse_read_inode(struct inode *inode)
68{
69 /* No op */
70}
71
Miklos Szeredie5e55582005-09-09 13:10:28 -070072void fuse_send_forget(struct fuse_conn *fc, struct fuse_req *req,
Miklos Szeredi9e6268d2005-09-09 13:10:29 -070073 unsigned long nodeid, u64 nlookup)
Miklos Szeredie5e55582005-09-09 13:10:28 -070074{
75 struct fuse_forget_in *inarg = &req->misc.forget_in;
Miklos Szeredi9e6268d2005-09-09 13:10:29 -070076 inarg->nlookup = nlookup;
Miklos Szeredie5e55582005-09-09 13:10:28 -070077 req->in.h.opcode = FUSE_FORGET;
78 req->in.h.nodeid = nodeid;
79 req->in.numargs = 1;
80 req->in.args[0].size = sizeof(struct fuse_forget_in);
81 req->in.args[0].value = inarg;
82 request_send_noreply(fc, req);
83}
84
Miklos Szeredid8a5ba42005-09-09 13:10:26 -070085static void fuse_clear_inode(struct inode *inode)
86{
Miklos Szeredi1e9a4ed2005-09-09 13:10:31 -070087 if (inode->i_sb->s_flags & MS_ACTIVE) {
88 struct fuse_conn *fc = get_fuse_conn(inode);
Miklos Szeredie5e55582005-09-09 13:10:28 -070089 struct fuse_inode *fi = get_fuse_inode(inode);
Miklos Szeredi9e6268d2005-09-09 13:10:29 -070090 fuse_send_forget(fc, fi->forget_req, fi->nodeid, fi->nlookup);
Miklos Szeredie5e55582005-09-09 13:10:28 -070091 fi->forget_req = NULL;
92 }
Miklos Szeredid8a5ba42005-09-09 13:10:26 -070093}
94
95void fuse_change_attributes(struct inode *inode, struct fuse_attr *attr)
96{
97 if (S_ISREG(inode->i_mode) && i_size_read(inode) != attr->size)
98 invalidate_inode_pages(inode->i_mapping);
99
100 inode->i_ino = attr->ino;
101 inode->i_mode = (inode->i_mode & S_IFMT) + (attr->mode & 07777);
102 inode->i_nlink = attr->nlink;
103 inode->i_uid = attr->uid;
104 inode->i_gid = attr->gid;
105 i_size_write(inode, attr->size);
106 inode->i_blksize = PAGE_CACHE_SIZE;
107 inode->i_blocks = attr->blocks;
108 inode->i_atime.tv_sec = attr->atime;
109 inode->i_atime.tv_nsec = attr->atimensec;
110 inode->i_mtime.tv_sec = attr->mtime;
111 inode->i_mtime.tv_nsec = attr->mtimensec;
112 inode->i_ctime.tv_sec = attr->ctime;
113 inode->i_ctime.tv_nsec = attr->ctimensec;
114}
115
116static void fuse_init_inode(struct inode *inode, struct fuse_attr *attr)
117{
118 inode->i_mode = attr->mode & S_IFMT;
119 i_size_write(inode, attr->size);
Miklos Szeredie5e55582005-09-09 13:10:28 -0700120 if (S_ISREG(inode->i_mode)) {
121 fuse_init_common(inode);
Miklos Szeredib6aeade2005-09-09 13:10:30 -0700122 fuse_init_file_inode(inode);
Miklos Szeredie5e55582005-09-09 13:10:28 -0700123 } else if (S_ISDIR(inode->i_mode))
124 fuse_init_dir(inode);
125 else if (S_ISLNK(inode->i_mode))
126 fuse_init_symlink(inode);
127 else if (S_ISCHR(inode->i_mode) || S_ISBLK(inode->i_mode) ||
128 S_ISFIFO(inode->i_mode) || S_ISSOCK(inode->i_mode)) {
129 fuse_init_common(inode);
130 init_special_inode(inode, inode->i_mode,
131 new_decode_dev(attr->rdev));
132 } else {
133 /* Don't let user create weird files */
134 inode->i_mode = S_IFREG;
135 fuse_init_common(inode);
Miklos Szeredib6aeade2005-09-09 13:10:30 -0700136 fuse_init_file_inode(inode);
Miklos Szeredie5e55582005-09-09 13:10:28 -0700137 }
Miklos Szeredid8a5ba42005-09-09 13:10:26 -0700138}
139
140static int fuse_inode_eq(struct inode *inode, void *_nodeidp)
141{
142 unsigned long nodeid = *(unsigned long *) _nodeidp;
143 if (get_node_id(inode) == nodeid)
144 return 1;
145 else
146 return 0;
147}
148
149static int fuse_inode_set(struct inode *inode, void *_nodeidp)
150{
151 unsigned long nodeid = *(unsigned long *) _nodeidp;
152 get_fuse_inode(inode)->nodeid = nodeid;
153 return 0;
154}
155
156struct inode *fuse_iget(struct super_block *sb, unsigned long nodeid,
Miklos Szeredi9e6268d2005-09-09 13:10:29 -0700157 int generation, struct fuse_attr *attr)
Miklos Szeredid8a5ba42005-09-09 13:10:26 -0700158{
159 struct inode *inode;
Miklos Szeredi9e6268d2005-09-09 13:10:29 -0700160 struct fuse_inode *fi;
Miklos Szeredid8a5ba42005-09-09 13:10:26 -0700161 struct fuse_conn *fc = get_fuse_conn_super(sb);
162 int retried = 0;
163
164 retry:
165 inode = iget5_locked(sb, nodeid, fuse_inode_eq, fuse_inode_set, &nodeid);
166 if (!inode)
167 return NULL;
168
169 if ((inode->i_state & I_NEW)) {
170 inode->i_generation = generation;
171 inode->i_data.backing_dev_info = &fc->bdi;
172 fuse_init_inode(inode, attr);
173 unlock_new_inode(inode);
174 } else if ((inode->i_mode ^ attr->mode) & S_IFMT) {
175 BUG_ON(retried);
176 /* Inode has changed type, any I/O on the old should fail */
177 make_bad_inode(inode);
178 iput(inode);
179 retried = 1;
180 goto retry;
181 }
182
Miklos Szeredi9e6268d2005-09-09 13:10:29 -0700183 fi = get_fuse_inode(inode);
184 fi->nlookup ++;
Miklos Szeredid8a5ba42005-09-09 13:10:26 -0700185 fuse_change_attributes(inode, attr);
Miklos Szeredid8a5ba42005-09-09 13:10:26 -0700186 return inode;
187}
188
189static void fuse_put_super(struct super_block *sb)
190{
191 struct fuse_conn *fc = get_fuse_conn_super(sb);
192
Miklos Szeredi1e9a4ed2005-09-09 13:10:31 -0700193 down_write(&fc->sbput_sem);
194 while (!list_empty(&fc->background))
195 fuse_release_background(list_entry(fc->background.next,
196 struct fuse_req, bg_entry));
197
Miklos Szeredid8a5ba42005-09-09 13:10:26 -0700198 spin_lock(&fuse_lock);
Miklos Szeredi1e9a4ed2005-09-09 13:10:31 -0700199 fc->mounted = 0;
Miklos Szeredid8a5ba42005-09-09 13:10:26 -0700200 fc->user_id = 0;
Miklos Szeredi1e9a4ed2005-09-09 13:10:31 -0700201 fc->flags = 0;
Miklos Szeredi334f4852005-09-09 13:10:27 -0700202 /* Flush all readers on this fs */
203 wake_up_all(&fc->waitq);
Miklos Szeredi1e9a4ed2005-09-09 13:10:31 -0700204 up_write(&fc->sbput_sem);
Miklos Szeredid8a5ba42005-09-09 13:10:26 -0700205 fuse_release_conn(fc);
Miklos Szeredid8a5ba42005-09-09 13:10:26 -0700206 spin_unlock(&fuse_lock);
207}
208
Miklos Szeredie5e55582005-09-09 13:10:28 -0700209static void convert_fuse_statfs(struct kstatfs *stbuf, struct fuse_kstatfs *attr)
210{
211 stbuf->f_type = FUSE_SUPER_MAGIC;
212 stbuf->f_bsize = attr->bsize;
213 stbuf->f_blocks = attr->blocks;
214 stbuf->f_bfree = attr->bfree;
215 stbuf->f_bavail = attr->bavail;
216 stbuf->f_files = attr->files;
217 stbuf->f_ffree = attr->ffree;
218 stbuf->f_namelen = attr->namelen;
219 /* fsid is left zero */
220}
221
222static int fuse_statfs(struct super_block *sb, struct kstatfs *buf)
223{
224 struct fuse_conn *fc = get_fuse_conn_super(sb);
225 struct fuse_req *req;
226 struct fuse_statfs_out outarg;
227 int err;
228
229 req = fuse_get_request(fc);
230 if (!req)
231 return -ERESTARTSYS;
232
233 req->in.numargs = 0;
234 req->in.h.opcode = FUSE_STATFS;
235 req->out.numargs = 1;
236 req->out.args[0].size = sizeof(outarg);
237 req->out.args[0].value = &outarg;
238 request_send(fc, req);
239 err = req->out.h.error;
240 if (!err)
241 convert_fuse_statfs(buf, &outarg.st);
242 fuse_put_request(fc, req);
243 return err;
244}
245
Miklos Szeredid8a5ba42005-09-09 13:10:26 -0700246enum {
247 OPT_FD,
248 OPT_ROOTMODE,
249 OPT_USER_ID,
250 OPT_DEFAULT_PERMISSIONS,
251 OPT_ALLOW_OTHER,
Miklos Szeredid8a5ba42005-09-09 13:10:26 -0700252 OPT_KERNEL_CACHE,
253 OPT_ERR
254};
255
256static match_table_t tokens = {
257 {OPT_FD, "fd=%u"},
258 {OPT_ROOTMODE, "rootmode=%o"},
259 {OPT_USER_ID, "user_id=%u"},
260 {OPT_DEFAULT_PERMISSIONS, "default_permissions"},
261 {OPT_ALLOW_OTHER, "allow_other"},
Miklos Szeredid8a5ba42005-09-09 13:10:26 -0700262 {OPT_KERNEL_CACHE, "kernel_cache"},
263 {OPT_ERR, NULL}
264};
265
266static int parse_fuse_opt(char *opt, struct fuse_mount_data *d)
267{
268 char *p;
269 memset(d, 0, sizeof(struct fuse_mount_data));
270 d->fd = -1;
271
272 while ((p = strsep(&opt, ",")) != NULL) {
273 int token;
274 int value;
275 substring_t args[MAX_OPT_ARGS];
276 if (!*p)
277 continue;
278
279 token = match_token(p, tokens, args);
280 switch (token) {
281 case OPT_FD:
282 if (match_int(&args[0], &value))
283 return 0;
284 d->fd = value;
285 break;
286
287 case OPT_ROOTMODE:
288 if (match_octal(&args[0], &value))
289 return 0;
290 d->rootmode = value;
291 break;
292
293 case OPT_USER_ID:
294 if (match_int(&args[0], &value))
295 return 0;
296 d->user_id = value;
297 break;
298
Miklos Szeredi1e9a4ed2005-09-09 13:10:31 -0700299 case OPT_DEFAULT_PERMISSIONS:
300 d->flags |= FUSE_DEFAULT_PERMISSIONS;
301 break;
302
303 case OPT_ALLOW_OTHER:
304 d->flags |= FUSE_ALLOW_OTHER;
305 break;
306
307 case OPT_KERNEL_CACHE:
308 d->flags |= FUSE_KERNEL_CACHE;
309 break;
310
Miklos Szeredid8a5ba42005-09-09 13:10:26 -0700311 default:
312 return 0;
313 }
314 }
315 if (d->fd == -1)
316 return 0;
317
318 return 1;
319}
320
321static int fuse_show_options(struct seq_file *m, struct vfsmount *mnt)
322{
323 struct fuse_conn *fc = get_fuse_conn_super(mnt->mnt_sb);
324
325 seq_printf(m, ",user_id=%u", fc->user_id);
Miklos Szeredi1e9a4ed2005-09-09 13:10:31 -0700326 if (fc->flags & FUSE_DEFAULT_PERMISSIONS)
327 seq_puts(m, ",default_permissions");
328 if (fc->flags & FUSE_ALLOW_OTHER)
329 seq_puts(m, ",allow_other");
330 if (fc->flags & FUSE_KERNEL_CACHE)
331 seq_puts(m, ",kernel_cache");
Miklos Szeredid8a5ba42005-09-09 13:10:26 -0700332 return 0;
333}
334
Miklos Szeredi334f4852005-09-09 13:10:27 -0700335static void free_conn(struct fuse_conn *fc)
336{
337 while (!list_empty(&fc->unused_list)) {
338 struct fuse_req *req;
339 req = list_entry(fc->unused_list.next, struct fuse_req, list);
340 list_del(&req->list);
341 fuse_request_free(req);
342 }
343 kfree(fc);
344}
345
346/* Must be called with the fuse lock held */
Miklos Szeredid8a5ba42005-09-09 13:10:26 -0700347void fuse_release_conn(struct fuse_conn *fc)
348{
Miklos Szeredi1e9a4ed2005-09-09 13:10:31 -0700349 fc->count--;
350 if (!fc->count)
Miklos Szeredi334f4852005-09-09 13:10:27 -0700351 free_conn(fc);
Miklos Szeredid8a5ba42005-09-09 13:10:26 -0700352}
353
354static struct fuse_conn *new_conn(void)
355{
356 struct fuse_conn *fc;
357
358 fc = kmalloc(sizeof(*fc), GFP_KERNEL);
359 if (fc != NULL) {
Miklos Szeredi334f4852005-09-09 13:10:27 -0700360 int i;
Miklos Szeredid8a5ba42005-09-09 13:10:26 -0700361 memset(fc, 0, sizeof(*fc));
Miklos Szeredi334f4852005-09-09 13:10:27 -0700362 init_waitqueue_head(&fc->waitq);
363 INIT_LIST_HEAD(&fc->pending);
364 INIT_LIST_HEAD(&fc->processing);
365 INIT_LIST_HEAD(&fc->unused_list);
Miklos Szeredi1e9a4ed2005-09-09 13:10:31 -0700366 INIT_LIST_HEAD(&fc->background);
Miklos Szeredi334f4852005-09-09 13:10:27 -0700367 sema_init(&fc->outstanding_sem, 0);
Miklos Szeredi1e9a4ed2005-09-09 13:10:31 -0700368 init_rwsem(&fc->sbput_sem);
Miklos Szeredi334f4852005-09-09 13:10:27 -0700369 for (i = 0; i < FUSE_MAX_OUTSTANDING; i++) {
370 struct fuse_req *req = fuse_request_alloc();
371 if (!req) {
372 free_conn(fc);
373 return NULL;
374 }
375 list_add(&req->list, &fc->unused_list);
376 }
Miklos Szeredid8a5ba42005-09-09 13:10:26 -0700377 fc->bdi.ra_pages = (VM_MAX_READAHEAD * 1024) / PAGE_CACHE_SIZE;
378 fc->bdi.unplug_io_fn = default_unplug_io_fn;
Miklos Szeredi334f4852005-09-09 13:10:27 -0700379 fc->reqctr = 0;
Miklos Szeredid8a5ba42005-09-09 13:10:26 -0700380 }
381 return fc;
382}
383
384static struct fuse_conn *get_conn(struct file *file, struct super_block *sb)
385{
386 struct fuse_conn *fc;
387
Miklos Szeredi334f4852005-09-09 13:10:27 -0700388 if (file->f_op != &fuse_dev_operations)
389 return ERR_PTR(-EINVAL);
Miklos Szeredid8a5ba42005-09-09 13:10:26 -0700390 fc = new_conn();
391 if (fc == NULL)
Miklos Szeredi334f4852005-09-09 13:10:27 -0700392 return ERR_PTR(-ENOMEM);
Miklos Szeredid8a5ba42005-09-09 13:10:26 -0700393 spin_lock(&fuse_lock);
Miklos Szeredi334f4852005-09-09 13:10:27 -0700394 if (file->private_data) {
395 free_conn(fc);
396 fc = ERR_PTR(-EINVAL);
397 } else {
398 file->private_data = fc;
Miklos Szeredi1e9a4ed2005-09-09 13:10:31 -0700399 *get_fuse_conn_super_p(sb) = fc;
400 fc->mounted = 1;
401 fc->connected = 1;
402 fc->count = 2;
Miklos Szeredi334f4852005-09-09 13:10:27 -0700403 }
Miklos Szeredid8a5ba42005-09-09 13:10:26 -0700404 spin_unlock(&fuse_lock);
405 return fc;
406}
407
408static struct inode *get_root_inode(struct super_block *sb, unsigned mode)
409{
410 struct fuse_attr attr;
411 memset(&attr, 0, sizeof(attr));
412
413 attr.mode = mode;
414 attr.ino = FUSE_ROOT_ID;
Miklos Szeredi9e6268d2005-09-09 13:10:29 -0700415 return fuse_iget(sb, 1, 0, &attr);
Miklos Szeredid8a5ba42005-09-09 13:10:26 -0700416}
417
418static struct super_operations fuse_super_operations = {
419 .alloc_inode = fuse_alloc_inode,
420 .destroy_inode = fuse_destroy_inode,
421 .read_inode = fuse_read_inode,
422 .clear_inode = fuse_clear_inode,
423 .put_super = fuse_put_super,
Miklos Szeredie5e55582005-09-09 13:10:28 -0700424 .statfs = fuse_statfs,
Miklos Szeredid8a5ba42005-09-09 13:10:26 -0700425 .show_options = fuse_show_options,
426};
427
Miklos Szeredid8a5ba42005-09-09 13:10:26 -0700428static int fuse_fill_super(struct super_block *sb, void *data, int silent)
429{
430 struct fuse_conn *fc;
431 struct inode *root;
432 struct fuse_mount_data d;
433 struct file *file;
434 int err;
435
436 if (!parse_fuse_opt((char *) data, &d))
437 return -EINVAL;
438
439 sb->s_blocksize = PAGE_CACHE_SIZE;
440 sb->s_blocksize_bits = PAGE_CACHE_SHIFT;
441 sb->s_magic = FUSE_SUPER_MAGIC;
442 sb->s_op = &fuse_super_operations;
443 sb->s_maxbytes = MAX_LFS_FILESIZE;
444
445 file = fget(d.fd);
446 if (!file)
447 return -EINVAL;
448
449 fc = get_conn(file, sb);
450 fput(file);
Miklos Szeredi334f4852005-09-09 13:10:27 -0700451 if (IS_ERR(fc))
452 return PTR_ERR(fc);
Miklos Szeredid8a5ba42005-09-09 13:10:26 -0700453
Miklos Szeredi1e9a4ed2005-09-09 13:10:31 -0700454 fc->flags = d.flags;
Miklos Szeredid8a5ba42005-09-09 13:10:26 -0700455 fc->user_id = d.user_id;
456
Miklos Szeredid8a5ba42005-09-09 13:10:26 -0700457 err = -ENOMEM;
458 root = get_root_inode(sb, d.rootmode);
459 if (root == NULL)
460 goto err;
461
462 sb->s_root = d_alloc_root(root);
463 if (!sb->s_root) {
464 iput(root);
465 goto err;
466 }
Miklos Szeredi334f4852005-09-09 13:10:27 -0700467 fuse_send_init(fc);
Miklos Szeredid8a5ba42005-09-09 13:10:26 -0700468 return 0;
469
470 err:
471 spin_lock(&fuse_lock);
Miklos Szeredid8a5ba42005-09-09 13:10:26 -0700472 fuse_release_conn(fc);
473 spin_unlock(&fuse_lock);
Miklos Szeredid8a5ba42005-09-09 13:10:26 -0700474 return err;
475}
476
477static struct super_block *fuse_get_sb(struct file_system_type *fs_type,
478 int flags, const char *dev_name,
479 void *raw_data)
480{
481 return get_sb_nodev(fs_type, flags, raw_data, fuse_fill_super);
482}
483
484static struct file_system_type fuse_fs_type = {
485 .owner = THIS_MODULE,
486 .name = "fuse",
487 .get_sb = fuse_get_sb,
488 .kill_sb = kill_anon_super,
489};
490
491static void fuse_inode_init_once(void *foo, kmem_cache_t *cachep,
492 unsigned long flags)
493{
494 struct inode * inode = foo;
495
496 if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) ==
497 SLAB_CTOR_CONSTRUCTOR)
498 inode_init_once(inode);
499}
500
501static int __init fuse_fs_init(void)
502{
503 int err;
504
505 err = register_filesystem(&fuse_fs_type);
506 if (err)
507 printk("fuse: failed to register filesystem\n");
508 else {
509 fuse_inode_cachep = kmem_cache_create("fuse_inode",
510 sizeof(struct fuse_inode),
511 0, SLAB_HWCACHE_ALIGN,
512 fuse_inode_init_once, NULL);
513 if (!fuse_inode_cachep) {
514 unregister_filesystem(&fuse_fs_type);
515 err = -ENOMEM;
516 }
517 }
518
519 return err;
520}
521
522static void fuse_fs_cleanup(void)
523{
524 unregister_filesystem(&fuse_fs_type);
525 kmem_cache_destroy(fuse_inode_cachep);
526}
527
528static int __init fuse_init(void)
529{
530 int res;
531
532 printk("fuse init (API version %i.%i)\n",
533 FUSE_KERNEL_VERSION, FUSE_KERNEL_MINOR_VERSION);
534
535 spin_lock_init(&fuse_lock);
536 res = fuse_fs_init();
537 if (res)
538 goto err;
539
Miklos Szeredi334f4852005-09-09 13:10:27 -0700540 res = fuse_dev_init();
541 if (res)
542 goto err_fs_cleanup;
543
Miklos Szeredid8a5ba42005-09-09 13:10:26 -0700544 return 0;
545
Miklos Szeredi334f4852005-09-09 13:10:27 -0700546 err_fs_cleanup:
547 fuse_fs_cleanup();
Miklos Szeredid8a5ba42005-09-09 13:10:26 -0700548 err:
549 return res;
550}
551
552static void __exit fuse_exit(void)
553{
554 printk(KERN_DEBUG "fuse exit\n");
555
556 fuse_fs_cleanup();
Miklos Szeredi334f4852005-09-09 13:10:27 -0700557 fuse_dev_cleanup();
Miklos Szeredid8a5ba42005-09-09 13:10:26 -0700558}
559
560module_init(fuse_init);
561module_exit(fuse_exit);