diff options
author | Miklos Szeredi <miklos@szeredi.hu> | 2001-10-24 14:37:13 +0000 |
---|---|---|
committer | Miklos Szeredi <miklos@szeredi.hu> | 2001-10-24 14:37:13 +0000 |
commit | 79b52f63303c15d4545a7464775f4b1beab8d2c9 (patch) | |
tree | 7f3c12670af489f58740408ad755e775e27803ef /util.c | |
parent | d8318555890588b0982749fdd23826d9ddb02098 (diff) | |
download | libfuse-79b52f63303c15d4545a7464775f4b1beab8d2c9.tar.gz |
improvements
Diffstat (limited to 'util.c')
-rw-r--r-- | util.c | 63 |
1 files changed, 63 insertions, 0 deletions
@@ -0,0 +1,63 @@ +/* + 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/module.h> +#include <linux/kernel.h> +#include <linux/smp_lock.h> +#include <linux/slab.h> + +#define FUSE_VERSION "0.1" + +spinlock_t fuse_lock = SPIN_LOCK_UNLOCKED; + +/* Must be called with the fuse lock held */ +void fuse_release_conn(struct fuse_conn *fc) +{ + if(fc->sb == NULL && fc->file == NULL) { + printk(KERN_DEBUG "fuse: release connection: %i\n", fc->id); + kfree(fc); + } +} + +int init_module(void) +{ + int res; + + printk(KERN_DEBUG "fuse init (version %s)\n", FUSE_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 cleanup_module(void) +{ + printk(KERN_DEBUG "fuse cleanup\n"); + + fuse_fs_cleanup(); + fuse_dev_cleanup(); +} + +/* + * Local Variables: + * indent-tabs-mode: t + * c-basic-offset: 8 + */ |