blob: 60683b787250bec39bcc66fdc241be80392974b3 [file] [log] [blame]
Miklos Szeredid8a5ba42005-09-09 13:10:26 -07001/*
2 FUSE: Filesystem in Userspace
Miklos Szeredid7133112006-04-10 22:54:55 -07003 Copyright (C) 2001-2006 Miklos Szeredi <miklos@szeredi.hu>
Miklos Szeredid8a5ba42005-09-09 13:10:26 -07004
5 This program can be distributed under the terms of the GNU GPL.
6 See the file COPYING.
7*/
8
9#include <linux/fuse.h>
10#include <linux/fs.h>
Miklos Szeredi51eb01e2006-06-25 05:48:50 -070011#include <linux/mount.h>
Miklos Szeredid8a5ba42005-09-09 13:10:26 -070012#include <linux/wait.h>
13#include <linux/list.h>
14#include <linux/spinlock.h>
15#include <linux/mm.h>
16#include <linux/backing-dev.h>
Miklos Szeredibafa9652006-06-25 05:48:51 -070017#include <linux/mutex.h>
Miklos Szeredid8a5ba42005-09-09 13:10:26 -070018
Miklos Szeredi334f4852005-09-09 13:10:27 -070019/** Max number of pages that can be used in a single read request */
20#define FUSE_MAX_PAGES_PER_REQ 32
21
Miklos Szeredi08a53cd2006-04-10 22:54:59 -070022/** Maximum number of outstanding background requests */
Miklos Szeredif92b99b2007-10-16 23:30:59 -070023#define FUSE_MAX_BACKGROUND 12
24
25/** Congestion starts at 75% of maximum */
26#define FUSE_CONGESTION_THRESHOLD (FUSE_MAX_BACKGROUND * 75 / 100)
Miklos Szeredi08a53cd2006-04-10 22:54:59 -070027
Miklos Szeredi1d3d7522006-01-06 00:19:40 -080028/** It could be as large as PATH_MAX, but would that have any uses? */
29#define FUSE_NAME_MAX 1024
30
Miklos Szeredibafa9652006-06-25 05:48:51 -070031/** Number of dentries for each connection in the control filesystem */
32#define FUSE_CTL_NUM_DENTRIES 3
33
Miklos Szeredi1e9a4ed2005-09-09 13:10:31 -070034/** If the FUSE_DEFAULT_PERMISSIONS flag is given, the filesystem
35 module will check permissions based on the file mode. Otherwise no
36 permission checking is done in the kernel */
37#define FUSE_DEFAULT_PERMISSIONS (1 << 0)
38
39/** If the FUSE_ALLOW_OTHER flag is given, then not only the user
40 doing the mount will be allowed to access the filesystem */
41#define FUSE_ALLOW_OTHER (1 << 1)
42
Miklos Szeredibafa9652006-06-25 05:48:51 -070043/** List of active connections */
44extern struct list_head fuse_conn_list;
45
46/** Global mutex protecting fuse_conn_list and the control filesystem */
47extern struct mutex fuse_mutex;
Miklos Szeredi413ef8c2005-09-09 13:10:35 -070048
Miklos Szeredid8a5ba42005-09-09 13:10:26 -070049/** FUSE inode */
50struct fuse_inode {
51 /** Inode data */
52 struct inode inode;
53
54 /** Unique ID, which identifies the inode between userspace
55 * and kernel */
56 u64 nodeid;
57
Miklos Szeredi9e6268d2005-09-09 13:10:29 -070058 /** Number of lookups on this inode */
59 u64 nlookup;
60
Miklos Szeredie5e55582005-09-09 13:10:28 -070061 /** The request used for sending the FORGET message */
62 struct fuse_req *forget_req;
63
Miklos Szeredid8a5ba42005-09-09 13:10:26 -070064 /** Time in jiffies until the file attributes are valid */
Miklos Szeredi0a0898c2006-07-30 03:04:10 -070065 u64 i_time;
Miklos Szeredid8a5ba42005-09-09 13:10:26 -070066};
67
Miklos Szeredib6aeade2005-09-09 13:10:30 -070068/** FUSE specific file data */
69struct fuse_file {
70 /** Request reserved for flush and release */
Miklos Szeredi33649c92006-06-25 05:48:52 -070071 struct fuse_req *reserved_req;
Miklos Szeredib6aeade2005-09-09 13:10:30 -070072
73 /** File handle used by userspace */
74 u64 fh;
Miklos Szeredic756e0a2007-10-16 23:31:00 -070075
76 /** Refcount */
77 atomic_t count;
Miklos Szeredib6aeade2005-09-09 13:10:30 -070078};
79
Miklos Szeredi334f4852005-09-09 13:10:27 -070080/** One input argument of a request */
81struct fuse_in_arg {
82 unsigned size;
83 const void *value;
84};
85
86/** The request input */
87struct fuse_in {
88 /** The request header */
89 struct fuse_in_header h;
90
91 /** True if the data for the last argument is in req->pages */
92 unsigned argpages:1;
93
94 /** Number of arguments */
95 unsigned numargs;
96
97 /** Array of arguments */
98 struct fuse_in_arg args[3];
99};
100
101/** One output argument of a request */
102struct fuse_arg {
103 unsigned size;
104 void *value;
105};
106
107/** The request output */
108struct fuse_out {
109 /** Header returned from userspace */
110 struct fuse_out_header h;
111
Miklos Szeredi095da6c2006-01-16 22:14:52 -0800112 /*
113 * The following bitfields are not changed during the request
114 * processing
115 */
116
Miklos Szeredi334f4852005-09-09 13:10:27 -0700117 /** Last argument is variable length (can be shorter than
118 arg->size) */
119 unsigned argvar:1;
120
121 /** Last argument is a list of pages to copy data to */
122 unsigned argpages:1;
123
124 /** Zero partially or not copied pages */
125 unsigned page_zeroing:1;
126
127 /** Number or arguments */
128 unsigned numargs;
129
130 /** Array of arguments */
131 struct fuse_arg args[3];
132};
133
Miklos Szeredi83cfd492006-01-16 22:14:31 -0800134/** The request state */
135enum fuse_req_state {
136 FUSE_REQ_INIT = 0,
137 FUSE_REQ_PENDING,
138 FUSE_REQ_READING,
139 FUSE_REQ_SENT,
Miklos Szeredia4d27e72006-06-25 05:48:54 -0700140 FUSE_REQ_WRITING,
Miklos Szeredi83cfd492006-01-16 22:14:31 -0800141 FUSE_REQ_FINISHED
142};
143
Miklos Szeredi64c6d8e2006-01-16 22:14:42 -0800144struct fuse_conn;
145
Miklos Szeredi334f4852005-09-09 13:10:27 -0700146/**
147 * A request to the client
148 */
149struct fuse_req {
Miklos Szeredice1d5a42006-04-10 22:54:58 -0700150 /** This can be on either pending processing or io lists in
151 fuse_conn */
Miklos Szeredi334f4852005-09-09 13:10:27 -0700152 struct list_head list;
153
Miklos Szeredia4d27e72006-06-25 05:48:54 -0700154 /** Entry on the interrupts list */
155 struct list_head intr_entry;
156
Miklos Szeredi334f4852005-09-09 13:10:27 -0700157 /** refcount */
158 atomic_t count;
159
Miklos Szeredia4d27e72006-06-25 05:48:54 -0700160 /** Unique ID for the interrupt request */
161 u64 intr_unique;
162
Miklos Szeredi095da6c2006-01-16 22:14:52 -0800163 /*
164 * The following bitfields are either set once before the
165 * request is queued or setting/clearing them is protected by
Miklos Szeredid7133112006-04-10 22:54:55 -0700166 * fuse_conn->lock
Miklos Szeredi095da6c2006-01-16 22:14:52 -0800167 */
168
Miklos Szeredi334f4852005-09-09 13:10:27 -0700169 /** True if the request has reply */
170 unsigned isreply:1;
171
Miklos Szeredi51eb01e2006-06-25 05:48:50 -0700172 /** Force sending of the request even if interrupted */
173 unsigned force:1;
174
Miklos Szeredif9a28422006-06-25 05:48:53 -0700175 /** The request was aborted */
176 unsigned aborted:1;
Miklos Szeredi334f4852005-09-09 13:10:27 -0700177
178 /** Request is sent in the background */
179 unsigned background:1;
180
Miklos Szeredia4d27e72006-06-25 05:48:54 -0700181 /** The request has been interrupted */
182 unsigned interrupted:1;
183
Miklos Szeredi334f4852005-09-09 13:10:27 -0700184 /** Data is being copied to/from the request */
185 unsigned locked:1;
186
Miklos Szeredi9bc5ddd2006-04-11 21:16:09 +0200187 /** Request is counted as "waiting" */
188 unsigned waiting:1;
189
Miklos Szeredi83cfd492006-01-16 22:14:31 -0800190 /** State of the request */
191 enum fuse_req_state state;
Miklos Szeredi334f4852005-09-09 13:10:27 -0700192
193 /** The request input */
194 struct fuse_in in;
195
196 /** The request output */
197 struct fuse_out out;
198
199 /** Used to wake up the task waiting for completion of request*/
200 wait_queue_head_t waitq;
201
202 /** Data for asynchronous requests */
203 union {
Miklos Szeredie5e55582005-09-09 13:10:28 -0700204 struct fuse_forget_in forget_in;
Miklos Szeredib6aeade2005-09-09 13:10:30 -0700205 struct fuse_release_in release_in;
Miklos Szeredi3ec870d2006-01-06 00:19:41 -0800206 struct fuse_init_in init_in;
207 struct fuse_init_out init_out;
Miklos Szeredi361b1eb52006-01-16 22:14:45 -0800208 struct fuse_read_in read_in;
Miklos Szeredi71421252006-06-25 05:48:52 -0700209 struct fuse_lk_in lk_in;
Miklos Szeredi334f4852005-09-09 13:10:27 -0700210 } misc;
211
212 /** page vector */
213 struct page *pages[FUSE_MAX_PAGES_PER_REQ];
214
215 /** number of pages in vector */
216 unsigned num_pages;
217
218 /** offset of data on first page */
219 unsigned page_offset;
220
Miklos Szeredi334f4852005-09-09 13:10:27 -0700221 /** File used in the request (or NULL) */
Miklos Szeredic756e0a2007-10-16 23:31:00 -0700222 struct fuse_file *ff;
Miklos Szeredi64c6d8e2006-01-16 22:14:42 -0800223
Miklos Szeredi51eb01e2006-06-25 05:48:50 -0700224 /** vfsmount used in release */
225 struct vfsmount *vfsmount;
226
227 /** dentry used in release */
228 struct dentry *dentry;
229
Miklos Szeredi64c6d8e2006-01-16 22:14:42 -0800230 /** Request completion callback */
231 void (*end)(struct fuse_conn *, struct fuse_req *);
Miklos Szeredi33649c92006-06-25 05:48:52 -0700232
233 /** Request is stolen from fuse_file->reserved_req */
234 struct file *stolen_file;
Miklos Szeredi334f4852005-09-09 13:10:27 -0700235};
236
Miklos Szeredid8a5ba42005-09-09 13:10:26 -0700237/**
238 * A Fuse connection.
239 *
240 * This structure is created, when the filesystem is mounted, and is
241 * destroyed, when the client device is closed and the filesystem is
242 * unmounted.
243 */
244struct fuse_conn {
Miklos Szeredid7133112006-04-10 22:54:55 -0700245 /** Lock protecting accessess to members of this structure */
246 spinlock_t lock;
247
Miklos Szeredid2a85162006-10-17 00:10:11 -0700248 /** Mutex protecting against directory alias creation */
249 struct mutex inst_mutex;
250
Miklos Szeredibafa9652006-06-25 05:48:51 -0700251 /** Refcount */
252 atomic_t count;
253
Miklos Szeredid8a5ba42005-09-09 13:10:26 -0700254 /** The user id for this mount */
255 uid_t user_id;
256
Miklos Szeredi87729a52005-09-09 13:10:34 -0700257 /** The group id for this mount */
258 gid_t group_id;
259
Miklos Szeredi1e9a4ed2005-09-09 13:10:31 -0700260 /** The fuse mount flags for this mount */
261 unsigned flags;
262
Miklos Szeredidb50b962005-09-09 13:10:33 -0700263 /** Maximum read size */
264 unsigned max_read;
265
Miklos Szeredi413ef8c2005-09-09 13:10:35 -0700266 /** Maximum write size */
267 unsigned max_write;
268
Miklos Szeredi334f4852005-09-09 13:10:27 -0700269 /** Readers of the connection are waiting on this */
270 wait_queue_head_t waitq;
271
272 /** The list of pending requests */
273 struct list_head pending;
274
275 /** The list of requests being processed */
276 struct list_head processing;
277
Miklos Szeredid77a1d52006-01-16 22:14:31 -0800278 /** The list of requests under I/O */
279 struct list_head io;
280
Miklos Szeredi08a53cd2006-04-10 22:54:59 -0700281 /** Number of requests currently in the background */
282 unsigned num_background;
283
Miklos Szeredia4d27e72006-06-25 05:48:54 -0700284 /** Pending interrupts */
285 struct list_head interrupts;
286
Miklos Szeredi08a53cd2006-04-10 22:54:59 -0700287 /** Flag indicating if connection is blocked. This will be
288 the case before the INIT reply is received, and if there
289 are too many outstading backgrounds requests */
290 int blocked;
291
292 /** waitq for blocked connection */
293 wait_queue_head_t blocked_waitq;
294
Miklos Szeredide5e3de2007-10-16 23:31:00 -0700295 /** waitq for reserved requests */
296 wait_queue_head_t reserved_req_waitq;
297
Miklos Szeredi334f4852005-09-09 13:10:27 -0700298 /** The next unique request id */
299 u64 reqctr;
300
Miklos Szeredi69a53bf2006-01-16 22:14:41 -0800301 /** Connection established, cleared on umount, connection
302 abort and device release */
Miklos Szeredi095da6c2006-01-16 22:14:52 -0800303 unsigned connected;
Miklos Szeredi1e9a4ed2005-09-09 13:10:31 -0700304
Miklos Szeredi095da6c2006-01-16 22:14:52 -0800305 /** Connection failed (version mismatch). Cannot race with
306 setting other bitfields since it is only set once in INIT
307 reply, before any other request, and never cleared */
Miklos Szeredi334f4852005-09-09 13:10:27 -0700308 unsigned conn_error : 1;
309
Miklos Szeredi0ec7ca42006-12-06 20:35:52 -0800310 /** Connection successful. Only set in INIT */
311 unsigned conn_init : 1;
312
Miklos Szeredi9cd68452006-02-01 03:04:40 -0800313 /** Do readpages asynchronously? Only set in INIT */
314 unsigned async_read : 1;
315
Miklos Szeredi095da6c2006-01-16 22:14:52 -0800316 /*
317 * The following bitfields are only for optimization purposes
318 * and hence races in setting them will not cause malfunction
319 */
320
Miklos Szeredib6aeade2005-09-09 13:10:30 -0700321 /** Is fsync not implemented by fs? */
322 unsigned no_fsync : 1;
323
Miklos Szeredi82547982005-09-09 13:10:38 -0700324 /** Is fsyncdir not implemented by fs? */
325 unsigned no_fsyncdir : 1;
326
Miklos Szeredib6aeade2005-09-09 13:10:30 -0700327 /** Is flush not implemented by fs? */
328 unsigned no_flush : 1;
329
Miklos Szeredi92a87802005-09-09 13:10:31 -0700330 /** Is setxattr not implemented by fs? */
331 unsigned no_setxattr : 1;
332
333 /** Is getxattr not implemented by fs? */
334 unsigned no_getxattr : 1;
335
336 /** Is listxattr not implemented by fs? */
337 unsigned no_listxattr : 1;
338
339 /** Is removexattr not implemented by fs? */
340 unsigned no_removexattr : 1;
341
Miklos Szeredi71421252006-06-25 05:48:52 -0700342 /** Are file locking primitives not implemented by fs? */
343 unsigned no_lock : 1;
344
Miklos Szeredi31d40d72005-11-07 00:59:50 -0800345 /** Is access not implemented by fs? */
346 unsigned no_access : 1;
347
Miklos Szeredifd72faa2005-11-07 00:59:51 -0800348 /** Is create not implemented by fs? */
349 unsigned no_create : 1;
350
Miklos Szeredia4d27e72006-06-25 05:48:54 -0700351 /** Is interrupt not implemented by fs? */
352 unsigned no_interrupt : 1;
353
Miklos Szeredib2d22722006-12-06 20:35:51 -0800354 /** Is bmap not implemented by fs? */
355 unsigned no_bmap : 1;
356
Miklos Szeredi0cd5b882006-01-16 22:14:38 -0800357 /** The number of requests waiting for completion */
358 atomic_t num_waiting;
359
Miklos Szeredi45714d62006-01-06 00:19:36 -0800360 /** Negotiated minor version */
361 unsigned minor;
362
Miklos Szeredid8a5ba42005-09-09 13:10:26 -0700363 /** Backing dev info */
364 struct backing_dev_info bdi;
Miklos Szeredif543f252006-01-16 22:14:35 -0800365
Miklos Szeredibafa9652006-06-25 05:48:51 -0700366 /** Entry on the fuse_conn_list */
367 struct list_head entry;
368
369 /** Unique ID */
370 u64 id;
371
372 /** Dentries in the control filesystem */
373 struct dentry *ctl_dentry[FUSE_CTL_NUM_DENTRIES];
374
375 /** number of dentries used in the above array */
376 int ctl_ndents;
Jeff Dike385a17b2006-04-10 22:54:52 -0700377
378 /** O_ASYNC requests */
379 struct fasync_struct *fasync;
Miklos Szeredi9c8ef562006-06-25 05:48:55 -0700380
381 /** Key for lock owner ID scrambling */
382 u32 scramble_key[4];
Miklos Szeredi0ec7ca42006-12-06 20:35:52 -0800383
384 /** Reserved request for the DESTROY message */
385 struct fuse_req *destroy_req;
Miklos Szeredid8a5ba42005-09-09 13:10:26 -0700386};
387
Miklos Szeredid8a5ba42005-09-09 13:10:26 -0700388static inline struct fuse_conn *get_fuse_conn_super(struct super_block *sb)
389{
Miklos Szeredi6383bda2006-01-16 22:14:29 -0800390 return sb->s_fs_info;
Miklos Szeredid8a5ba42005-09-09 13:10:26 -0700391}
392
393static inline struct fuse_conn *get_fuse_conn(struct inode *inode)
394{
395 return get_fuse_conn_super(inode->i_sb);
396}
397
398static inline struct fuse_inode *get_fuse_inode(struct inode *inode)
399{
400 return container_of(inode, struct fuse_inode, inode);
401}
402
403static inline u64 get_node_id(struct inode *inode)
404{
405 return get_fuse_inode(inode)->nodeid;
406}
407
Miklos Szeredi334f4852005-09-09 13:10:27 -0700408/** Device operations */
Arjan van de Ven4b6f5d22006-03-28 01:56:42 -0800409extern const struct file_operations fuse_dev_operations;
Miklos Szeredi334f4852005-09-09 13:10:27 -0700410
Miklos Szeredid8a5ba42005-09-09 13:10:26 -0700411/**
Miklos Szeredie5e55582005-09-09 13:10:28 -0700412 * Get a filled in inode
413 */
414struct inode *fuse_iget(struct super_block *sb, unsigned long nodeid,
Miklos Szeredi9e6268d2005-09-09 13:10:29 -0700415 int generation, struct fuse_attr *attr);
Miklos Szeredie5e55582005-09-09 13:10:28 -0700416
417/**
418 * Send FORGET command
419 */
420void fuse_send_forget(struct fuse_conn *fc, struct fuse_req *req,
Miklos Szeredi9e6268d2005-09-09 13:10:29 -0700421 unsigned long nodeid, u64 nlookup);
Miklos Szeredie5e55582005-09-09 13:10:28 -0700422
423/**
Miklos Szeredi361b1eb52006-01-16 22:14:45 -0800424 * Initialize READ or READDIR request
Miklos Szeredi04730fe2005-09-09 13:10:36 -0700425 */
Miklos Szeredic756e0a2007-10-16 23:31:00 -0700426void fuse_read_fill(struct fuse_req *req, struct fuse_file *ff,
Miklos Szeredi361b1eb52006-01-16 22:14:45 -0800427 struct inode *inode, loff_t pos, size_t count, int opcode);
Miklos Szeredi04730fe2005-09-09 13:10:36 -0700428
429/**
430 * Send OPEN or OPENDIR request
431 */
432int fuse_open_common(struct inode *inode, struct file *file, int isdir);
433
Miklos Szeredifd72faa2005-11-07 00:59:51 -0800434struct fuse_file *fuse_file_alloc(void);
435void fuse_file_free(struct fuse_file *ff);
436void fuse_finish_open(struct inode *inode, struct file *file,
437 struct fuse_file *ff, struct fuse_open_out *outarg);
438
Miklos Szeredic756e0a2007-10-16 23:31:00 -0700439/** Fill in ff->reserved_req with a RELEASE request */
440void fuse_release_fill(struct fuse_file *ff, u64 nodeid, int flags, int opcode);
441
Miklos Szeredi04730fe2005-09-09 13:10:36 -0700442/**
443 * Send RELEASE or RELEASEDIR request
444 */
445int fuse_release_common(struct inode *inode, struct file *file, int isdir);
446
447/**
Miklos Szeredi82547982005-09-09 13:10:38 -0700448 * Send FSYNC or FSYNCDIR request
449 */
450int fuse_fsync_common(struct file *file, struct dentry *de, int datasync,
451 int isdir);
452
453/**
Miklos Szeredi17793812005-10-30 15:02:51 -0800454 * Initialize file operations on a regular file
Miklos Szeredib6aeade2005-09-09 13:10:30 -0700455 */
456void fuse_init_file_inode(struct inode *inode);
457
458/**
Miklos Szeredi17793812005-10-30 15:02:51 -0800459 * Initialize inode operations on regular files and special files
Miklos Szeredie5e55582005-09-09 13:10:28 -0700460 */
461void fuse_init_common(struct inode *inode);
462
463/**
Miklos Szeredi17793812005-10-30 15:02:51 -0800464 * Initialize inode and file operations on a directory
Miklos Szeredie5e55582005-09-09 13:10:28 -0700465 */
466void fuse_init_dir(struct inode *inode);
467
468/**
Miklos Szeredi17793812005-10-30 15:02:51 -0800469 * Initialize inode operations on a symlink
Miklos Szeredie5e55582005-09-09 13:10:28 -0700470 */
471void fuse_init_symlink(struct inode *inode);
472
473/**
474 * Change attributes of an inode
475 */
476void fuse_change_attributes(struct inode *inode, struct fuse_attr *attr);
477
478/**
Miklos Szeredi334f4852005-09-09 13:10:27 -0700479 * Initialize the client device
480 */
481int fuse_dev_init(void);
482
483/**
484 * Cleanup the client device
485 */
486void fuse_dev_cleanup(void);
487
Miklos Szeredibafa9652006-06-25 05:48:51 -0700488int fuse_ctl_init(void);
489void fuse_ctl_cleanup(void);
490
Miklos Szeredi334f4852005-09-09 13:10:27 -0700491/**
492 * Allocate a request
493 */
494struct fuse_req *fuse_request_alloc(void);
495
496/**
497 * Free a request
498 */
499void fuse_request_free(struct fuse_req *req);
500
501/**
Miklos Szeredi33649c92006-06-25 05:48:52 -0700502 * Get a request, may fail with -ENOMEM
Miklos Szeredi334f4852005-09-09 13:10:27 -0700503 */
Miklos Szeredice1d5a42006-04-10 22:54:58 -0700504struct fuse_req *fuse_get_req(struct fuse_conn *fc);
Miklos Szeredi334f4852005-09-09 13:10:27 -0700505
506/**
Miklos Szeredi33649c92006-06-25 05:48:52 -0700507 * Gets a requests for a file operation, always succeeds
508 */
509struct fuse_req *fuse_get_req_nofail(struct fuse_conn *fc, struct file *file);
510
511/**
Miklos Szeredice1d5a42006-04-10 22:54:58 -0700512 * Decrement reference count of a request. If count goes to zero free
513 * the request.
Miklos Szeredi334f4852005-09-09 13:10:27 -0700514 */
515void fuse_put_request(struct fuse_conn *fc, struct fuse_req *req);
516
517/**
Miklos Szeredi7c352bd2005-09-09 13:10:39 -0700518 * Send a request (synchronous)
Miklos Szeredi334f4852005-09-09 13:10:27 -0700519 */
520void request_send(struct fuse_conn *fc, struct fuse_req *req);
521
522/**
Miklos Szeredi334f4852005-09-09 13:10:27 -0700523 * Send a request with no reply
524 */
525void request_send_noreply(struct fuse_conn *fc, struct fuse_req *req);
526
527/**
528 * Send a request in the background
529 */
530void request_send_background(struct fuse_conn *fc, struct fuse_req *req);
531
Miklos Szeredi5a5fb1e2006-04-26 10:48:55 +0200532/* Abort all requests */
Miklos Szeredi69a53bf2006-01-16 22:14:41 -0800533void fuse_abort_conn(struct fuse_conn *fc);
534
Miklos Szeredi1e9a4ed2005-09-09 13:10:31 -0700535/**
Miklos Szeredie5e55582005-09-09 13:10:28 -0700536 * Get the attributes of a file
537 */
538int fuse_do_getattr(struct inode *inode);
539
540/**
541 * Invalidate inode attributes
542 */
543void fuse_invalidate_attr(struct inode *inode);
Miklos Szeredibafa9652006-06-25 05:48:51 -0700544
545/**
546 * Acquire reference to fuse_conn
547 */
548struct fuse_conn *fuse_conn_get(struct fuse_conn *fc);
549
550/**
551 * Release reference to fuse_conn
552 */
553void fuse_conn_put(struct fuse_conn *fc);
554
555/**
556 * Add connection to control filesystem
557 */
558int fuse_ctl_add_conn(struct fuse_conn *fc);
559
560/**
561 * Remove connection from control filesystem
562 */
563void fuse_ctl_remove_conn(struct fuse_conn *fc);
Timo Savolaa5bfffac2007-04-08 16:04:00 -0700564
565/**
566 * Is file type valid?
567 */
568int fuse_valid_type(int m);