cleanup
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 @@
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 @@
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 @@
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 @@
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)