blob: 95bcb433d1b449bbf369d071995ccecd6ff47850 [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;
75};
76
Miklos Szeredi334f4852005-09-09 13:10:27 -070077/** One input argument of a request */
78struct fuse_in_arg {
79 unsigned size;
80 const void *value;
81};
82
83/** The request input */
84struct fuse_in {
85 /** The request header */
86 struct fuse_in_header h;
87
88 /** True if the data for the last argument is in req->pages */
89 unsigned argpages:1;
90
91 /** Number of arguments */
92 unsigned numargs;
93
94 /** Array of arguments */
95 struct fuse_in_arg args[3];
96};
97
98/** One output argument of a request */
99struct fuse_arg {
100 unsigned size;
101 void *value;
102};
103
104/** The request output */
105struct fuse_out {
106 /** Header returned from userspace */
107 struct fuse_out_header h;
108
Miklos Szeredi095da6c2006-01-16 22:14:52 -0800109 /*
110 * The following bitfields are not changed during the request
111 * processing
112 */
113
Miklos Szeredi334f4852005-09-09 13:10:27 -0700114 /** Last argument is variable length (can be shorter than
115 arg->size) */
116 unsigned argvar:1;
117
118 /** Last argument is a list of pages to copy data to */
119 unsigned argpages:1;
120
121 /** Zero partially or not copied pages */
122 unsigned page_zeroing:1;
123
124 /** Number or arguments */
125 unsigned numargs;
126
127 /** Array of arguments */
128 struct fuse_arg args[3];
129};
130
Miklos Szeredi83cfd492006-01-16 22:14:31 -0800131/** The request state */
132enum fuse_req_state {
133 FUSE_REQ_INIT = 0,
134 FUSE_REQ_PENDING,
135 FUSE_REQ_READING,
136 FUSE_REQ_SENT,
Miklos Szeredia4d27e72006-06-25 05:48:54 -0700137 FUSE_REQ_WRITING,
Miklos Szeredi83cfd492006-01-16 22:14:31 -0800138 FUSE_REQ_FINISHED
139};
140
Miklos Szeredi64c6d8e2006-01-16 22:14:42 -0800141struct fuse_conn;
142
Miklos Szeredi334f4852005-09-09 13:10:27 -0700143/**
144 * A request to the client
145 */
146struct fuse_req {
Miklos Szeredice1d5a42006-04-10 22:54:58 -0700147 /** This can be on either pending processing or io lists in
148 fuse_conn */
Miklos Szeredi334f4852005-09-09 13:10:27 -0700149 struct list_head list;
150
Miklos Szeredia4d27e72006-06-25 05:48:54 -0700151 /** Entry on the interrupts list */
152 struct list_head intr_entry;
153
Miklos Szeredi334f4852005-09-09 13:10:27 -0700154 /** refcount */
155 atomic_t count;
156
Miklos Szeredia4d27e72006-06-25 05:48:54 -0700157 /** Unique ID for the interrupt request */
158 u64 intr_unique;
159
Miklos Szeredi095da6c2006-01-16 22:14:52 -0800160 /*
161 * The following bitfields are either set once before the
162 * request is queued or setting/clearing them is protected by
Miklos Szeredid7133112006-04-10 22:54:55 -0700163 * fuse_conn->lock
Miklos Szeredi095da6c2006-01-16 22:14:52 -0800164 */
165
Miklos Szeredi334f4852005-09-09 13:10:27 -0700166 /** True if the request has reply */
167 unsigned isreply:1;
168
Miklos Szeredi51eb01e2006-06-25 05:48:50 -0700169 /** Force sending of the request even if interrupted */
170 unsigned force:1;
171
Miklos Szeredif9a28422006-06-25 05:48:53 -0700172 /** The request was aborted */
173 unsigned aborted:1;
Miklos Szeredi334f4852005-09-09 13:10:27 -0700174
175 /** Request is sent in the background */
176 unsigned background:1;
177
Miklos Szeredia4d27e72006-06-25 05:48:54 -0700178 /** The request has been interrupted */
179 unsigned interrupted:1;
180
Miklos Szeredi334f4852005-09-09 13:10:27 -0700181 /** Data is being copied to/from the request */
182 unsigned locked:1;
183
Miklos Szeredi9bc5ddd2006-04-11 21:16:09 +0200184 /** Request is counted as "waiting" */
185 unsigned waiting:1;
186
Miklos Szeredi83cfd492006-01-16 22:14:31 -0800187 /** State of the request */
188 enum fuse_req_state state;
Miklos Szeredi334f4852005-09-09 13:10:27 -0700189
190 /** The request input */
191 struct fuse_in in;
192
193 /** The request output */
194 struct fuse_out out;
195
196 /** Used to wake up the task waiting for completion of request*/
197 wait_queue_head_t waitq;
198
199 /** Data for asynchronous requests */
200 union {
Miklos Szeredie5e55582005-09-09 13:10:28 -0700201 struct fuse_forget_in forget_in;
Miklos Szeredib6aeade2005-09-09 13:10:30 -0700202 struct fuse_release_in release_in;
Miklos Szeredi3ec870d2006-01-06 00:19:41 -0800203 struct fuse_init_in init_in;
204 struct fuse_init_out init_out;
Miklos Szeredi361b1eb2006-01-16 22:14:45 -0800205 struct fuse_read_in read_in;
Miklos Szeredi71421252006-06-25 05:48:52 -0700206 struct fuse_lk_in lk_in;
Miklos Szeredi334f4852005-09-09 13:10:27 -0700207 } misc;
208
209 /** page vector */
210 struct page *pages[FUSE_MAX_PAGES_PER_REQ];
211
212 /** number of pages in vector */
213 unsigned num_pages;
214
215 /** offset of data on first page */
216 unsigned page_offset;
217
Miklos Szeredi334f4852005-09-09 13:10:27 -0700218 /** File used in the request (or NULL) */
219 struct file *file;
Miklos Szeredi64c6d8e2006-01-16 22:14:42 -0800220
Miklos Szeredi51eb01e2006-06-25 05:48:50 -0700221 /** vfsmount used in release */
222 struct vfsmount *vfsmount;
223
224 /** dentry used in release */
225 struct dentry *dentry;
226
Miklos Szeredi64c6d8e2006-01-16 22:14:42 -0800227 /** Request completion callback */
228 void (*end)(struct fuse_conn *, struct fuse_req *);
Miklos Szeredi33649c92006-06-25 05:48:52 -0700229
230 /** Request is stolen from fuse_file->reserved_req */
231 struct file *stolen_file;
Miklos Szeredi334f4852005-09-09 13:10:27 -0700232};
233
Miklos Szeredid8a5ba42005-09-09 13:10:26 -0700234/**
235 * A Fuse connection.
236 *
237 * This structure is created, when the filesystem is mounted, and is
238 * destroyed, when the client device is closed and the filesystem is
239 * unmounted.
240 */
241struct fuse_conn {
Miklos Szeredid7133112006-04-10 22:54:55 -0700242 /** Lock protecting accessess to members of this structure */
243 spinlock_t lock;
244
Miklos Szeredid2a85162006-10-17 00:10:11 -0700245 /** Mutex protecting against directory alias creation */
246 struct mutex inst_mutex;
247
Miklos Szeredibafa9652006-06-25 05:48:51 -0700248 /** Refcount */
249 atomic_t count;
250
Miklos Szeredid8a5ba42005-09-09 13:10:26 -0700251 /** The user id for this mount */
252 uid_t user_id;
253
Miklos Szeredi87729a52005-09-09 13:10:34 -0700254 /** The group id for this mount */
255 gid_t group_id;
256
Miklos Szeredi1e9a4ed2005-09-09 13:10:31 -0700257 /** The fuse mount flags for this mount */
258 unsigned flags;
259
Miklos Szeredidb50b962005-09-09 13:10:33 -0700260 /** Maximum read size */
261 unsigned max_read;
262
Miklos Szeredi413ef8c2005-09-09 13:10:35 -0700263 /** Maximum write size */
264 unsigned max_write;
265
Miklos Szeredi334f4852005-09-09 13:10:27 -0700266 /** Readers of the connection are waiting on this */
267 wait_queue_head_t waitq;
268
269 /** The list of pending requests */
270 struct list_head pending;
271
272 /** The list of requests being processed */
273 struct list_head processing;
274
Miklos Szeredid77a1d52006-01-16 22:14:31 -0800275 /** The list of requests under I/O */
276 struct list_head io;
277
Miklos Szeredi08a53cd2006-04-10 22:54:59 -0700278 /** Number of requests currently in the background */
279 unsigned num_background;
280
Miklos Szeredia4d27e72006-06-25 05:48:54 -0700281 /** Pending interrupts */
282 struct list_head interrupts;
283
Miklos Szeredi08a53cd2006-04-10 22:54:59 -0700284 /** Flag indicating if connection is blocked. This will be
285 the case before the INIT reply is received, and if there
286 are too many outstading backgrounds requests */
287 int blocked;
288
289 /** waitq for blocked connection */
290 wait_queue_head_t blocked_waitq;
291
Miklos Szeredide5e3de2007-10-16 23:31:00 -0700292 /** waitq for reserved requests */
293 wait_queue_head_t reserved_req_waitq;
294
Miklos Szeredi334f4852005-09-09 13:10:27 -0700295 /** The next unique request id */
296 u64 reqctr;
297
Miklos Szeredi69a53bf2006-01-16 22:14:41 -0800298 /** Connection established, cleared on umount, connection
299 abort and device release */
Miklos Szeredi095da6c2006-01-16 22:14:52 -0800300 unsigned connected;
Miklos Szeredi1e9a4ed2005-09-09 13:10:31 -0700301
Miklos Szeredi095da6c2006-01-16 22:14:52 -0800302 /** Connection failed (version mismatch). Cannot race with
303 setting other bitfields since it is only set once in INIT
304 reply, before any other request, and never cleared */
Miklos Szeredi334f4852005-09-09 13:10:27 -0700305 unsigned conn_error : 1;
306
Miklos Szeredi0ec7ca42006-12-06 20:35:52 -0800307 /** Connection successful. Only set in INIT */
308 unsigned conn_init : 1;
309
Miklos Szeredi9cd68452006-02-01 03:04:40 -0800310 /** Do readpages asynchronously? Only set in INIT */
311 unsigned async_read : 1;
312
Miklos Szeredi095da6c2006-01-16 22:14:52 -0800313 /*
314 * The following bitfields are only for optimization purposes
315 * and hence races in setting them will not cause malfunction
316 */
317
Miklos Szeredib6aeade2005-09-09 13:10:30 -0700318 /** Is fsync not implemented by fs? */
319 unsigned no_fsync : 1;
320
Miklos Szeredi82547982005-09-09 13:10:38 -0700321 /** Is fsyncdir not implemented by fs? */
322 unsigned no_fsyncdir : 1;
323
Miklos Szeredib6aeade2005-09-09 13:10:30 -0700324 /** Is flush not implemented by fs? */
325 unsigned no_flush : 1;
326
Miklos Szeredi92a87802005-09-09 13:10:31 -0700327 /** Is setxattr not implemented by fs? */
328 unsigned no_setxattr : 1;
329
330 /** Is getxattr not implemented by fs? */
331 unsigned no_getxattr : 1;
332
333 /** Is listxattr not implemented by fs? */
334 unsigned no_listxattr : 1;
335
336 /** Is removexattr not implemented by fs? */
337 unsigned no_removexattr : 1;
338
Miklos Szeredi71421252006-06-25 05:48:52 -0700339 /** Are file locking primitives not implemented by fs? */
340 unsigned no_lock : 1;
341
Miklos Szeredi31d40d72005-11-07 00:59:50 -0800342 /** Is access not implemented by fs? */
343 unsigned no_access : 1;
344
Miklos Szeredifd72faa2005-11-07 00:59:51 -0800345 /** Is create not implemented by fs? */
346 unsigned no_create : 1;
347
Miklos Szeredia4d27e72006-06-25 05:48:54 -0700348 /** Is interrupt not implemented by fs? */
349 unsigned no_interrupt : 1;
350
Miklos Szeredib2d22722006-12-06 20:35:51 -0800351 /** Is bmap not implemented by fs? */
352 unsigned no_bmap : 1;
353
Miklos Szeredi0cd5b882006-01-16 22:14:38 -0800354 /** The number of requests waiting for completion */
355 atomic_t num_waiting;
356
Miklos Szeredi45714d62006-01-06 00:19:36 -0800357 /** Negotiated minor version */
358 unsigned minor;
359
Miklos Szeredid8a5ba42005-09-09 13:10:26 -0700360 /** Backing dev info */
361 struct backing_dev_info bdi;
Miklos Szeredif543f252006-01-16 22:14:35 -0800362
Miklos Szeredibafa9652006-06-25 05:48:51 -0700363 /** Entry on the fuse_conn_list */
364 struct list_head entry;
365
366 /** Unique ID */
367 u64 id;
368
369 /** Dentries in the control filesystem */
370 struct dentry *ctl_dentry[FUSE_CTL_NUM_DENTRIES];
371
372 /** number of dentries used in the above array */
373 int ctl_ndents;
Jeff Dike385a17b2006-04-10 22:54:52 -0700374
375 /** O_ASYNC requests */
376 struct fasync_struct *fasync;
Miklos Szeredi9c8ef562006-06-25 05:48:55 -0700377
378 /** Key for lock owner ID scrambling */
379 u32 scramble_key[4];
Miklos Szeredi0ec7ca42006-12-06 20:35:52 -0800380
381 /** Reserved request for the DESTROY message */
382 struct fuse_req *destroy_req;
Miklos Szeredid8a5ba42005-09-09 13:10:26 -0700383};
384
Miklos Szeredid8a5ba42005-09-09 13:10:26 -0700385static inline struct fuse_conn *get_fuse_conn_super(struct super_block *sb)
386{
Miklos Szeredi6383bda2006-01-16 22:14:29 -0800387 return sb->s_fs_info;
Miklos Szeredid8a5ba42005-09-09 13:10:26 -0700388}
389
390static inline struct fuse_conn *get_fuse_conn(struct inode *inode)
391{
392 return get_fuse_conn_super(inode->i_sb);
393}
394
395static inline struct fuse_inode *get_fuse_inode(struct inode *inode)
396{
397 return container_of(inode, struct fuse_inode, inode);
398}
399
400static inline u64 get_node_id(struct inode *inode)
401{
402 return get_fuse_inode(inode)->nodeid;
403}
404
Miklos Szeredi334f4852005-09-09 13:10:27 -0700405/** Device operations */
Arjan van de Ven4b6f5d22006-03-28 01:56:42 -0800406extern const struct file_operations fuse_dev_operations;
Miklos Szeredi334f4852005-09-09 13:10:27 -0700407
Miklos Szeredid8a5ba42005-09-09 13:10:26 -0700408/**
Miklos Szeredie5e55582005-09-09 13:10:28 -0700409 * Get a filled in inode
410 */
411struct inode *fuse_iget(struct super_block *sb, unsigned long nodeid,
Miklos Szeredi9e6268d2005-09-09 13:10:29 -0700412 int generation, struct fuse_attr *attr);
Miklos Szeredie5e55582005-09-09 13:10:28 -0700413
414/**
415 * Send FORGET command
416 */
417void fuse_send_forget(struct fuse_conn *fc, struct fuse_req *req,
Miklos Szeredi9e6268d2005-09-09 13:10:29 -0700418 unsigned long nodeid, u64 nlookup);
Miklos Szeredie5e55582005-09-09 13:10:28 -0700419
420/**
Miklos Szeredi361b1eb2006-01-16 22:14:45 -0800421 * Initialize READ or READDIR request
Miklos Szeredi04730fe2005-09-09 13:10:36 -0700422 */
Miklos Szeredi361b1eb2006-01-16 22:14:45 -0800423void fuse_read_fill(struct fuse_req *req, struct file *file,
424 struct inode *inode, loff_t pos, size_t count, int opcode);
Miklos Szeredi04730fe2005-09-09 13:10:36 -0700425
426/**
427 * Send OPEN or OPENDIR request
428 */
429int fuse_open_common(struct inode *inode, struct file *file, int isdir);
430
Miklos Szeredifd72faa2005-11-07 00:59:51 -0800431struct fuse_file *fuse_file_alloc(void);
432void fuse_file_free(struct fuse_file *ff);
433void fuse_finish_open(struct inode *inode, struct file *file,
434 struct fuse_file *ff, struct fuse_open_out *outarg);
435
Miklos Szeredi51eb01e2006-06-25 05:48:50 -0700436/** */
437struct fuse_req *fuse_release_fill(struct fuse_file *ff, u64 nodeid, int flags,
438 int opcode);
Miklos Szeredi04730fe2005-09-09 13:10:36 -0700439/**
440 * Send RELEASE or RELEASEDIR request
441 */
442int fuse_release_common(struct inode *inode, struct file *file, int isdir);
443
444/**
Miklos Szeredi82547982005-09-09 13:10:38 -0700445 * Send FSYNC or FSYNCDIR request
446 */
447int fuse_fsync_common(struct file *file, struct dentry *de, int datasync,
448 int isdir);
449
450/**
Miklos Szeredi17793812005-10-30 15:02:51 -0800451 * Initialize file operations on a regular file
Miklos Szeredib6aeade2005-09-09 13:10:30 -0700452 */
453void fuse_init_file_inode(struct inode *inode);
454
455/**
Miklos Szeredi17793812005-10-30 15:02:51 -0800456 * Initialize inode operations on regular files and special files
Miklos Szeredie5e55582005-09-09 13:10:28 -0700457 */
458void fuse_init_common(struct inode *inode);
459
460/**
Miklos Szeredi17793812005-10-30 15:02:51 -0800461 * Initialize inode and file operations on a directory
Miklos Szeredie5e55582005-09-09 13:10:28 -0700462 */
463void fuse_init_dir(struct inode *inode);
464
465/**
Miklos Szeredi17793812005-10-30 15:02:51 -0800466 * Initialize inode operations on a symlink
Miklos Szeredie5e55582005-09-09 13:10:28 -0700467 */
468void fuse_init_symlink(struct inode *inode);
469
470/**
471 * Change attributes of an inode
472 */
473void fuse_change_attributes(struct inode *inode, struct fuse_attr *attr);
474
475/**
Miklos Szeredi334f4852005-09-09 13:10:27 -0700476 * Initialize the client device
477 */
478int fuse_dev_init(void);
479
480/**
481 * Cleanup the client device
482 */
483void fuse_dev_cleanup(void);
484
Miklos Szeredibafa9652006-06-25 05:48:51 -0700485int fuse_ctl_init(void);
486void fuse_ctl_cleanup(void);
487
Miklos Szeredi334f4852005-09-09 13:10:27 -0700488/**
489 * Allocate a request
490 */
491struct fuse_req *fuse_request_alloc(void);
492
493/**
494 * Free a request
495 */
496void fuse_request_free(struct fuse_req *req);
497
498/**
Miklos Szeredi33649c92006-06-25 05:48:52 -0700499 * Get a request, may fail with -ENOMEM
Miklos Szeredi334f4852005-09-09 13:10:27 -0700500 */
Miklos Szeredice1d5a42006-04-10 22:54:58 -0700501struct fuse_req *fuse_get_req(struct fuse_conn *fc);
Miklos Szeredi334f4852005-09-09 13:10:27 -0700502
503/**
Miklos Szeredi33649c92006-06-25 05:48:52 -0700504 * Gets a requests for a file operation, always succeeds
505 */
506struct fuse_req *fuse_get_req_nofail(struct fuse_conn *fc, struct file *file);
507
508/**
Miklos Szeredice1d5a42006-04-10 22:54:58 -0700509 * Decrement reference count of a request. If count goes to zero free
510 * the request.
Miklos Szeredi334f4852005-09-09 13:10:27 -0700511 */
512void fuse_put_request(struct fuse_conn *fc, struct fuse_req *req);
513
514/**
Miklos Szeredi7c352bd2005-09-09 13:10:39 -0700515 * Send a request (synchronous)
Miklos Szeredi334f4852005-09-09 13:10:27 -0700516 */
517void request_send(struct fuse_conn *fc, struct fuse_req *req);
518
519/**
Miklos Szeredi334f4852005-09-09 13:10:27 -0700520 * Send a request with no reply
521 */
522void request_send_noreply(struct fuse_conn *fc, struct fuse_req *req);
523
524/**
525 * Send a request in the background
526 */
527void request_send_background(struct fuse_conn *fc, struct fuse_req *req);
528
Miklos Szeredi5a5fb1e2006-04-26 10:48:55 +0200529/* Abort all requests */
Miklos Szeredi69a53bf2006-01-16 22:14:41 -0800530void fuse_abort_conn(struct fuse_conn *fc);
531
Miklos Szeredi1e9a4ed2005-09-09 13:10:31 -0700532/**
Miklos Szeredie5e55582005-09-09 13:10:28 -0700533 * Get the attributes of a file
534 */
535int fuse_do_getattr(struct inode *inode);
536
537/**
538 * Invalidate inode attributes
539 */
540void fuse_invalidate_attr(struct inode *inode);
Miklos Szeredibafa9652006-06-25 05:48:51 -0700541
542/**
543 * Acquire reference to fuse_conn
544 */
545struct fuse_conn *fuse_conn_get(struct fuse_conn *fc);
546
547/**
548 * Release reference to fuse_conn
549 */
550void fuse_conn_put(struct fuse_conn *fc);
551
552/**
553 * Add connection to control filesystem
554 */
555int fuse_ctl_add_conn(struct fuse_conn *fc);
556
557/**
558 * Remove connection from control filesystem
559 */
560void fuse_ctl_remove_conn(struct fuse_conn *fc);
Timo Savolaa5bfffa2007-04-08 16:04:00 -0700561
562/**
563 * Is file type valid?
564 */
565int fuse_valid_type(int m);