fuse_buf_copy: check if buffers are the same
[fuse.git] / lib / fuse_i.h
blob9d0de5804f225e6ed38dac61ca6a85afd58c3490
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_session_ops op;
18 int (*receive_buf)(struct fuse_session *se, struct fuse_buf *buf,
19 struct fuse_chan **chp);
21 void (*process_buf)(void *data, const struct fuse_buf *buf,
22 struct fuse_chan *ch);
24 void *data;
26 volatile int exited;
28 struct fuse_chan *ch;
31 struct fuse_req {
32 struct fuse_ll *f;
33 uint64_t unique;
34 int ctr;
35 pthread_mutex_t lock;
36 struct fuse_ctx ctx;
37 struct fuse_chan *ch;
38 int interrupted;
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_lock;
65 int big_writes;
66 int no_splice_write;
67 int no_splice_move;
68 int no_splice_read;
69 struct fuse_lowlevel_ops op;
70 int got_init;
71 struct cuse_data *cuse_data;
72 void *userdata;
73 uid_t owner;
74 struct fuse_conn_info conn;
75 struct fuse_req list;
76 struct fuse_req interrupts;
77 pthread_mutex_t lock;
78 int got_destroy;
79 pthread_key_t pipe_key;
80 int broken_splice_nonblock;
81 uint64_t notify_ctr;
82 struct fuse_notify_req notify_list;
85 struct fuse_cmd {
86 char *buf;
87 size_t buflen;
88 struct fuse_chan *ch;
91 struct fuse *fuse_new_common(struct fuse_chan *ch, struct fuse_args *args,
92 const struct fuse_operations *op,
93 size_t op_size, void *user_data, int compat);
95 int fuse_sync_compat_args(struct fuse_args *args);
97 struct fuse_chan *fuse_kern_chan_new(int fd);
99 struct fuse_session *fuse_lowlevel_new_common(struct fuse_args *args,
100 const struct fuse_lowlevel_ops *op,
101 size_t op_size, void *userdata);
103 void fuse_kern_unmount_compat22(const char *mountpoint);
104 void fuse_kern_unmount(const char *mountpoint, int fd);
105 int fuse_kern_mount(const char *mountpoint, struct fuse_args *args);
107 int fuse_send_reply_iov_nofree(fuse_req_t req, int error, struct iovec *iov,
108 int count);
109 void fuse_free_req(fuse_req_t req);
112 struct fuse *fuse_setup_common(int argc, char *argv[],
113 const struct fuse_operations *op,
114 size_t op_size,
115 char **mountpoint,
116 int *multithreaded,
117 int *fd,
118 void *user_data,
119 int compat);
121 void cuse_lowlevel_init(fuse_req_t req, fuse_ino_t nodeide, const void *inarg);