virtiofsd: Format imported files to qemu style
[qemu/kevin.git] / tools / virtiofsd / fuse_i.h
blobe63cb5838873284a5a6d39f238113fd96bf4093d
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_req {
13 struct fuse_session *se;
14 uint64_t unique;
15 int ctr;
16 pthread_mutex_t lock;
17 struct fuse_ctx ctx;
18 struct fuse_chan *ch;
19 int interrupted;
20 unsigned int ioctl_64bit:1;
21 union {
22 struct {
23 uint64_t unique;
24 } i;
25 struct {
26 fuse_interrupt_func_t func;
27 void *data;
28 } ni;
29 } u;
30 struct fuse_req *next;
31 struct fuse_req *prev;
34 struct fuse_notify_req {
35 uint64_t unique;
36 void (*reply)(struct fuse_notify_req *, fuse_req_t, fuse_ino_t,
37 const void *, const struct fuse_buf *);
38 struct fuse_notify_req *next;
39 struct fuse_notify_req *prev;
42 struct fuse_session {
43 char *mountpoint;
44 volatile int exited;
45 int fd;
46 int debug;
47 int deny_others;
48 struct fuse_lowlevel_ops op;
49 int got_init;
50 struct cuse_data *cuse_data;
51 void *userdata;
52 uid_t owner;
53 struct fuse_conn_info conn;
54 struct fuse_req list;
55 struct fuse_req interrupts;
56 pthread_mutex_t lock;
57 int got_destroy;
58 int broken_splice_nonblock;
59 uint64_t notify_ctr;
60 struct fuse_notify_req notify_list;
61 size_t bufsize;
62 int error;
65 struct fuse_chan {
66 pthread_mutex_t lock;
67 int ctr;
68 int fd;
71 /**
72 * Filesystem module
74 * Filesystem modules are registered with the FUSE_REGISTER_MODULE()
75 * macro.
78 struct fuse_module {
79 char *name;
80 fuse_module_factory_t factory;
81 struct fuse_module *next;
82 struct fusemod_so *so;
83 int ctr;
86 int fuse_send_reply_iov_nofree(fuse_req_t req, int error, struct iovec *iov,
87 int count);
88 void fuse_free_req(fuse_req_t req);
90 void fuse_session_process_buf_int(struct fuse_session *se,
91 const struct fuse_buf *buf,
92 struct fuse_chan *ch);
95 #define FUSE_MAX_MAX_PAGES 256
96 #define FUSE_DEFAULT_MAX_PAGES_PER_REQ 32
98 /* room needed in buffer to accommodate header */
99 #define FUSE_BUFFER_HEADER_SIZE 0x1000