libfuse: add "time_gran" option
[fuse.git] / lib / fuse_i.h
blob4bbcbd61b439b8d9bc131fba83b8297bc2b9f268
1 /*
2 FUSE: Filesystem in Userspace
3 Copyright (C) 2001-2007 Miklos Szeredi <miklos@szeredi.hu>
5 This program can be distributed under the terms of the GNU LGPLv2.
6 See the file COPYING.LIB
7 */
9 #include "fuse.h"
10 #include "fuse_lowlevel.h"
12 struct fuse_chan;
13 struct fuse_ll;
15 struct fuse_session {
16 struct fuse_ll *f;
18 volatile int exited;
20 struct fuse_chan *ch;
23 struct fuse_chan {
24 struct fuse_session *se;
26 int fd;
30 struct fuse_req {
31 struct fuse_ll *f;
32 uint64_t unique;
33 int ctr;
34 pthread_mutex_t lock;
35 struct fuse_ctx ctx;
36 struct fuse_chan *ch;
37 int interrupted;
38 unsigned int ioctl_64bit : 1;
39 union {
40 struct {
41 uint64_t unique;
42 } i;
43 struct {
44 fuse_interrupt_func_t func;
45 void *data;
46 } ni;
47 } u;
48 struct fuse_req *next;
49 struct fuse_req *prev;
52 struct fuse_notify_req {
53 uint64_t unique;
54 void (*reply)(struct fuse_notify_req *, fuse_req_t, fuse_ino_t,
55 const void *, const struct fuse_buf *);
56 struct fuse_notify_req *next;
57 struct fuse_notify_req *prev;
60 struct fuse_ll {
61 int debug;
62 int allow_root;
63 int atomic_o_trunc;
64 int no_remote_posix_lock;
65 int no_remote_flock;
66 int big_writes;
67 int splice_write;
68 int splice_move;
69 int splice_read;
70 int no_splice_write;
71 int no_splice_move;
72 int no_splice_read;
73 int auto_inval_data;
74 int no_auto_inval_data;
75 int no_readdirplus;
76 int no_readdirplus_auto;
77 int async_dio;
78 int no_async_dio;
79 int writeback_cache;
80 int no_writeback_cache;
81 struct fuse_lowlevel_ops op;
82 int got_init;
83 struct cuse_data *cuse_data;
84 void *userdata;
85 uid_t owner;
86 struct fuse_conn_info conn;
87 struct fuse_req list;
88 struct fuse_req interrupts;
89 pthread_mutex_t lock;
90 int got_destroy;
91 pthread_key_t pipe_key;
92 int broken_splice_nonblock;
93 uint64_t notify_ctr;
94 struct fuse_notify_req notify_list;
95 size_t bufsize;
98 /**
99 * Filesystem module
101 * Filesystem modules are registered with the FUSE_REGISTER_MODULE()
102 * macro.
105 struct fuse_module {
106 char *name;
107 fuse_module_factory_t factory;
108 struct fuse_module *next;
109 struct fusemod_so *so;
110 int ctr;
113 int fuse_chan_clearfd(struct fuse_chan *ch);
114 void fuse_chan_close(struct fuse_chan *ch);
117 * Create a new session
119 * @return new session object, or NULL on failure
121 struct fuse_session *fuse_session_new(void);
124 * Create a new channel
126 * @param op channel operations
127 * @param fd file descriptor of the channel
128 * @return the new channel object, or NULL on failure
130 struct fuse_chan *fuse_chan_new(int fd);
133 * Query the session to which this channel is assigned
135 * @param ch the channel
136 * @return the session, or NULL if the channel is not assigned
138 struct fuse_session *fuse_chan_session(struct fuse_chan *ch);
140 void fuse_kern_unmount(const char *mountpoint, int fd);
141 int fuse_kern_mount(const char *mountpoint, struct fuse_args *args);
143 int fuse_send_reply_iov_nofree(fuse_req_t req, int error, struct iovec *iov,
144 int count);
145 void fuse_free_req(fuse_req_t req);
147 void cuse_lowlevel_init(fuse_req_t req, fuse_ino_t nodeide, const void *inarg);
149 int fuse_start_thread(pthread_t *thread_id, void *(*func)(void *), void *arg);