libfuse
fuse_i.h
1 /*
2  FUSE: Filesystem in Userspace
3  Copyright (C) 2001-2007 Miklos Szeredi <miklos@szeredi.hu>
4 
5  This program can be distributed under the terms of the GNU LGPLv2.
6  See the file COPYING.LIB
7 */
8 
9 #include "fuse.h"
10 #include "fuse_lowlevel.h"
11 
12 struct mount_opts;
13 
14 struct fuse_req {
15  struct fuse_session *se;
16  uint64_t unique;
17  int ctr;
18  pthread_mutex_t lock;
19  struct fuse_ctx ctx;
20  struct fuse_chan *ch;
21  int interrupted;
22  unsigned int ioctl_64bit : 1;
23  union {
24  struct {
25  uint64_t unique;
26  } i;
27  struct {
29  void *data;
30  } ni;
31  } u;
32  struct fuse_req *next;
33  struct fuse_req *prev;
34 };
35 
36 struct fuse_notify_req {
37  uint64_t unique;
38  void (*reply)(struct fuse_notify_req *, fuse_req_t, fuse_ino_t,
39  const void *, const struct fuse_buf *);
40  struct fuse_notify_req *next;
41  struct fuse_notify_req *prev;
42 };
43 
44 struct fuse_session {
45  char *mountpoint;
46  volatile int exited;
47  int fd;
48  struct mount_opts *mo;
49  int debug;
50  int deny_others;
51  struct fuse_lowlevel_ops op;
52  int got_init;
53  struct cuse_data *cuse_data;
54  void *userdata;
55  uid_t owner;
56  struct fuse_conn_info conn;
57  struct fuse_req list;
58  struct fuse_req interrupts;
59  pthread_mutex_t lock;
60  int got_destroy;
61  pthread_key_t pipe_key;
62  int broken_splice_nonblock;
63  uint64_t notify_ctr;
64  struct fuse_notify_req notify_list;
65  size_t bufsize;
66  int error;
67 };
68 
69 struct fuse_chan {
70  pthread_mutex_t lock;
71  int ctr;
72  int fd;
73 };
74 
82 struct fuse_module {
83  char *name;
84  fuse_module_factory_t factory;
85  struct fuse_module *next;
86  struct fusemod_so *so;
87  int ctr;
88 };
89 
90 /* ----------------------------------------------------------- *
91  * Channel interface (when using -o clone_fd) *
92  * ----------------------------------------------------------- */
93 
100 struct fuse_chan *fuse_chan_get(struct fuse_chan *ch);
101 
107 void fuse_chan_put(struct fuse_chan *ch);
108 
109 struct mount_opts *parse_mount_opts(struct fuse_args *args);
110 void destroy_mount_opts(struct mount_opts *mo);
111 void fuse_mount_version(void);
112 unsigned get_max_read(struct mount_opts *o);
113 void fuse_kern_unmount(const char *mountpoint, int fd);
114 int fuse_kern_mount(const char *mountpoint, struct mount_opts *mo);
115 
116 int fuse_send_reply_iov_nofree(fuse_req_t req, int error, struct iovec *iov,
117  int count);
118 void fuse_free_req(fuse_req_t req);
119 
120 void cuse_lowlevel_init(fuse_req_t req, fuse_ino_t nodeide, const void *inarg);
121 
122 int fuse_start_thread(pthread_t *thread_id, void *(*func)(void *), void *arg);
123 
124 int fuse_session_receive_buf_int(struct fuse_session *se, struct fuse_buf *buf,
125  struct fuse_chan *ch);
126 void fuse_session_process_buf_int(struct fuse_session *se,
127  const struct fuse_buf *buf, struct fuse_chan *ch);
128 
129 struct fuse *fuse_new_31(struct fuse_args *args, const struct fuse_operations *op,
130  size_t op_size, void *private_data);
131 int fuse_loop_mt_32(struct fuse *f, struct fuse_loop_config *config);
132 int fuse_session_loop_mt_32(struct fuse_session *se, struct fuse_loop_config *config);
133 
134 #define FUSE_MAX_MAX_PAGES 256
135 #define FUSE_DEFAULT_MAX_PAGES_PER_REQ 32
136 
137 /* room needed in buffer to accommodate header */
138 #define FUSE_BUFFER_HEADER_SIZE 0x1000
139 
struct fuse_fs *(* fuse_module_factory_t)(struct fuse_args *args, struct fuse_fs *fs[])
Definition: fuse.h:1258
void(* fuse_interrupt_func_t)(fuse_req_t req, void *data)
struct fuse_req * fuse_req_t
Definition: fuse_lowlevel.h:49
uint64_t fuse_ino_t
Definition: fuse_lowlevel.h:46