Miklos Szeredi | d8a5ba4 | 2005-09-09 13:10:26 -0700 | [diff] [blame] | 1 | /* |
| 2 | FUSE: Filesystem in Userspace |
Miklos Szeredi | 1729a16 | 2008-11-26 12:03:54 +0100 | [diff] [blame] | 3 | Copyright (C) 2001-2008 Miklos Szeredi <miklos@szeredi.hu> |
Miklos Szeredi | d8a5ba4 | 2005-09-09 13:10:26 -0700 | [diff] [blame] | 4 | |
| 5 | This program can be distributed under the terms of the GNU GPL. |
| 6 | See the file COPYING. |
| 7 | */ |
| 8 | |
Tejun Heo | 29d434b | 2008-10-16 16:08:57 +0200 | [diff] [blame] | 9 | #ifndef _FS_FUSE_I_H |
| 10 | #define _FS_FUSE_I_H |
| 11 | |
Miklos Szeredi | d8a5ba4 | 2005-09-09 13:10:26 -0700 | [diff] [blame] | 12 | #include <linux/fuse.h> |
| 13 | #include <linux/fs.h> |
Miklos Szeredi | 51eb01e | 2006-06-25 05:48:50 -0700 | [diff] [blame] | 14 | #include <linux/mount.h> |
Miklos Szeredi | d8a5ba4 | 2005-09-09 13:10:26 -0700 | [diff] [blame] | 15 | #include <linux/wait.h> |
| 16 | #include <linux/list.h> |
| 17 | #include <linux/spinlock.h> |
| 18 | #include <linux/mm.h> |
| 19 | #include <linux/backing-dev.h> |
Miklos Szeredi | bafa965 | 2006-06-25 05:48:51 -0700 | [diff] [blame] | 20 | #include <linux/mutex.h> |
Miklos Szeredi | 3be5a52 | 2008-04-30 00:54:41 -0700 | [diff] [blame] | 21 | #include <linux/rwsem.h> |
Miklos Szeredi | d8a5ba4 | 2005-09-09 13:10:26 -0700 | [diff] [blame] | 22 | |
Miklos Szeredi | 334f485 | 2005-09-09 13:10:27 -0700 | [diff] [blame] | 23 | /** Max number of pages that can be used in a single read request */ |
| 24 | #define FUSE_MAX_PAGES_PER_REQ 32 |
| 25 | |
Miklos Szeredi | 08a53cd | 2006-04-10 22:54:59 -0700 | [diff] [blame] | 26 | /** Maximum number of outstanding background requests */ |
Miklos Szeredi | f92b99b | 2007-10-16 23:30:59 -0700 | [diff] [blame] | 27 | #define FUSE_MAX_BACKGROUND 12 |
| 28 | |
| 29 | /** Congestion starts at 75% of maximum */ |
| 30 | #define FUSE_CONGESTION_THRESHOLD (FUSE_MAX_BACKGROUND * 75 / 100) |
Miklos Szeredi | 08a53cd | 2006-04-10 22:54:59 -0700 | [diff] [blame] | 31 | |
Miklos Szeredi | 3be5a52 | 2008-04-30 00:54:41 -0700 | [diff] [blame] | 32 | /** Bias for fi->writectr, meaning new writepages must not be sent */ |
| 33 | #define FUSE_NOWRITE INT_MIN |
| 34 | |
Miklos Szeredi | 1d3d752 | 2006-01-06 00:19:40 -0800 | [diff] [blame] | 35 | /** It could be as large as PATH_MAX, but would that have any uses? */ |
| 36 | #define FUSE_NAME_MAX 1024 |
| 37 | |
Miklos Szeredi | bafa965 | 2006-06-25 05:48:51 -0700 | [diff] [blame] | 38 | /** Number of dentries for each connection in the control filesystem */ |
| 39 | #define FUSE_CTL_NUM_DENTRIES 3 |
| 40 | |
Miklos Szeredi | 1e9a4ed | 2005-09-09 13:10:31 -0700 | [diff] [blame] | 41 | /** If the FUSE_DEFAULT_PERMISSIONS flag is given, the filesystem |
| 42 | module will check permissions based on the file mode. Otherwise no |
| 43 | permission checking is done in the kernel */ |
| 44 | #define FUSE_DEFAULT_PERMISSIONS (1 << 0) |
| 45 | |
| 46 | /** If the FUSE_ALLOW_OTHER flag is given, then not only the user |
| 47 | doing the mount will be allowed to access the filesystem */ |
| 48 | #define FUSE_ALLOW_OTHER (1 << 1) |
| 49 | |
Miklos Szeredi | bafa965 | 2006-06-25 05:48:51 -0700 | [diff] [blame] | 50 | /** List of active connections */ |
| 51 | extern struct list_head fuse_conn_list; |
| 52 | |
| 53 | /** Global mutex protecting fuse_conn_list and the control filesystem */ |
| 54 | extern struct mutex fuse_mutex; |
Miklos Szeredi | 413ef8c | 2005-09-09 13:10:35 -0700 | [diff] [blame] | 55 | |
Miklos Szeredi | d8a5ba4 | 2005-09-09 13:10:26 -0700 | [diff] [blame] | 56 | /** FUSE inode */ |
| 57 | struct fuse_inode { |
| 58 | /** Inode data */ |
| 59 | struct inode inode; |
| 60 | |
| 61 | /** Unique ID, which identifies the inode between userspace |
| 62 | * and kernel */ |
| 63 | u64 nodeid; |
| 64 | |
Miklos Szeredi | 9e6268d | 2005-09-09 13:10:29 -0700 | [diff] [blame] | 65 | /** Number of lookups on this inode */ |
| 66 | u64 nlookup; |
| 67 | |
Miklos Szeredi | e5e5558 | 2005-09-09 13:10:28 -0700 | [diff] [blame] | 68 | /** The request used for sending the FORGET message */ |
| 69 | struct fuse_req *forget_req; |
| 70 | |
Miklos Szeredi | d8a5ba4 | 2005-09-09 13:10:26 -0700 | [diff] [blame] | 71 | /** Time in jiffies until the file attributes are valid */ |
Miklos Szeredi | 0a0898c | 2006-07-30 03:04:10 -0700 | [diff] [blame] | 72 | u64 i_time; |
Miklos Szeredi | ebc14c4 | 2007-10-16 23:31:03 -0700 | [diff] [blame] | 73 | |
| 74 | /** The sticky bit in inode->i_mode may have been removed, so |
| 75 | preserve the original mode */ |
| 76 | mode_t orig_i_mode; |
Miklos Szeredi | 1fb69e7 | 2007-10-18 03:06:58 -0700 | [diff] [blame] | 77 | |
| 78 | /** Version of last attribute change */ |
| 79 | u64 attr_version; |
Miklos Szeredi | 93a8c3c | 2007-10-18 03:07:03 -0700 | [diff] [blame] | 80 | |
| 81 | /** Files usable in writepage. Protected by fc->lock */ |
| 82 | struct list_head write_files; |
Miklos Szeredi | 3be5a52 | 2008-04-30 00:54:41 -0700 | [diff] [blame] | 83 | |
| 84 | /** Writepages pending on truncate or fsync */ |
| 85 | struct list_head queued_writes; |
| 86 | |
| 87 | /** Number of sent writes, a negative bias (FUSE_NOWRITE) |
| 88 | * means more writes are blocked */ |
| 89 | int writectr; |
| 90 | |
| 91 | /** Waitq for writepage completion */ |
| 92 | wait_queue_head_t page_waitq; |
| 93 | |
| 94 | /** List of writepage requestst (pending or sent) */ |
| 95 | struct list_head writepages; |
Miklos Szeredi | d8a5ba4 | 2005-09-09 13:10:26 -0700 | [diff] [blame] | 96 | }; |
| 97 | |
Miklos Szeredi | b6aeade | 2005-09-09 13:10:30 -0700 | [diff] [blame] | 98 | /** FUSE specific file data */ |
| 99 | struct fuse_file { |
| 100 | /** Request reserved for flush and release */ |
Miklos Szeredi | 33649c9 | 2006-06-25 05:48:52 -0700 | [diff] [blame] | 101 | struct fuse_req *reserved_req; |
Miklos Szeredi | b6aeade | 2005-09-09 13:10:30 -0700 | [diff] [blame] | 102 | |
Tejun Heo | acf9943 | 2008-11-26 12:03:55 +0100 | [diff] [blame^] | 103 | /** Kernel file handle guaranteed to be unique */ |
| 104 | u64 kh; |
| 105 | |
Miklos Szeredi | b6aeade | 2005-09-09 13:10:30 -0700 | [diff] [blame] | 106 | /** File handle used by userspace */ |
| 107 | u64 fh; |
Miklos Szeredi | c756e0a | 2007-10-16 23:31:00 -0700 | [diff] [blame] | 108 | |
| 109 | /** Refcount */ |
| 110 | atomic_t count; |
Miklos Szeredi | 93a8c3c | 2007-10-18 03:07:03 -0700 | [diff] [blame] | 111 | |
| 112 | /** Entry on inode's write_files list */ |
| 113 | struct list_head write_entry; |
Miklos Szeredi | b6aeade | 2005-09-09 13:10:30 -0700 | [diff] [blame] | 114 | }; |
| 115 | |
Miklos Szeredi | 334f485 | 2005-09-09 13:10:27 -0700 | [diff] [blame] | 116 | /** One input argument of a request */ |
| 117 | struct fuse_in_arg { |
| 118 | unsigned size; |
| 119 | const void *value; |
| 120 | }; |
| 121 | |
| 122 | /** The request input */ |
| 123 | struct fuse_in { |
| 124 | /** The request header */ |
| 125 | struct fuse_in_header h; |
| 126 | |
| 127 | /** True if the data for the last argument is in req->pages */ |
| 128 | unsigned argpages:1; |
| 129 | |
| 130 | /** Number of arguments */ |
| 131 | unsigned numargs; |
| 132 | |
| 133 | /** Array of arguments */ |
| 134 | struct fuse_in_arg args[3]; |
| 135 | }; |
| 136 | |
| 137 | /** One output argument of a request */ |
| 138 | struct fuse_arg { |
| 139 | unsigned size; |
| 140 | void *value; |
| 141 | }; |
| 142 | |
| 143 | /** The request output */ |
| 144 | struct fuse_out { |
| 145 | /** Header returned from userspace */ |
| 146 | struct fuse_out_header h; |
| 147 | |
Miklos Szeredi | 095da6c | 2006-01-16 22:14:52 -0800 | [diff] [blame] | 148 | /* |
| 149 | * The following bitfields are not changed during the request |
| 150 | * processing |
| 151 | */ |
| 152 | |
Miklos Szeredi | 334f485 | 2005-09-09 13:10:27 -0700 | [diff] [blame] | 153 | /** Last argument is variable length (can be shorter than |
| 154 | arg->size) */ |
| 155 | unsigned argvar:1; |
| 156 | |
| 157 | /** Last argument is a list of pages to copy data to */ |
| 158 | unsigned argpages:1; |
| 159 | |
| 160 | /** Zero partially or not copied pages */ |
| 161 | unsigned page_zeroing:1; |
| 162 | |
| 163 | /** Number or arguments */ |
| 164 | unsigned numargs; |
| 165 | |
| 166 | /** Array of arguments */ |
| 167 | struct fuse_arg args[3]; |
| 168 | }; |
| 169 | |
Miklos Szeredi | 83cfd49 | 2006-01-16 22:14:31 -0800 | [diff] [blame] | 170 | /** The request state */ |
| 171 | enum fuse_req_state { |
| 172 | FUSE_REQ_INIT = 0, |
| 173 | FUSE_REQ_PENDING, |
| 174 | FUSE_REQ_READING, |
| 175 | FUSE_REQ_SENT, |
Miklos Szeredi | a4d27e7 | 2006-06-25 05:48:54 -0700 | [diff] [blame] | 176 | FUSE_REQ_WRITING, |
Miklos Szeredi | 83cfd49 | 2006-01-16 22:14:31 -0800 | [diff] [blame] | 177 | FUSE_REQ_FINISHED |
| 178 | }; |
| 179 | |
Miklos Szeredi | 64c6d8e | 2006-01-16 22:14:42 -0800 | [diff] [blame] | 180 | struct fuse_conn; |
| 181 | |
Miklos Szeredi | 334f485 | 2005-09-09 13:10:27 -0700 | [diff] [blame] | 182 | /** |
| 183 | * A request to the client |
| 184 | */ |
| 185 | struct fuse_req { |
Miklos Szeredi | ce1d5a4 | 2006-04-10 22:54:58 -0700 | [diff] [blame] | 186 | /** This can be on either pending processing or io lists in |
| 187 | fuse_conn */ |
Miklos Szeredi | 334f485 | 2005-09-09 13:10:27 -0700 | [diff] [blame] | 188 | struct list_head list; |
| 189 | |
Miklos Szeredi | a4d27e7 | 2006-06-25 05:48:54 -0700 | [diff] [blame] | 190 | /** Entry on the interrupts list */ |
| 191 | struct list_head intr_entry; |
| 192 | |
Miklos Szeredi | 334f485 | 2005-09-09 13:10:27 -0700 | [diff] [blame] | 193 | /** refcount */ |
| 194 | atomic_t count; |
| 195 | |
Miklos Szeredi | a4d27e7 | 2006-06-25 05:48:54 -0700 | [diff] [blame] | 196 | /** Unique ID for the interrupt request */ |
| 197 | u64 intr_unique; |
| 198 | |
Miklos Szeredi | 095da6c | 2006-01-16 22:14:52 -0800 | [diff] [blame] | 199 | /* |
| 200 | * The following bitfields are either set once before the |
| 201 | * request is queued or setting/clearing them is protected by |
Miklos Szeredi | d713311 | 2006-04-10 22:54:55 -0700 | [diff] [blame] | 202 | * fuse_conn->lock |
Miklos Szeredi | 095da6c | 2006-01-16 22:14:52 -0800 | [diff] [blame] | 203 | */ |
| 204 | |
Miklos Szeredi | 334f485 | 2005-09-09 13:10:27 -0700 | [diff] [blame] | 205 | /** True if the request has reply */ |
| 206 | unsigned isreply:1; |
| 207 | |
Miklos Szeredi | 51eb01e | 2006-06-25 05:48:50 -0700 | [diff] [blame] | 208 | /** Force sending of the request even if interrupted */ |
| 209 | unsigned force:1; |
| 210 | |
Miklos Szeredi | f9a2842 | 2006-06-25 05:48:53 -0700 | [diff] [blame] | 211 | /** The request was aborted */ |
| 212 | unsigned aborted:1; |
Miklos Szeredi | 334f485 | 2005-09-09 13:10:27 -0700 | [diff] [blame] | 213 | |
| 214 | /** Request is sent in the background */ |
| 215 | unsigned background:1; |
| 216 | |
Miklos Szeredi | a4d27e7 | 2006-06-25 05:48:54 -0700 | [diff] [blame] | 217 | /** The request has been interrupted */ |
| 218 | unsigned interrupted:1; |
| 219 | |
Miklos Szeredi | 334f485 | 2005-09-09 13:10:27 -0700 | [diff] [blame] | 220 | /** Data is being copied to/from the request */ |
| 221 | unsigned locked:1; |
| 222 | |
Miklos Szeredi | 9bc5ddd | 2006-04-11 21:16:09 +0200 | [diff] [blame] | 223 | /** Request is counted as "waiting" */ |
| 224 | unsigned waiting:1; |
| 225 | |
Miklos Szeredi | 83cfd49 | 2006-01-16 22:14:31 -0800 | [diff] [blame] | 226 | /** State of the request */ |
| 227 | enum fuse_req_state state; |
Miklos Szeredi | 334f485 | 2005-09-09 13:10:27 -0700 | [diff] [blame] | 228 | |
| 229 | /** The request input */ |
| 230 | struct fuse_in in; |
| 231 | |
| 232 | /** The request output */ |
| 233 | struct fuse_out out; |
| 234 | |
| 235 | /** Used to wake up the task waiting for completion of request*/ |
| 236 | wait_queue_head_t waitq; |
| 237 | |
| 238 | /** Data for asynchronous requests */ |
| 239 | union { |
Miklos Szeredi | e5e5558 | 2005-09-09 13:10:28 -0700 | [diff] [blame] | 240 | struct fuse_forget_in forget_in; |
Miklos Szeredi | b57d426 | 2008-02-06 01:38:39 -0800 | [diff] [blame] | 241 | struct { |
| 242 | struct fuse_release_in in; |
| 243 | struct vfsmount *vfsmount; |
| 244 | struct dentry *dentry; |
| 245 | } release; |
Miklos Szeredi | 3ec870d | 2006-01-06 00:19:41 -0800 | [diff] [blame] | 246 | struct fuse_init_in init_in; |
| 247 | struct fuse_init_out init_out; |
Miklos Szeredi | 5c5c5e5 | 2008-04-30 00:54:43 -0700 | [diff] [blame] | 248 | struct { |
| 249 | struct fuse_read_in in; |
| 250 | u64 attr_ver; |
| 251 | } read; |
Miklos Szeredi | b25e82e | 2007-10-18 03:07:03 -0700 | [diff] [blame] | 252 | struct { |
| 253 | struct fuse_write_in in; |
| 254 | struct fuse_write_out out; |
| 255 | } write; |
Miklos Szeredi | 7142125 | 2006-06-25 05:48:52 -0700 | [diff] [blame] | 256 | struct fuse_lk_in lk_in; |
Miklos Szeredi | 334f485 | 2005-09-09 13:10:27 -0700 | [diff] [blame] | 257 | } misc; |
| 258 | |
| 259 | /** page vector */ |
| 260 | struct page *pages[FUSE_MAX_PAGES_PER_REQ]; |
| 261 | |
| 262 | /** number of pages in vector */ |
| 263 | unsigned num_pages; |
| 264 | |
| 265 | /** offset of data on first page */ |
| 266 | unsigned page_offset; |
| 267 | |
Miklos Szeredi | 334f485 | 2005-09-09 13:10:27 -0700 | [diff] [blame] | 268 | /** File used in the request (or NULL) */ |
Miklos Szeredi | c756e0a | 2007-10-16 23:31:00 -0700 | [diff] [blame] | 269 | struct fuse_file *ff; |
Miklos Szeredi | 64c6d8e | 2006-01-16 22:14:42 -0800 | [diff] [blame] | 270 | |
Miklos Szeredi | 3be5a52 | 2008-04-30 00:54:41 -0700 | [diff] [blame] | 271 | /** Inode used in the request or NULL */ |
| 272 | struct inode *inode; |
| 273 | |
| 274 | /** Link on fi->writepages */ |
| 275 | struct list_head writepages_entry; |
| 276 | |
Miklos Szeredi | 64c6d8e | 2006-01-16 22:14:42 -0800 | [diff] [blame] | 277 | /** Request completion callback */ |
| 278 | void (*end)(struct fuse_conn *, struct fuse_req *); |
Miklos Szeredi | 33649c9 | 2006-06-25 05:48:52 -0700 | [diff] [blame] | 279 | |
| 280 | /** Request is stolen from fuse_file->reserved_req */ |
| 281 | struct file *stolen_file; |
Miklos Szeredi | 334f485 | 2005-09-09 13:10:27 -0700 | [diff] [blame] | 282 | }; |
| 283 | |
Miklos Szeredi | d8a5ba4 | 2005-09-09 13:10:26 -0700 | [diff] [blame] | 284 | /** |
| 285 | * A Fuse connection. |
| 286 | * |
| 287 | * This structure is created, when the filesystem is mounted, and is |
| 288 | * destroyed, when the client device is closed and the filesystem is |
| 289 | * unmounted. |
| 290 | */ |
| 291 | struct fuse_conn { |
Miklos Szeredi | d713311 | 2006-04-10 22:54:55 -0700 | [diff] [blame] | 292 | /** Lock protecting accessess to members of this structure */ |
| 293 | spinlock_t lock; |
| 294 | |
Miklos Szeredi | d2a8516 | 2006-10-17 00:10:11 -0700 | [diff] [blame] | 295 | /** Mutex protecting against directory alias creation */ |
| 296 | struct mutex inst_mutex; |
| 297 | |
Miklos Szeredi | bafa965 | 2006-06-25 05:48:51 -0700 | [diff] [blame] | 298 | /** Refcount */ |
| 299 | atomic_t count; |
| 300 | |
Miklos Szeredi | d8a5ba4 | 2005-09-09 13:10:26 -0700 | [diff] [blame] | 301 | /** The user id for this mount */ |
| 302 | uid_t user_id; |
| 303 | |
Miklos Szeredi | 87729a5 | 2005-09-09 13:10:34 -0700 | [diff] [blame] | 304 | /** The group id for this mount */ |
| 305 | gid_t group_id; |
| 306 | |
Miklos Szeredi | 1e9a4ed | 2005-09-09 13:10:31 -0700 | [diff] [blame] | 307 | /** The fuse mount flags for this mount */ |
| 308 | unsigned flags; |
| 309 | |
Miklos Szeredi | db50b96 | 2005-09-09 13:10:33 -0700 | [diff] [blame] | 310 | /** Maximum read size */ |
| 311 | unsigned max_read; |
| 312 | |
Miklos Szeredi | 413ef8c | 2005-09-09 13:10:35 -0700 | [diff] [blame] | 313 | /** Maximum write size */ |
| 314 | unsigned max_write; |
| 315 | |
Miklos Szeredi | 334f485 | 2005-09-09 13:10:27 -0700 | [diff] [blame] | 316 | /** Readers of the connection are waiting on this */ |
| 317 | wait_queue_head_t waitq; |
| 318 | |
| 319 | /** The list of pending requests */ |
| 320 | struct list_head pending; |
| 321 | |
| 322 | /** The list of requests being processed */ |
| 323 | struct list_head processing; |
| 324 | |
Miklos Szeredi | d77a1d5 | 2006-01-16 22:14:31 -0800 | [diff] [blame] | 325 | /** The list of requests under I/O */ |
| 326 | struct list_head io; |
| 327 | |
Tejun Heo | acf9943 | 2008-11-26 12:03:55 +0100 | [diff] [blame^] | 328 | /** The next unique kernel file handle */ |
| 329 | u64 khctr; |
| 330 | |
Miklos Szeredi | 08a53cd | 2006-04-10 22:54:59 -0700 | [diff] [blame] | 331 | /** Number of requests currently in the background */ |
| 332 | unsigned num_background; |
| 333 | |
Miklos Szeredi | d12def1 | 2008-02-06 01:38:39 -0800 | [diff] [blame] | 334 | /** Number of background requests currently queued for userspace */ |
| 335 | unsigned active_background; |
| 336 | |
| 337 | /** The list of background requests set aside for later queuing */ |
| 338 | struct list_head bg_queue; |
| 339 | |
Miklos Szeredi | a4d27e7 | 2006-06-25 05:48:54 -0700 | [diff] [blame] | 340 | /** Pending interrupts */ |
| 341 | struct list_head interrupts; |
| 342 | |
Miklos Szeredi | 08a53cd | 2006-04-10 22:54:59 -0700 | [diff] [blame] | 343 | /** Flag indicating if connection is blocked. This will be |
| 344 | the case before the INIT reply is received, and if there |
| 345 | are too many outstading backgrounds requests */ |
| 346 | int blocked; |
| 347 | |
| 348 | /** waitq for blocked connection */ |
| 349 | wait_queue_head_t blocked_waitq; |
| 350 | |
Miklos Szeredi | de5e3de | 2007-10-16 23:31:00 -0700 | [diff] [blame] | 351 | /** waitq for reserved requests */ |
| 352 | wait_queue_head_t reserved_req_waitq; |
| 353 | |
Miklos Szeredi | 334f485 | 2005-09-09 13:10:27 -0700 | [diff] [blame] | 354 | /** The next unique request id */ |
| 355 | u64 reqctr; |
| 356 | |
Miklos Szeredi | 69a53bf | 2006-01-16 22:14:41 -0800 | [diff] [blame] | 357 | /** Connection established, cleared on umount, connection |
| 358 | abort and device release */ |
Miklos Szeredi | 095da6c | 2006-01-16 22:14:52 -0800 | [diff] [blame] | 359 | unsigned connected; |
Miklos Szeredi | 1e9a4ed | 2005-09-09 13:10:31 -0700 | [diff] [blame] | 360 | |
Miklos Szeredi | 095da6c | 2006-01-16 22:14:52 -0800 | [diff] [blame] | 361 | /** Connection failed (version mismatch). Cannot race with |
| 362 | setting other bitfields since it is only set once in INIT |
| 363 | reply, before any other request, and never cleared */ |
Miklos Szeredi | 1729a16 | 2008-11-26 12:03:54 +0100 | [diff] [blame] | 364 | unsigned conn_error:1; |
Miklos Szeredi | 334f485 | 2005-09-09 13:10:27 -0700 | [diff] [blame] | 365 | |
Miklos Szeredi | 0ec7ca4 | 2006-12-06 20:35:52 -0800 | [diff] [blame] | 366 | /** Connection successful. Only set in INIT */ |
Miklos Szeredi | 1729a16 | 2008-11-26 12:03:54 +0100 | [diff] [blame] | 367 | unsigned conn_init:1; |
Miklos Szeredi | 0ec7ca4 | 2006-12-06 20:35:52 -0800 | [diff] [blame] | 368 | |
Miklos Szeredi | 9cd6845 | 2006-02-01 03:04:40 -0800 | [diff] [blame] | 369 | /** Do readpages asynchronously? Only set in INIT */ |
Miklos Szeredi | 1729a16 | 2008-11-26 12:03:54 +0100 | [diff] [blame] | 370 | unsigned async_read:1; |
Miklos Szeredi | 9cd6845 | 2006-02-01 03:04:40 -0800 | [diff] [blame] | 371 | |
Miklos Szeredi | 6ff958e | 2007-10-18 03:07:02 -0700 | [diff] [blame] | 372 | /** Do not send separate SETATTR request before open(O_TRUNC) */ |
Miklos Szeredi | 1729a16 | 2008-11-26 12:03:54 +0100 | [diff] [blame] | 373 | unsigned atomic_o_trunc:1; |
Miklos Szeredi | 6ff958e | 2007-10-18 03:07:02 -0700 | [diff] [blame] | 374 | |
Miklos Szeredi | 33670fa | 2008-07-25 01:49:02 -0700 | [diff] [blame] | 375 | /** Filesystem supports NFS exporting. Only set in INIT */ |
Miklos Szeredi | 1729a16 | 2008-11-26 12:03:54 +0100 | [diff] [blame] | 376 | unsigned export_support:1; |
Miklos Szeredi | 33670fa | 2008-07-25 01:49:02 -0700 | [diff] [blame] | 377 | |
Miklos Szeredi | 095da6c | 2006-01-16 22:14:52 -0800 | [diff] [blame] | 378 | /* |
| 379 | * The following bitfields are only for optimization purposes |
| 380 | * and hence races in setting them will not cause malfunction |
| 381 | */ |
| 382 | |
Miklos Szeredi | b6aeade | 2005-09-09 13:10:30 -0700 | [diff] [blame] | 383 | /** Is fsync not implemented by fs? */ |
Miklos Szeredi | 1729a16 | 2008-11-26 12:03:54 +0100 | [diff] [blame] | 384 | unsigned no_fsync:1; |
Miklos Szeredi | b6aeade | 2005-09-09 13:10:30 -0700 | [diff] [blame] | 385 | |
Miklos Szeredi | 8254798 | 2005-09-09 13:10:38 -0700 | [diff] [blame] | 386 | /** Is fsyncdir not implemented by fs? */ |
Miklos Szeredi | 1729a16 | 2008-11-26 12:03:54 +0100 | [diff] [blame] | 387 | unsigned no_fsyncdir:1; |
Miklos Szeredi | 8254798 | 2005-09-09 13:10:38 -0700 | [diff] [blame] | 388 | |
Miklos Szeredi | b6aeade | 2005-09-09 13:10:30 -0700 | [diff] [blame] | 389 | /** Is flush not implemented by fs? */ |
Miklos Szeredi | 1729a16 | 2008-11-26 12:03:54 +0100 | [diff] [blame] | 390 | unsigned no_flush:1; |
Miklos Szeredi | b6aeade | 2005-09-09 13:10:30 -0700 | [diff] [blame] | 391 | |
Miklos Szeredi | 92a8780 | 2005-09-09 13:10:31 -0700 | [diff] [blame] | 392 | /** Is setxattr not implemented by fs? */ |
Miklos Szeredi | 1729a16 | 2008-11-26 12:03:54 +0100 | [diff] [blame] | 393 | unsigned no_setxattr:1; |
Miklos Szeredi | 92a8780 | 2005-09-09 13:10:31 -0700 | [diff] [blame] | 394 | |
| 395 | /** Is getxattr not implemented by fs? */ |
Miklos Szeredi | 1729a16 | 2008-11-26 12:03:54 +0100 | [diff] [blame] | 396 | unsigned no_getxattr:1; |
Miklos Szeredi | 92a8780 | 2005-09-09 13:10:31 -0700 | [diff] [blame] | 397 | |
| 398 | /** Is listxattr not implemented by fs? */ |
Miklos Szeredi | 1729a16 | 2008-11-26 12:03:54 +0100 | [diff] [blame] | 399 | unsigned no_listxattr:1; |
Miklos Szeredi | 92a8780 | 2005-09-09 13:10:31 -0700 | [diff] [blame] | 400 | |
| 401 | /** Is removexattr not implemented by fs? */ |
Miklos Szeredi | 1729a16 | 2008-11-26 12:03:54 +0100 | [diff] [blame] | 402 | unsigned no_removexattr:1; |
Miklos Szeredi | 92a8780 | 2005-09-09 13:10:31 -0700 | [diff] [blame] | 403 | |
Miklos Szeredi | 7142125 | 2006-06-25 05:48:52 -0700 | [diff] [blame] | 404 | /** Are file locking primitives not implemented by fs? */ |
Miklos Szeredi | 1729a16 | 2008-11-26 12:03:54 +0100 | [diff] [blame] | 405 | unsigned no_lock:1; |
Miklos Szeredi | 7142125 | 2006-06-25 05:48:52 -0700 | [diff] [blame] | 406 | |
Miklos Szeredi | 31d40d7 | 2005-11-07 00:59:50 -0800 | [diff] [blame] | 407 | /** Is access not implemented by fs? */ |
Miklos Szeredi | 1729a16 | 2008-11-26 12:03:54 +0100 | [diff] [blame] | 408 | unsigned no_access:1; |
Miklos Szeredi | 31d40d7 | 2005-11-07 00:59:50 -0800 | [diff] [blame] | 409 | |
Miklos Szeredi | fd72faa | 2005-11-07 00:59:51 -0800 | [diff] [blame] | 410 | /** Is create not implemented by fs? */ |
Miklos Szeredi | 1729a16 | 2008-11-26 12:03:54 +0100 | [diff] [blame] | 411 | unsigned no_create:1; |
Miklos Szeredi | fd72faa | 2005-11-07 00:59:51 -0800 | [diff] [blame] | 412 | |
Miklos Szeredi | a4d27e7 | 2006-06-25 05:48:54 -0700 | [diff] [blame] | 413 | /** Is interrupt not implemented by fs? */ |
Miklos Szeredi | 1729a16 | 2008-11-26 12:03:54 +0100 | [diff] [blame] | 414 | unsigned no_interrupt:1; |
Miklos Szeredi | a4d27e7 | 2006-06-25 05:48:54 -0700 | [diff] [blame] | 415 | |
Miklos Szeredi | b2d2272 | 2006-12-06 20:35:51 -0800 | [diff] [blame] | 416 | /** Is bmap not implemented by fs? */ |
Miklos Szeredi | 1729a16 | 2008-11-26 12:03:54 +0100 | [diff] [blame] | 417 | unsigned no_bmap:1; |
Miklos Szeredi | b2d2272 | 2006-12-06 20:35:51 -0800 | [diff] [blame] | 418 | |
Miklos Szeredi | 78bb6cb | 2008-05-12 14:02:32 -0700 | [diff] [blame] | 419 | /** Do multi-page cached writes */ |
Miklos Szeredi | 1729a16 | 2008-11-26 12:03:54 +0100 | [diff] [blame] | 420 | unsigned big_writes:1; |
Miklos Szeredi | 78bb6cb | 2008-05-12 14:02:32 -0700 | [diff] [blame] | 421 | |
Miklos Szeredi | 0cd5b88 | 2006-01-16 22:14:38 -0800 | [diff] [blame] | 422 | /** The number of requests waiting for completion */ |
| 423 | atomic_t num_waiting; |
| 424 | |
Miklos Szeredi | 45714d6 | 2006-01-06 00:19:36 -0800 | [diff] [blame] | 425 | /** Negotiated minor version */ |
| 426 | unsigned minor; |
| 427 | |
Miklos Szeredi | d8a5ba4 | 2005-09-09 13:10:26 -0700 | [diff] [blame] | 428 | /** Backing dev info */ |
| 429 | struct backing_dev_info bdi; |
Miklos Szeredi | f543f25 | 2006-01-16 22:14:35 -0800 | [diff] [blame] | 430 | |
Miklos Szeredi | bafa965 | 2006-06-25 05:48:51 -0700 | [diff] [blame] | 431 | /** Entry on the fuse_conn_list */ |
| 432 | struct list_head entry; |
| 433 | |
Miklos Szeredi | b6f2fcb | 2008-04-30 00:54:34 -0700 | [diff] [blame] | 434 | /** Device ID from super block */ |
| 435 | dev_t dev; |
Miklos Szeredi | bafa965 | 2006-06-25 05:48:51 -0700 | [diff] [blame] | 436 | |
| 437 | /** Dentries in the control filesystem */ |
| 438 | struct dentry *ctl_dentry[FUSE_CTL_NUM_DENTRIES]; |
| 439 | |
| 440 | /** number of dentries used in the above array */ |
| 441 | int ctl_ndents; |
Jeff Dike | 385a17b | 2006-04-10 22:54:52 -0700 | [diff] [blame] | 442 | |
| 443 | /** O_ASYNC requests */ |
| 444 | struct fasync_struct *fasync; |
Miklos Szeredi | 9c8ef56 | 2006-06-25 05:48:55 -0700 | [diff] [blame] | 445 | |
| 446 | /** Key for lock owner ID scrambling */ |
| 447 | u32 scramble_key[4]; |
Miklos Szeredi | 0ec7ca4 | 2006-12-06 20:35:52 -0800 | [diff] [blame] | 448 | |
| 449 | /** Reserved request for the DESTROY message */ |
| 450 | struct fuse_req *destroy_req; |
Miklos Szeredi | 1fb69e7 | 2007-10-18 03:06:58 -0700 | [diff] [blame] | 451 | |
| 452 | /** Version counter for attribute changes */ |
| 453 | u64 attr_version; |
Miklos Szeredi | d8a5ba4 | 2005-09-09 13:10:26 -0700 | [diff] [blame] | 454 | }; |
| 455 | |
Miklos Szeredi | d8a5ba4 | 2005-09-09 13:10:26 -0700 | [diff] [blame] | 456 | static inline struct fuse_conn *get_fuse_conn_super(struct super_block *sb) |
| 457 | { |
Miklos Szeredi | 6383bda | 2006-01-16 22:14:29 -0800 | [diff] [blame] | 458 | return sb->s_fs_info; |
Miklos Szeredi | d8a5ba4 | 2005-09-09 13:10:26 -0700 | [diff] [blame] | 459 | } |
| 460 | |
| 461 | static inline struct fuse_conn *get_fuse_conn(struct inode *inode) |
| 462 | { |
| 463 | return get_fuse_conn_super(inode->i_sb); |
| 464 | } |
| 465 | |
| 466 | static inline struct fuse_inode *get_fuse_inode(struct inode *inode) |
| 467 | { |
| 468 | return container_of(inode, struct fuse_inode, inode); |
| 469 | } |
| 470 | |
| 471 | static inline u64 get_node_id(struct inode *inode) |
| 472 | { |
| 473 | return get_fuse_inode(inode)->nodeid; |
| 474 | } |
| 475 | |
Miklos Szeredi | 334f485 | 2005-09-09 13:10:27 -0700 | [diff] [blame] | 476 | /** Device operations */ |
Arjan van de Ven | 4b6f5d2 | 2006-03-28 01:56:42 -0800 | [diff] [blame] | 477 | extern const struct file_operations fuse_dev_operations; |
Miklos Szeredi | 334f485 | 2005-09-09 13:10:27 -0700 | [diff] [blame] | 478 | |
Miklos Szeredi | dbd561d | 2008-07-25 01:49:00 -0700 | [diff] [blame] | 479 | extern struct dentry_operations fuse_dentry_operations; |
| 480 | |
Miklos Szeredi | d8a5ba4 | 2005-09-09 13:10:26 -0700 | [diff] [blame] | 481 | /** |
Miklos Szeredi | e5e5558 | 2005-09-09 13:10:28 -0700 | [diff] [blame] | 482 | * Get a filled in inode |
| 483 | */ |
Miklos Szeredi | b48badf | 2008-04-30 00:54:44 -0700 | [diff] [blame] | 484 | struct inode *fuse_iget(struct super_block *sb, u64 nodeid, |
Miklos Szeredi | 1fb69e7 | 2007-10-18 03:06:58 -0700 | [diff] [blame] | 485 | int generation, struct fuse_attr *attr, |
| 486 | u64 attr_valid, u64 attr_version); |
Miklos Szeredi | e5e5558 | 2005-09-09 13:10:28 -0700 | [diff] [blame] | 487 | |
Miklos Szeredi | 33670fa | 2008-07-25 01:49:02 -0700 | [diff] [blame] | 488 | int fuse_lookup_name(struct super_block *sb, u64 nodeid, struct qstr *name, |
| 489 | struct fuse_entry_out *outarg, struct inode **inode); |
| 490 | |
Miklos Szeredi | e5e5558 | 2005-09-09 13:10:28 -0700 | [diff] [blame] | 491 | /** |
| 492 | * Send FORGET command |
| 493 | */ |
| 494 | void fuse_send_forget(struct fuse_conn *fc, struct fuse_req *req, |
Miklos Szeredi | b48badf | 2008-04-30 00:54:44 -0700 | [diff] [blame] | 495 | u64 nodeid, u64 nlookup); |
Miklos Szeredi | e5e5558 | 2005-09-09 13:10:28 -0700 | [diff] [blame] | 496 | |
| 497 | /** |
Miklos Szeredi | 361b1eb5 | 2006-01-16 22:14:45 -0800 | [diff] [blame] | 498 | * Initialize READ or READDIR request |
Miklos Szeredi | 04730fe | 2005-09-09 13:10:36 -0700 | [diff] [blame] | 499 | */ |
Miklos Szeredi | a664309 | 2007-11-28 16:22:00 -0800 | [diff] [blame] | 500 | void fuse_read_fill(struct fuse_req *req, struct file *file, |
Miklos Szeredi | 361b1eb5 | 2006-01-16 22:14:45 -0800 | [diff] [blame] | 501 | struct inode *inode, loff_t pos, size_t count, int opcode); |
Miklos Szeredi | 04730fe | 2005-09-09 13:10:36 -0700 | [diff] [blame] | 502 | |
| 503 | /** |
| 504 | * Send OPEN or OPENDIR request |
| 505 | */ |
| 506 | int fuse_open_common(struct inode *inode, struct file *file, int isdir); |
| 507 | |
Tejun Heo | acf9943 | 2008-11-26 12:03:55 +0100 | [diff] [blame^] | 508 | struct fuse_file *fuse_file_alloc(struct fuse_conn *fc); |
Miklos Szeredi | fd72faa | 2005-11-07 00:59:51 -0800 | [diff] [blame] | 509 | void fuse_file_free(struct fuse_file *ff); |
| 510 | void fuse_finish_open(struct inode *inode, struct file *file, |
| 511 | struct fuse_file *ff, struct fuse_open_out *outarg); |
| 512 | |
Miklos Szeredi | c756e0a | 2007-10-16 23:31:00 -0700 | [diff] [blame] | 513 | /** Fill in ff->reserved_req with a RELEASE request */ |
| 514 | void fuse_release_fill(struct fuse_file *ff, u64 nodeid, int flags, int opcode); |
| 515 | |
Miklos Szeredi | 04730fe | 2005-09-09 13:10:36 -0700 | [diff] [blame] | 516 | /** |
| 517 | * Send RELEASE or RELEASEDIR request |
| 518 | */ |
| 519 | int fuse_release_common(struct inode *inode, struct file *file, int isdir); |
| 520 | |
| 521 | /** |
Miklos Szeredi | 8254798 | 2005-09-09 13:10:38 -0700 | [diff] [blame] | 522 | * Send FSYNC or FSYNCDIR request |
| 523 | */ |
| 524 | int fuse_fsync_common(struct file *file, struct dentry *de, int datasync, |
| 525 | int isdir); |
| 526 | |
| 527 | /** |
Miklos Szeredi | 1779381 | 2005-10-30 15:02:51 -0800 | [diff] [blame] | 528 | * Initialize file operations on a regular file |
Miklos Szeredi | b6aeade | 2005-09-09 13:10:30 -0700 | [diff] [blame] | 529 | */ |
| 530 | void fuse_init_file_inode(struct inode *inode); |
| 531 | |
| 532 | /** |
Miklos Szeredi | 1779381 | 2005-10-30 15:02:51 -0800 | [diff] [blame] | 533 | * Initialize inode operations on regular files and special files |
Miklos Szeredi | e5e5558 | 2005-09-09 13:10:28 -0700 | [diff] [blame] | 534 | */ |
| 535 | void fuse_init_common(struct inode *inode); |
| 536 | |
| 537 | /** |
Miklos Szeredi | 1779381 | 2005-10-30 15:02:51 -0800 | [diff] [blame] | 538 | * Initialize inode and file operations on a directory |
Miklos Szeredi | e5e5558 | 2005-09-09 13:10:28 -0700 | [diff] [blame] | 539 | */ |
| 540 | void fuse_init_dir(struct inode *inode); |
| 541 | |
| 542 | /** |
Miklos Szeredi | 1779381 | 2005-10-30 15:02:51 -0800 | [diff] [blame] | 543 | * Initialize inode operations on a symlink |
Miklos Szeredi | e5e5558 | 2005-09-09 13:10:28 -0700 | [diff] [blame] | 544 | */ |
| 545 | void fuse_init_symlink(struct inode *inode); |
| 546 | |
| 547 | /** |
| 548 | * Change attributes of an inode |
| 549 | */ |
Miklos Szeredi | 1fb69e7 | 2007-10-18 03:06:58 -0700 | [diff] [blame] | 550 | void fuse_change_attributes(struct inode *inode, struct fuse_attr *attr, |
| 551 | u64 attr_valid, u64 attr_version); |
Miklos Szeredi | e5e5558 | 2005-09-09 13:10:28 -0700 | [diff] [blame] | 552 | |
Miklos Szeredi | 3be5a52 | 2008-04-30 00:54:41 -0700 | [diff] [blame] | 553 | void fuse_change_attributes_common(struct inode *inode, struct fuse_attr *attr, |
| 554 | u64 attr_valid); |
| 555 | |
| 556 | void fuse_truncate(struct address_space *mapping, loff_t offset); |
| 557 | |
Miklos Szeredi | e5e5558 | 2005-09-09 13:10:28 -0700 | [diff] [blame] | 558 | /** |
Miklos Szeredi | 334f485 | 2005-09-09 13:10:27 -0700 | [diff] [blame] | 559 | * Initialize the client device |
| 560 | */ |
| 561 | int fuse_dev_init(void); |
| 562 | |
| 563 | /** |
| 564 | * Cleanup the client device |
| 565 | */ |
| 566 | void fuse_dev_cleanup(void); |
| 567 | |
Miklos Szeredi | bafa965 | 2006-06-25 05:48:51 -0700 | [diff] [blame] | 568 | int fuse_ctl_init(void); |
| 569 | void fuse_ctl_cleanup(void); |
| 570 | |
Miklos Szeredi | 334f485 | 2005-09-09 13:10:27 -0700 | [diff] [blame] | 571 | /** |
| 572 | * Allocate a request |
| 573 | */ |
| 574 | struct fuse_req *fuse_request_alloc(void); |
| 575 | |
Miklos Szeredi | 3be5a52 | 2008-04-30 00:54:41 -0700 | [diff] [blame] | 576 | struct fuse_req *fuse_request_alloc_nofs(void); |
| 577 | |
Miklos Szeredi | 334f485 | 2005-09-09 13:10:27 -0700 | [diff] [blame] | 578 | /** |
| 579 | * Free a request |
| 580 | */ |
| 581 | void fuse_request_free(struct fuse_req *req); |
| 582 | |
| 583 | /** |
Miklos Szeredi | 33649c9 | 2006-06-25 05:48:52 -0700 | [diff] [blame] | 584 | * Get a request, may fail with -ENOMEM |
Miklos Szeredi | 334f485 | 2005-09-09 13:10:27 -0700 | [diff] [blame] | 585 | */ |
Miklos Szeredi | ce1d5a4 | 2006-04-10 22:54:58 -0700 | [diff] [blame] | 586 | struct fuse_req *fuse_get_req(struct fuse_conn *fc); |
Miklos Szeredi | 334f485 | 2005-09-09 13:10:27 -0700 | [diff] [blame] | 587 | |
| 588 | /** |
Miklos Szeredi | 33649c9 | 2006-06-25 05:48:52 -0700 | [diff] [blame] | 589 | * Gets a requests for a file operation, always succeeds |
| 590 | */ |
| 591 | struct fuse_req *fuse_get_req_nofail(struct fuse_conn *fc, struct file *file); |
| 592 | |
| 593 | /** |
Miklos Szeredi | ce1d5a4 | 2006-04-10 22:54:58 -0700 | [diff] [blame] | 594 | * Decrement reference count of a request. If count goes to zero free |
| 595 | * the request. |
Miklos Szeredi | 334f485 | 2005-09-09 13:10:27 -0700 | [diff] [blame] | 596 | */ |
| 597 | void fuse_put_request(struct fuse_conn *fc, struct fuse_req *req); |
| 598 | |
| 599 | /** |
Miklos Szeredi | 7c352bd | 2005-09-09 13:10:39 -0700 | [diff] [blame] | 600 | * Send a request (synchronous) |
Miklos Szeredi | 334f485 | 2005-09-09 13:10:27 -0700 | [diff] [blame] | 601 | */ |
| 602 | void request_send(struct fuse_conn *fc, struct fuse_req *req); |
| 603 | |
| 604 | /** |
Miklos Szeredi | 334f485 | 2005-09-09 13:10:27 -0700 | [diff] [blame] | 605 | * Send a request with no reply |
| 606 | */ |
| 607 | void request_send_noreply(struct fuse_conn *fc, struct fuse_req *req); |
| 608 | |
| 609 | /** |
| 610 | * Send a request in the background |
| 611 | */ |
| 612 | void request_send_background(struct fuse_conn *fc, struct fuse_req *req); |
| 613 | |
Miklos Szeredi | 3be5a52 | 2008-04-30 00:54:41 -0700 | [diff] [blame] | 614 | void request_send_background_locked(struct fuse_conn *fc, struct fuse_req *req); |
| 615 | |
Miklos Szeredi | 5a5fb1e | 2006-04-26 10:48:55 +0200 | [diff] [blame] | 616 | /* Abort all requests */ |
Miklos Szeredi | 69a53bf | 2006-01-16 22:14:41 -0800 | [diff] [blame] | 617 | void fuse_abort_conn(struct fuse_conn *fc); |
| 618 | |
Miklos Szeredi | 1e9a4ed | 2005-09-09 13:10:31 -0700 | [diff] [blame] | 619 | /** |
Miklos Szeredi | e5e5558 | 2005-09-09 13:10:28 -0700 | [diff] [blame] | 620 | * Invalidate inode attributes |
| 621 | */ |
| 622 | void fuse_invalidate_attr(struct inode *inode); |
Miklos Szeredi | bafa965 | 2006-06-25 05:48:51 -0700 | [diff] [blame] | 623 | |
Miklos Szeredi | dbd561d | 2008-07-25 01:49:00 -0700 | [diff] [blame] | 624 | void fuse_invalidate_entry_cache(struct dentry *entry); |
| 625 | |
Miklos Szeredi | bafa965 | 2006-06-25 05:48:51 -0700 | [diff] [blame] | 626 | /** |
| 627 | * Acquire reference to fuse_conn |
| 628 | */ |
| 629 | struct fuse_conn *fuse_conn_get(struct fuse_conn *fc); |
| 630 | |
| 631 | /** |
| 632 | * Release reference to fuse_conn |
| 633 | */ |
| 634 | void fuse_conn_put(struct fuse_conn *fc); |
| 635 | |
| 636 | /** |
| 637 | * Add connection to control filesystem |
| 638 | */ |
| 639 | int fuse_ctl_add_conn(struct fuse_conn *fc); |
| 640 | |
| 641 | /** |
| 642 | * Remove connection from control filesystem |
| 643 | */ |
| 644 | void fuse_ctl_remove_conn(struct fuse_conn *fc); |
Timo Savola | a5bfffac | 2007-04-08 16:04:00 -0700 | [diff] [blame] | 645 | |
| 646 | /** |
| 647 | * Is file type valid? |
| 648 | */ |
| 649 | int fuse_valid_type(int m); |
Miklos Szeredi | e57ac68 | 2007-10-18 03:06:58 -0700 | [diff] [blame] | 650 | |
| 651 | /** |
| 652 | * Is task allowed to perform filesystem operation? |
| 653 | */ |
| 654 | int fuse_allow_task(struct fuse_conn *fc, struct task_struct *task); |
Miklos Szeredi | f333211 | 2007-10-18 03:07:04 -0700 | [diff] [blame] | 655 | |
| 656 | u64 fuse_lock_owner_id(struct fuse_conn *fc, fl_owner_t id); |
Miklos Szeredi | bcb4be8 | 2007-11-28 16:21:59 -0800 | [diff] [blame] | 657 | |
| 658 | int fuse_update_attributes(struct inode *inode, struct kstat *stat, |
| 659 | struct file *file, bool *refreshed); |
Miklos Szeredi | 3be5a52 | 2008-04-30 00:54:41 -0700 | [diff] [blame] | 660 | |
| 661 | void fuse_flush_writepages(struct inode *inode); |
| 662 | |
| 663 | void fuse_set_nowrite(struct inode *inode); |
| 664 | void fuse_release_nowrite(struct inode *inode); |
Miklos Szeredi | 5c5c5e5 | 2008-04-30 00:54:43 -0700 | [diff] [blame] | 665 | |
| 666 | u64 fuse_get_attr_version(struct fuse_conn *fc); |
Tejun Heo | 29d434b | 2008-10-16 16:08:57 +0200 | [diff] [blame] | 667 | |
| 668 | #endif /* _FS_FUSE_I_H */ |