added lowlevel API
diff --git a/include/fuse.h b/include/fuse.h
index 24e8871..07438b1 100644
--- a/include/fuse.h
+++ b/include/fuse.h
@@ -449,7 +449,7 @@
/**
* Obsolete, doesn't do anything
*
- * @return 0
+ * @return -EINVAL
*/
int fuse_invalidate(struct fuse *f, const char *path);
@@ -474,9 +474,6 @@
* Advanced API for event handling, don't worry about this... *
* ----------------------------------------------------------- */
-/** Structure containing a raw command */
-struct fuse_cmd;
-
/** Function type used to process commands */
typedef void (*fuse_processor_t)(struct fuse *, struct fuse_cmd *, void *);
diff --git a/include/fuse_common.h b/include/fuse_common.h
index 96359ef..b78e977 100644
--- a/include/fuse_common.h
+++ b/include/fuse_common.h
@@ -30,4 +30,7 @@
unsigned int direct_io : 1;
};
+/** Structure containing a raw command */
+struct fuse_cmd;
+
#endif /* _FUSE_COMMON_H_ */
diff --git a/include/fuse_lowlevel.h b/include/fuse_lowlevel.h
index 0881ac8..dce091c 100644
--- a/include/fuse_lowlevel.h
+++ b/include/fuse_lowlevel.h
@@ -24,8 +24,12 @@
extern "C" {
#endif
+/** The node ID of the root inode */
+#define FUSE_ROOT_ID 1
+
typedef unsigned long fuse_ino_t;
typedef struct fuse_req *fuse_req_t;
+struct fuse_ll;
struct fuse_entry_param {
fuse_ino_t ino;
@@ -35,6 +39,17 @@
double entry_timeout;
};
+struct fuse_ctx {
+ /** User ID of the calling process */
+ uid_t uid;
+
+ /** Group ID of the calling process */
+ gid_t gid;
+
+ /** Thread ID of the calling process */
+ pid_t pid;
+};
+
/* 'to_set' flags in setattr */
#define FUSE_SET_ATTR_MODE (1 << 0)
#define FUSE_SET_ATTR_UID (1 << 1)
@@ -47,7 +62,7 @@
/* ------------------------------------------ */
struct fuse_ll_operations {
- void* (*init) (void);
+ void* (*init) (void *);
void (*destroy) (void *);
void (*lookup) (fuse_req_t req, fuse_ino_t parent, const char *name);
@@ -84,7 +99,7 @@
struct fuse_file_info *fi);
void (*fsyncdir) (fuse_req_t req, fuse_ino_t ino, int datasync,
struct fuse_file_info *fi);
- void (*statfs) (fuse_req_t req, fuse_ino_t ino);
+ void (*statfs) (fuse_req_t req);
void (*setxattr)(fuse_req_t req, fuse_ino_t ino, const char *name,
const char *value, size_t size, int flags);
void (*getxattr)(fuse_req_t req, fuse_ino_t ino, const char *name,
@@ -137,9 +152,17 @@
/* ------------------------------------------ */
+void *fuse_req_userdata(fuse_req_t req);
+
+const struct fuse_ctx *fuse_req_ctx(fuse_req_t req);
+
+/* ------------------------------------------ */
+
+typedef void (*fuse_ll_processor_t)(struct fuse_ll *, struct fuse_cmd *, void *);
+
struct fuse_ll *fuse_ll_new(int fd, const char *opts,
const struct fuse_ll_operations *op,
- size_t op_size);
+ size_t op_size, void *userdata);
void fuse_ll_destroy(struct fuse_ll *f);
@@ -147,12 +170,18 @@
int fuse_ll_loop(struct fuse_ll *f);
+void fuse_ll_exit(struct fuse_ll *f);
+
int fuse_ll_exited(struct fuse_ll* f);
struct fuse_cmd *fuse_ll_read_cmd(struct fuse_ll *f);
void fuse_ll_process_cmd(struct fuse_ll *f, struct fuse_cmd *cmd);
+int fuse_ll_loop_mt(struct fuse_ll *f);
+
+int fuse_ll_loop_mt_proc(struct fuse_ll *f, fuse_ll_processor_t proc, void *data);
+
/* ------------------------------------------ */
#ifdef __cplusplus