diff options
author | Miklos Szeredi <miklos@szeredi.hu> | 2005-07-15 09:59:59 +0000 |
---|---|---|
committer | Miklos Szeredi <miklos@szeredi.hu> | 2005-07-15 09:59:59 +0000 |
commit | bd10a7b16f10c1a5f61a4531c8631048e00fa230 (patch) | |
tree | 3662bd63e8b6b4946a757f73ac65c47a32b63beb /include | |
parent | 163581a2d291cf8b7d93e9e58756a43c8209af1c (diff) | |
download | libfuse-bd10a7b16f10c1a5f61a4531c8631048e00fa230.tar.gz |
added lowlevel API
Diffstat (limited to 'include')
-rw-r--r-- | include/fuse.h | 5 | ||||
-rw-r--r-- | include/fuse_common.h | 3 | ||||
-rw-r--r-- | include/fuse_lowlevel.h | 35 |
3 files changed, 36 insertions, 7 deletions
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 @@ struct fuse_context *fuse_get_context(void); /** * Obsolete, doesn't do anything * - * @return 0 + * @return -EINVAL */ int fuse_invalidate(struct fuse *f, const char *path); @@ -474,9 +474,6 @@ int fuse_main_real(int argc, char *argv[], const struct fuse_operations *op, * 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 @@ struct fuse_file_info { 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 @@ struct fuse_entry_param { 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_entry_param { /* ------------------------------------------ */ 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_ll_operations { 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 @@ char *fuse_add_dirent(char *buf, const char *name, const struct stat *stat, /* ------------------------------------------ */ +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_is_lib_option(const char *opt); 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 |