aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Miklos Szeredi <miklos@szeredi.hu>2005-01-08 11:50:08 +0000
committerGravatar Miklos Szeredi <miklos@szeredi.hu>2005-01-08 11:50:08 +0000
commit9080c79e94aa97fe228b3443b11e999bba1413d7 (patch)
tree89c27d5f5814b9e78b46a75919d6044cfa54e745
parent95a4b5e7e35052345c1d345fee1f77d331fd3e35 (diff)
cleanup
-rw-r--r--kernel/Makefile.in7
-rw-r--r--kernel/fuse_i.h10
-rw-r--r--kernel/inode.c42
-rw-r--r--kernel/util.c58
4 files changed, 43 insertions, 74 deletions
diff --git a/kernel/Makefile.in b/kernel/Makefile.in
index ec6ba8f..303cc88 100644
--- a/kernel/Makefile.in
+++ b/kernel/Makefile.in
@@ -7,7 +7,7 @@ majver = @majver@
VERSION = @PACKAGE_VERSION@
DISTFILES = Makefile.in configure.ac configure config.h.in ../install-sh \
- dev.c dir.c file.c inode.c util.c fuse_i.h fuse_kernel.h
+ dev.c dir.c file.c inode.c fuse_i.h fuse_kernel.h
COMPATDISTFILES = compat/parser.c compat/parser.h
fusemoduledir = @kmoduledir@/kernel/fs/fuse
@@ -51,7 +51,7 @@ LD = ld
CFLAGS = -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -pipe
CPPFLAGS = -I@kernelsrc@/include -I. -D__KERNEL__ -DMODULE -D_LOOSE_KERNEL_NAMES -DFUSE_VERSION=\"$(VERSION)\" @KERNELCPPFLAGS@
-fuse_objs = dev.o dir.o file.o inode.o util.o compat/parser.o
+fuse_objs = dev.o dir.o file.o inode.o compat/parser.o
SUFFIXES = .c .o .s
@@ -69,14 +69,13 @@ dev.o: $(fuse_headers)
dir.o: $(fuse_headers)
file.o: $(fuse_headers)
inode.o: $(fuse_headers)
-util.o: $(fuse_headers)
else
EXTRA_CFLAGS += -DFUSE_VERSION=\"$(VERSION)\"
obj-m := fuse.o
-fuse-objs := dev.o dir.o file.o inode.o util.o
+fuse-objs := dev.o dir.o file.o inode.o
all-spec:
$(MAKE) -C @kernelsrc@ SUBDIRS=$(PWD) @KERNELMAKE_PARAMS@ modules
diff --git a/kernel/fuse_i.h b/kernel/fuse_i.h
index 48211bc..15c5d8b 100644
--- a/kernel/fuse_i.h
+++ b/kernel/fuse_i.h
@@ -415,16 +415,6 @@ int fuse_dev_init(void);
void fuse_dev_cleanup(void);
/**
- * Initialize the fuse filesystem
- */
-int fuse_fs_init(void);
-
-/**
- * Cleanup the fuse filesystem
- */
-void fuse_fs_cleanup(void);
-
-/**
* Allocate a request
*/
struct fuse_req *fuse_request_alloc(void);
diff --git a/kernel/inode.c b/kernel/inode.c
index 7ce21e9..1fd4edb 100644
--- a/kernel/inode.c
+++ b/kernel/inode.c
@@ -724,7 +724,7 @@ static void fuse_inode_init_once(void * foo, kmem_cache_t * cachep,
inode_init_once(inode);
}
-int fuse_fs_init(void)
+static int __init fuse_fs_init(void)
{
int err;
@@ -745,8 +745,46 @@ int fuse_fs_init(void)
return err;
}
-void fuse_fs_cleanup(void)
+static void fuse_fs_cleanup(void)
{
unregister_filesystem(&fuse_fs_type);
kmem_cache_destroy(fuse_inode_cachep);
}
+
+int __init fuse_init(void)
+{
+ int res;
+
+ printk("fuse init (API version %i.%i)\n",
+ FUSE_KERNEL_VERSION, FUSE_KERNEL_MINOR_VERSION);
+#ifndef FUSE_MAINLINE
+ printk("fuse distribution version: %s\n", FUSE_VERSION);
+#endif
+
+ spin_lock_init(&fuse_lock);
+ 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);
diff --git a/kernel/util.c b/kernel/util.c
deleted file mode 100644
index 57375f4..0000000
--- a/kernel/util.c
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- FUSE: Filesystem in Userspace
- Copyright (C) 2001-2004 Miklos Szeredi <miklos@szeredi.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/module.h>
-
-MODULE_AUTHOR("Miklos Szeredi <miklos@szeredi.hu>");
-MODULE_DESCRIPTION("Filesystem in Userspace");
-#ifdef MODULE_LICENSE
-MODULE_LICENSE("GPL");
-#endif
-
-spinlock_t fuse_lock;
-
-int __init fuse_init(void)
-{
- int res;
-
- printk("fuse init (API version %i.%i)\n",
- FUSE_KERNEL_VERSION, FUSE_KERNEL_MINOR_VERSION);
-#ifndef FUSE_MAINLINE
- printk("fuse distribution version: %s\n", FUSE_VERSION);
-#endif
-
- spin_lock_init(&fuse_lock);
- 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);