aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Miklos Szeredi <miklos@szeredi.hu>2005-07-15 13:31:36 +0000
committerGravatar Miklos Szeredi <miklos@szeredi.hu>2005-07-15 13:31:36 +0000
commite2aa2e243d729e29ad67f1b30aa3392ca9a9cdb2 (patch)
treeacab77c357b36a6703450f0802423a0ca4b3ae01
parentbd10a7b16f10c1a5f61a4531c8631048e00fa230 (diff)
cleanup
-rw-r--r--include/fuse.h5
-rw-r--r--include/fuse_lowlevel.h2
-rw-r--r--lib/Makefile.am1
-rw-r--r--lib/fuse.c33
-rw-r--r--lib/fuse_i.h38
-rw-r--r--lib/fuse_mt.c8
-rw-r--r--lib/helper.c6
7 files changed, 47 insertions, 46 deletions
diff --git a/include/fuse.h b/include/fuse.h
index 07438b1..6c6cf09 100644
--- a/include/fuse.h
+++ b/include/fuse.h
@@ -497,11 +497,14 @@ int fuse_loop_mt_proc(struct fuse *f, fuse_processor_t proc, void *data);
/** Return the exited flag, which indicates if fuse_exit() has been
called */
-int fuse_exited(struct fuse* f);
+int fuse_exited(struct fuse *f);
/** Set function which can be used to get the current context */
void fuse_set_getcontext_func(struct fuse_context *(*func)(void));
+/** Returns the lowlevel FUSE object */
+struct fuse_ll *fuse_get_lowlevel(struct fuse *f);
+
/* ----------------------------------------------------------- *
* Compatibility stuff *
* ----------------------------------------------------------- */
diff --git a/include/fuse_lowlevel.h b/include/fuse_lowlevel.h
index dce091c..deab718 100644
--- a/include/fuse_lowlevel.h
+++ b/include/fuse_lowlevel.h
@@ -15,10 +15,10 @@
#include "fuse_common.h"
+#include <utime.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/statfs.h>
-#include <utime.h>
#ifdef __cplusplus
extern "C" {
diff --git a/lib/Makefile.am b/lib/Makefile.am
index 07e7142..223b975 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -9,7 +9,6 @@ libfuse_la_SOURCES = \
fuse_lowlevel_mt.c \
helper.c \
mount.c \
- fuse_i.h \
fuse_lowlevel_i.h
libfuse_la_LDFLAGS = -lpthread -version-number 2:3:1 \
diff --git a/lib/fuse.c b/lib/fuse.c
index b93ded3..79ce5e7 100644
--- a/lib/fuse.c
+++ b/lib/fuse.c
@@ -6,7 +6,12 @@
See the file COPYING.LIB
*/
-#include "fuse_i.h"
+
+/* For pthread_rwlock_t */
+#define _GNU_SOURCE
+
+#include "fuse.h"
+#include "fuse_lowlevel.h"
#include "fuse_compat.h"
#include <stdio.h>
@@ -17,6 +22,7 @@
#include <errno.h>
#include <assert.h>
#include <stdint.h>
+#include <pthread.h>
#include <sys/param.h>
#include <sys/uio.h>
@@ -53,6 +59,26 @@
#define ENTRY_REVALIDATE_TIME 1.0 /* sec */
#define ATTR_REVALIDATE_TIME 1.0 /* sec */
+struct fuse {
+ struct fuse_ll *fll;
+ int flags;
+ struct fuse_operations op;
+ int compat;
+ struct node **name_table;
+ size_t name_table_size;
+ struct node **id_table;
+ size_t id_table_size;
+ fuse_ino_t ctr;
+ unsigned int generation;
+ unsigned int hidectr;
+ pthread_mutex_t lock;
+ pthread_rwlock_t tree_lock;
+ void *user_data;
+ uid_t uid;
+ gid_t gid;
+ mode_t umask;
+};
+
struct node {
struct node *name_next;
struct node *id_next;
@@ -1626,6 +1652,11 @@ void fuse_set_getcontext_func(struct fuse_context *(*func)(void))
fuse_getcontext = func;
}
+struct fuse_ll *fuse_get_lowlevel(struct fuse *f)
+{
+ return f->fll;
+}
+
static int begins_with(const char *s, const char *beg)
{
if (strncmp(s, beg, strlen(beg)) == 0)
diff --git a/lib/fuse_i.h b/lib/fuse_i.h
deleted file mode 100644
index de1724c..0000000
--- a/lib/fuse_i.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- FUSE: Filesystem in Userspace
- Copyright (C) 2001-2005 Miklos Szeredi <miklos@szeredi.hu>
-
- This program can be distributed under the terms of the GNU LGPL.
- See the file COPYING.LIB.
-*/
-
-/* For pthread_rwlock_t */
-#define _GNU_SOURCE
-
-#include "fuse.h"
-#include "fuse_lowlevel.h"
-#include <pthread.h>
-
-struct fuse {
- struct fuse_ll *fll;
- int flags;
- struct fuse_operations op;
- int compat;
- struct node **name_table;
- size_t name_table_size;
- struct node **id_table;
- size_t id_table_size;
- fuse_ino_t ctr;
- unsigned int generation;
- unsigned int hidectr;
- pthread_mutex_t lock;
- pthread_rwlock_t tree_lock;
- void *user_data;
- uid_t uid;
- gid_t gid;
- mode_t umask;
-};
-
-struct fuse *fuse_new_common(int fd, const char *opts,
- const struct fuse_operations *op,
- size_t op_size, int compat);
diff --git a/lib/fuse_mt.c b/lib/fuse_mt.c
index c1801c9..c9fe63c 100644
--- a/lib/fuse_mt.c
+++ b/lib/fuse_mt.c
@@ -6,11 +6,13 @@
See the file COPYING.LIB.
*/
-#include "fuse_i.h"
+#include "fuse.h"
+#include "fuse_lowlevel.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <pthread.h>
static pthread_key_t context_key;
@@ -92,7 +94,7 @@ int fuse_loop_mt_proc(struct fuse *f, fuse_processor_t proc, void *data)
if (mt_create_context_key() != 0)
return -1;
- res = fuse_ll_loop_mt_proc(f->fll, mt_generic_proc, &pd);
+ res = fuse_ll_loop_mt_proc(fuse_get_lowlevel(f), mt_generic_proc, &pd);
mt_delete_context_key();
return res;
@@ -105,7 +107,7 @@ int fuse_loop_mt(struct fuse *f)
if (mt_create_context_key() != 0)
return -1;
- res = fuse_ll_loop_mt(f->fll);
+ res = fuse_ll_loop_mt(fuse_get_lowlevel(f));
mt_delete_context_key();
return res;
diff --git a/lib/helper.c b/lib/helper.c
index d5c63f2..d8e694f 100644
--- a/lib/helper.c
+++ b/lib/helper.c
@@ -6,7 +6,7 @@
See the file COPYING.LIB.
*/
-#include "fuse_i.h"
+#include "fuse.h"
#include "fuse_compat.h"
#include <stdio.h>
@@ -16,6 +16,10 @@
#include <limits.h>
#include <signal.h>
+struct fuse *fuse_new_common(int fd, const char *opts,
+ const struct fuse_operations *op,
+ size_t op_size, int compat);
+
static struct fuse *fuse_instance;
static void usage(const char *progname)