cleanup
authorMiklos Szeredi <miklos@szeredi.hu>
Fri, 15 Jul 2005 13:31:36 +0000 (13:31 +0000)
committerMiklos Szeredi <miklos@szeredi.hu>
Fri, 15 Jul 2005 13:31:36 +0000 (13:31 +0000)
include/fuse.h
include/fuse_lowlevel.h
lib/Makefile.am
lib/fuse.c
lib/fuse_i.h [deleted file]
lib/fuse_mt.c
lib/helper.c

index 07438b1d1f17ed6e3fe13207928d4436afa51852..6c6cf097dbf381519a6658d208a98b84cee35467 100644 (file)
@@ -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 fusef);
+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                                         *
  * ----------------------------------------------------------- */
index dce091c751a3b650609b57d9923a740434ec7ac1..deab718c82f97874045c1ef48c89bda802f6c069 100644 (file)
 
 #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" {
index 07e714244365f5979a1e49224e8a58901f10c716..223b97503fa52a95d5f18c082e06a0e9390909ee 100644 (file)
@@ -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 \
index b93ded3519b9e1f86b7e3699d76fa86c63837100..79ce5e79260932fcb041abfa9f262cae9e32c041 100644 (file)
@@ -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>
 
 #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 (file)
index de1724c..0000000
+++ /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);
index c1801c9cf831f8c7ed2fb28295d70d94357da9a9..c9fe63cbe6011d5d9771b78ac5b4b3dde0e24751 100644 (file)
@@ -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;
index d5c63f2e7bf6fd9a31e008342d668708004dc9a0..d8e694fe86d51c502d9197186cef9c0ef884a159 100644 (file)
@@ -6,7 +6,7 @@
     See the file COPYING.LIB.
 */
 
-#include "fuse_i.h"
+#include "fuse.h"
 #include "fuse_compat.h"
 
 #include <stdio.h>
 #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)