fuse_i.h 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844
  1. /*
  2. FUSE: Filesystem in Userspace
  3. Copyright (C) 2001-2008 Miklos Szeredi <miklos@szeredi.hu>
  4. This program can be distributed under the terms of the GNU GPL.
  5. See the file COPYING.
  6. */
  7. #ifndef _FS_FUSE_I_H
  8. #define _FS_FUSE_I_H
  9. #include <linux/fuse.h>
  10. #include <linux/fs.h>
  11. #include <linux/mount.h>
  12. #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>
  17. #include <linux/mutex.h>
  18. #include <linux/rwsem.h>
  19. #include <linux/rbtree.h>
  20. #include <linux/poll.h>
  21. #include <linux/workqueue.h>
  22. /** Max number of pages that can be used in a single read request */
  23. #define FUSE_MAX_PAGES_PER_REQ 32
  24. /** Bias for fi->writectr, meaning new writepages must not be sent */
  25. #define FUSE_NOWRITE INT_MIN
  26. /** It could be as large as PATH_MAX, but would that have any uses? */
  27. #define FUSE_NAME_MAX 1024
  28. /** Number of dentries for each connection in the control filesystem */
  29. #define FUSE_CTL_NUM_DENTRIES 5
  30. /** If the FUSE_DEFAULT_PERMISSIONS flag is given, the filesystem
  31. module will check permissions based on the file mode. Otherwise no
  32. permission checking is done in the kernel */
  33. #define FUSE_DEFAULT_PERMISSIONS (1 << 0)
  34. /** If the FUSE_ALLOW_OTHER flag is given, then not only the user
  35. doing the mount will be allowed to access the filesystem */
  36. #define FUSE_ALLOW_OTHER (1 << 1)
  37. /** Number of page pointers embedded in fuse_req */
  38. #define FUSE_REQ_INLINE_PAGES 1
  39. /** List of active connections */
  40. extern struct list_head fuse_conn_list;
  41. /** Global mutex protecting fuse_conn_list and the control filesystem */
  42. extern struct mutex fuse_mutex;
  43. /** Module parameters */
  44. extern unsigned max_user_bgreq;
  45. extern unsigned max_user_congthresh;
  46. /* One forget request */
  47. struct fuse_forget_link {
  48. struct fuse_forget_one forget_one;
  49. struct fuse_forget_link *next;
  50. };
  51. /** FUSE inode */
  52. struct fuse_inode {
  53. /** Inode data */
  54. struct inode inode;
  55. /** Unique ID, which identifies the inode between userspace
  56. * and kernel */
  57. u64 nodeid;
  58. /** Number of lookups on this inode */
  59. u64 nlookup;
  60. /** The request used for sending the FORGET message */
  61. struct fuse_forget_link *forget;
  62. /** Time in jiffies until the file attributes are valid */
  63. u64 i_time;
  64. /** The sticky bit in inode->i_mode may have been removed, so
  65. preserve the original mode */
  66. umode_t orig_i_mode;
  67. /** 64 bit inode number */
  68. u64 orig_ino;
  69. /** Version of last attribute change */
  70. u64 attr_version;
  71. /** Files usable in writepage. Protected by fc->lock */
  72. struct list_head write_files;
  73. /** Writepages pending on truncate or fsync */
  74. struct list_head queued_writes;
  75. /** Number of sent writes, a negative bias (FUSE_NOWRITE)
  76. * means more writes are blocked */
  77. int writectr;
  78. /** Waitq for writepage completion */
  79. wait_queue_head_t page_waitq;
  80. /** List of writepage requestst (pending or sent) */
  81. struct list_head writepages;
  82. /** Miscellaneous bits describing inode state */
  83. unsigned long state;
  84. };
  85. /** FUSE inode state bits */
  86. enum {
  87. /** Advise readdirplus */
  88. FUSE_I_ADVISE_RDPLUS,
  89. };
  90. struct fuse_conn;
  91. /** FUSE specific file data */
  92. struct fuse_file {
  93. /** Fuse connection for this file */
  94. struct fuse_conn *fc;
  95. /** Request reserved for flush and release */
  96. struct fuse_req *reserved_req;
  97. /** Kernel file handle guaranteed to be unique */
  98. u64 kh;
  99. /** File handle used by userspace */
  100. u64 fh;
  101. /** Node id of this file */
  102. u64 nodeid;
  103. /** Refcount */
  104. atomic_t count;
  105. /** FOPEN_* flags returned by open */
  106. u32 open_flags;
  107. /** Entry on inode's write_files list */
  108. struct list_head write_entry;
  109. /** RB node to be linked on fuse_conn->polled_files */
  110. struct rb_node polled_node;
  111. /** Wait queue head for poll */
  112. wait_queue_head_t poll_wait;
  113. /** Has flock been performed on this file? */
  114. bool flock:1;
  115. };
  116. /** One input argument of a request */
  117. struct fuse_in_arg {
  118. unsigned size;
  119. const void *value;
  120. };
  121. /** The request input */
  122. struct fuse_in {
  123. /** The request header */
  124. struct fuse_in_header h;
  125. /** True if the data for the last argument is in req->pages */
  126. unsigned argpages:1;
  127. /** Number of arguments */
  128. unsigned numargs;
  129. /** Array of arguments */
  130. struct fuse_in_arg args[3];
  131. };
  132. /** One output argument of a request */
  133. struct fuse_arg {
  134. unsigned size;
  135. void *value;
  136. };
  137. /** The request output */
  138. struct fuse_out {
  139. /** Header returned from userspace */
  140. struct fuse_out_header h;
  141. /*
  142. * The following bitfields are not changed during the request
  143. * processing
  144. */
  145. /** Last argument is variable length (can be shorter than
  146. arg->size) */
  147. unsigned argvar:1;
  148. /** Last argument is a list of pages to copy data to */
  149. unsigned argpages:1;
  150. /** Zero partially or not copied pages */
  151. unsigned page_zeroing:1;
  152. /** Pages may be replaced with new ones */
  153. unsigned page_replace:1;
  154. /** Number or arguments */
  155. unsigned numargs;
  156. /** Array of arguments */
  157. struct fuse_arg args[3];
  158. };
  159. /** FUSE page descriptor */
  160. struct fuse_page_desc {
  161. unsigned int length;
  162. unsigned int offset;
  163. };
  164. /** The request state */
  165. enum fuse_req_state {
  166. FUSE_REQ_INIT = 0,
  167. FUSE_REQ_PENDING,
  168. FUSE_REQ_READING,
  169. FUSE_REQ_SENT,
  170. FUSE_REQ_WRITING,
  171. FUSE_REQ_FINISHED
  172. };
  173. /**
  174. * A request to the client
  175. */
  176. struct fuse_req {
  177. /** This can be on either pending processing or io lists in
  178. fuse_conn */
  179. struct list_head list;
  180. /** Entry on the interrupts list */
  181. struct list_head intr_entry;
  182. /** refcount */
  183. atomic_t count;
  184. /** Unique ID for the interrupt request */
  185. u64 intr_unique;
  186. /*
  187. * The following bitfields are either set once before the
  188. * request is queued or setting/clearing them is protected by
  189. * fuse_conn->lock
  190. */
  191. /** True if the request has reply */
  192. unsigned isreply:1;
  193. /** Force sending of the request even if interrupted */
  194. unsigned force:1;
  195. /** The request was aborted */
  196. unsigned aborted:1;
  197. /** Request is sent in the background */
  198. unsigned background:1;
  199. /** The request has been interrupted */
  200. unsigned interrupted:1;
  201. /** Data is being copied to/from the request */
  202. unsigned locked:1;
  203. /** Request is counted as "waiting" */
  204. unsigned waiting:1;
  205. /** State of the request */
  206. enum fuse_req_state state;
  207. /** The request input */
  208. struct fuse_in in;
  209. /** The request output */
  210. struct fuse_out out;
  211. /** Used to wake up the task waiting for completion of request*/
  212. wait_queue_head_t waitq;
  213. /** Data for asynchronous requests */
  214. union {
  215. struct {
  216. union {
  217. struct fuse_release_in in;
  218. struct work_struct work;
  219. };
  220. struct path path;
  221. } release;
  222. struct fuse_init_in init_in;
  223. struct fuse_init_out init_out;
  224. struct cuse_init_in cuse_init_in;
  225. struct {
  226. struct fuse_read_in in;
  227. u64 attr_ver;
  228. } read;
  229. struct {
  230. struct fuse_write_in in;
  231. struct fuse_write_out out;
  232. } write;
  233. struct fuse_notify_retrieve_in retrieve_in;
  234. struct fuse_lk_in lk_in;
  235. } misc;
  236. /** page vector */
  237. struct page **pages;
  238. /** page-descriptor vector */
  239. struct fuse_page_desc *page_descs;
  240. /** size of the 'pages' array */
  241. unsigned max_pages;
  242. /** inline page vector */
  243. struct page *inline_pages[FUSE_REQ_INLINE_PAGES];
  244. /** inline page-descriptor vector */
  245. struct fuse_page_desc inline_page_descs[FUSE_REQ_INLINE_PAGES];
  246. /** number of pages in vector */
  247. unsigned num_pages;
  248. /** File used in the request (or NULL) */
  249. struct fuse_file *ff;
  250. /** Inode used in the request or NULL */
  251. struct inode *inode;
  252. /** Link on fi->writepages */
  253. struct list_head writepages_entry;
  254. /** Request completion callback */
  255. void (*end)(struct fuse_conn *, struct fuse_req *);
  256. /** Request is stolen from fuse_file->reserved_req */
  257. struct file *stolen_file;
  258. };
  259. /**
  260. * A Fuse connection.
  261. *
  262. * This structure is created, when the filesystem is mounted, and is
  263. * destroyed, when the client device is closed and the filesystem is
  264. * unmounted.
  265. */
  266. struct fuse_conn {
  267. /** Lock protecting accessess to members of this structure */
  268. spinlock_t lock;
  269. /** Mutex protecting against directory alias creation */
  270. struct mutex inst_mutex;
  271. /** Refcount */
  272. atomic_t count;
  273. /** The user id for this mount */
  274. kuid_t user_id;
  275. /** The group id for this mount */
  276. kgid_t group_id;
  277. /** The fuse mount flags for this mount */
  278. unsigned flags;
  279. /** Maximum read size */
  280. unsigned max_read;
  281. /** Maximum write size */
  282. unsigned max_write;
  283. /** Readers of the connection are waiting on this */
  284. wait_queue_head_t waitq;
  285. /** The list of pending requests */
  286. struct list_head pending;
  287. /** The list of requests being processed */
  288. struct list_head processing;
  289. /** The list of requests under I/O */
  290. struct list_head io;
  291. /** The next unique kernel file handle */
  292. u64 khctr;
  293. /** rbtree of fuse_files waiting for poll events indexed by ph */
  294. struct rb_root polled_files;
  295. /** Maximum number of outstanding background requests */
  296. unsigned max_background;
  297. /** Number of background requests at which congestion starts */
  298. unsigned congestion_threshold;
  299. /** Number of requests currently in the background */
  300. unsigned num_background;
  301. /** Number of background requests currently queued for userspace */
  302. unsigned active_background;
  303. /** The list of background requests set aside for later queuing */
  304. struct list_head bg_queue;
  305. /** Pending interrupts */
  306. struct list_head interrupts;
  307. /** Queue of pending forgets */
  308. struct fuse_forget_link forget_list_head;
  309. struct fuse_forget_link *forget_list_tail;
  310. /** Batching of FORGET requests (positive indicates FORGET batch) */
  311. int forget_batch;
  312. /** Flag indicating that INIT reply has been received. Allocating
  313. * any fuse request will be suspended until the flag is set */
  314. int initialized;
  315. /** Flag indicating if connection is blocked. This will be
  316. the case before the INIT reply is received, and if there
  317. are too many outstading backgrounds requests */
  318. int blocked;
  319. /** waitq for blocked connection */
  320. wait_queue_head_t blocked_waitq;
  321. /** waitq for reserved requests */
  322. wait_queue_head_t reserved_req_waitq;
  323. /** The next unique request id */
  324. u64 reqctr;
  325. /** Connection established, cleared on umount, connection
  326. abort and device release */
  327. unsigned connected;
  328. /** Connection failed (version mismatch). Cannot race with
  329. setting other bitfields since it is only set once in INIT
  330. reply, before any other request, and never cleared */
  331. unsigned conn_error:1;
  332. /** Connection successful. Only set in INIT */
  333. unsigned conn_init:1;
  334. /** Do readpages asynchronously? Only set in INIT */
  335. unsigned async_read:1;
  336. /** Do not send separate SETATTR request before open(O_TRUNC) */
  337. unsigned atomic_o_trunc:1;
  338. /** Filesystem supports NFS exporting. Only set in INIT */
  339. unsigned export_support:1;
  340. /** Set if bdi is valid */
  341. unsigned bdi_initialized:1;
  342. /*
  343. * The following bitfields are only for optimization purposes
  344. * and hence races in setting them will not cause malfunction
  345. */
  346. /** Is fsync not implemented by fs? */
  347. unsigned no_fsync:1;
  348. /** Is fsyncdir not implemented by fs? */
  349. unsigned no_fsyncdir:1;
  350. /** Is flush not implemented by fs? */
  351. unsigned no_flush:1;
  352. /** Is setxattr not implemented by fs? */
  353. unsigned no_setxattr:1;
  354. /** Is getxattr not implemented by fs? */
  355. unsigned no_getxattr:1;
  356. /** Is listxattr not implemented by fs? */
  357. unsigned no_listxattr:1;
  358. /** Is removexattr not implemented by fs? */
  359. unsigned no_removexattr:1;
  360. /** Are posix file locking primitives not implemented by fs? */
  361. unsigned no_lock:1;
  362. /** Is access not implemented by fs? */
  363. unsigned no_access:1;
  364. /** Is create not implemented by fs? */
  365. unsigned no_create:1;
  366. /** Is interrupt not implemented by fs? */
  367. unsigned no_interrupt:1;
  368. /** Is bmap not implemented by fs? */
  369. unsigned no_bmap:1;
  370. /** Is poll not implemented by fs? */
  371. unsigned no_poll:1;
  372. /** Do multi-page cached writes */
  373. unsigned big_writes:1;
  374. /** Don't apply umask to creation modes */
  375. unsigned dont_mask:1;
  376. /** Are BSD file locking primitives not implemented by fs? */
  377. unsigned no_flock:1;
  378. /** Is fallocate not implemented by fs? */
  379. unsigned no_fallocate:1;
  380. /** Use enhanced/automatic page cache invalidation. */
  381. unsigned auto_inval_data:1;
  382. /** Does the filesystem support readdirplus? */
  383. unsigned do_readdirplus:1;
  384. /** Does the filesystem want adaptive readdirplus? */
  385. unsigned readdirplus_auto:1;
  386. /** The number of requests waiting for completion */
  387. atomic_t num_waiting;
  388. /** Negotiated minor version */
  389. unsigned minor;
  390. /** Backing dev info */
  391. struct backing_dev_info bdi;
  392. /** Entry on the fuse_conn_list */
  393. struct list_head entry;
  394. /** Device ID from super block */
  395. dev_t dev;
  396. /** Dentries in the control filesystem */
  397. struct dentry *ctl_dentry[FUSE_CTL_NUM_DENTRIES];
  398. /** number of dentries used in the above array */
  399. int ctl_ndents;
  400. /** O_ASYNC requests */
  401. struct fasync_struct *fasync;
  402. /** Key for lock owner ID scrambling */
  403. u32 scramble_key[4];
  404. /** Reserved request for the DESTROY message */
  405. struct fuse_req *destroy_req;
  406. /** Version counter for attribute changes */
  407. u64 attr_version;
  408. /** Called on final put */
  409. void (*release)(struct fuse_conn *);
  410. /** Super block for this connection. */
  411. struct super_block *sb;
  412. /** Read/write semaphore to hold when accessing sb. */
  413. struct rw_semaphore killsb;
  414. };
  415. static inline struct fuse_conn *get_fuse_conn_super(struct super_block *sb)
  416. {
  417. return sb->s_fs_info;
  418. }
  419. static inline struct fuse_conn *get_fuse_conn(struct inode *inode)
  420. {
  421. return get_fuse_conn_super(inode->i_sb);
  422. }
  423. static inline struct fuse_inode *get_fuse_inode(struct inode *inode)
  424. {
  425. return container_of(inode, struct fuse_inode, inode);
  426. }
  427. static inline u64 get_node_id(struct inode *inode)
  428. {
  429. return get_fuse_inode(inode)->nodeid;
  430. }
  431. /** Device operations */
  432. extern const struct file_operations fuse_dev_operations;
  433. extern const struct dentry_operations fuse_dentry_operations;
  434. /**
  435. * Inode to nodeid comparison.
  436. */
  437. int fuse_inode_eq(struct inode *inode, void *_nodeidp);
  438. /**
  439. * Get a filled in inode
  440. */
  441. struct inode *fuse_iget(struct super_block *sb, u64 nodeid,
  442. int generation, struct fuse_attr *attr,
  443. u64 attr_valid, u64 attr_version);
  444. int fuse_lookup_name(struct super_block *sb, u64 nodeid, struct qstr *name,
  445. struct fuse_entry_out *outarg, struct inode **inode);
  446. /**
  447. * Send FORGET command
  448. */
  449. void fuse_queue_forget(struct fuse_conn *fc, struct fuse_forget_link *forget,
  450. u64 nodeid, u64 nlookup);
  451. struct fuse_forget_link *fuse_alloc_forget(void);
  452. /* Used by READDIRPLUS */
  453. void fuse_force_forget(struct file *file, u64 nodeid);
  454. /**
  455. * Initialize READ or READDIR request
  456. */
  457. void fuse_read_fill(struct fuse_req *req, struct file *file,
  458. loff_t pos, size_t count, int opcode);
  459. /**
  460. * Send OPEN or OPENDIR request
  461. */
  462. int fuse_open_common(struct inode *inode, struct file *file, bool isdir);
  463. struct fuse_file *fuse_file_alloc(struct fuse_conn *fc);
  464. struct fuse_file *fuse_file_get(struct fuse_file *ff);
  465. void fuse_file_free(struct fuse_file *ff);
  466. void fuse_finish_open(struct inode *inode, struct file *file);
  467. void fuse_sync_release(struct fuse_file *ff, int flags);
  468. /**
  469. * Send RELEASE or RELEASEDIR request
  470. */
  471. void fuse_release_common(struct file *file, int opcode);
  472. /**
  473. * Send FSYNC or FSYNCDIR request
  474. */
  475. int fuse_fsync_common(struct file *file, loff_t start, loff_t end,
  476. int datasync, int isdir);
  477. /**
  478. * Notify poll wakeup
  479. */
  480. int fuse_notify_poll_wakeup(struct fuse_conn *fc,
  481. struct fuse_notify_poll_wakeup_out *outarg);
  482. /**
  483. * Initialize file operations on a regular file
  484. */
  485. void fuse_init_file_inode(struct inode *inode);
  486. /**
  487. * Initialize inode operations on regular files and special files
  488. */
  489. void fuse_init_common(struct inode *inode);
  490. /**
  491. * Initialize inode and file operations on a directory
  492. */
  493. void fuse_init_dir(struct inode *inode);
  494. /**
  495. * Initialize inode operations on a symlink
  496. */
  497. void fuse_init_symlink(struct inode *inode);
  498. /**
  499. * Change attributes of an inode
  500. */
  501. void fuse_change_attributes(struct inode *inode, struct fuse_attr *attr,
  502. u64 attr_valid, u64 attr_version);
  503. void fuse_change_attributes_common(struct inode *inode, struct fuse_attr *attr,
  504. u64 attr_valid);
  505. /**
  506. * Initialize the client device
  507. */
  508. int fuse_dev_init(void);
  509. /**
  510. * Cleanup the client device
  511. */
  512. void fuse_dev_cleanup(void);
  513. int fuse_ctl_init(void);
  514. void fuse_ctl_cleanup(void);
  515. /**
  516. * Allocate a request
  517. */
  518. struct fuse_req *fuse_request_alloc(unsigned npages);
  519. struct fuse_req *fuse_request_alloc_nofs(unsigned npages);
  520. /**
  521. * Free a request
  522. */
  523. void fuse_request_free(struct fuse_req *req);
  524. /**
  525. * Get a request, may fail with -ENOMEM,
  526. * caller should specify # elements in req->pages[] explicitly
  527. */
  528. struct fuse_req *fuse_get_req(struct fuse_conn *fc, unsigned npages);
  529. struct fuse_req *fuse_get_req_for_background(struct fuse_conn *fc,
  530. unsigned npages);
  531. /**
  532. * Get a request, may fail with -ENOMEM,
  533. * useful for callers who doesn't use req->pages[]
  534. */
  535. static inline struct fuse_req *fuse_get_req_nopages(struct fuse_conn *fc)
  536. {
  537. return fuse_get_req(fc, 0);
  538. }
  539. /**
  540. * Gets a requests for a file operation, always succeeds
  541. */
  542. struct fuse_req *fuse_get_req_nofail_nopages(struct fuse_conn *fc,
  543. struct file *file);
  544. /**
  545. * Decrement reference count of a request. If count goes to zero free
  546. * the request.
  547. */
  548. void fuse_put_request(struct fuse_conn *fc, struct fuse_req *req);
  549. /**
  550. * Send a request (synchronous)
  551. */
  552. void fuse_request_send(struct fuse_conn *fc, struct fuse_req *req);
  553. /**
  554. * Send a request in the background
  555. */
  556. void fuse_request_send_background(struct fuse_conn *fc, struct fuse_req *req);
  557. void fuse_request_send_background_locked(struct fuse_conn *fc,
  558. struct fuse_req *req);
  559. /* Abort all requests */
  560. void fuse_abort_conn(struct fuse_conn *fc);
  561. /**
  562. * Invalidate inode attributes
  563. */
  564. void fuse_invalidate_attr(struct inode *inode);
  565. void fuse_invalidate_entry_cache(struct dentry *entry);
  566. /**
  567. * Acquire reference to fuse_conn
  568. */
  569. struct fuse_conn *fuse_conn_get(struct fuse_conn *fc);
  570. void fuse_conn_kill(struct fuse_conn *fc);
  571. /**
  572. * Initialize fuse_conn
  573. */
  574. void fuse_conn_init(struct fuse_conn *fc);
  575. /**
  576. * Release reference to fuse_conn
  577. */
  578. void fuse_conn_put(struct fuse_conn *fc);
  579. /**
  580. * Add connection to control filesystem
  581. */
  582. int fuse_ctl_add_conn(struct fuse_conn *fc);
  583. /**
  584. * Remove connection from control filesystem
  585. */
  586. void fuse_ctl_remove_conn(struct fuse_conn *fc);
  587. /**
  588. * Is file type valid?
  589. */
  590. int fuse_valid_type(int m);
  591. /**
  592. * Is current process allowed to perform filesystem operation?
  593. */
  594. int fuse_allow_current_process(struct fuse_conn *fc);
  595. u64 fuse_lock_owner_id(struct fuse_conn *fc, fl_owner_t id);
  596. int fuse_update_attributes(struct inode *inode, struct kstat *stat,
  597. struct file *file, bool *refreshed);
  598. void fuse_flush_writepages(struct inode *inode);
  599. void fuse_set_nowrite(struct inode *inode);
  600. void fuse_release_nowrite(struct inode *inode);
  601. u64 fuse_get_attr_version(struct fuse_conn *fc);
  602. /**
  603. * File-system tells the kernel to invalidate cache for the given node id.
  604. */
  605. int fuse_reverse_inval_inode(struct super_block *sb, u64 nodeid,
  606. loff_t offset, loff_t len);
  607. /**
  608. * File-system tells the kernel to invalidate parent attributes and
  609. * the dentry matching parent/name.
  610. *
  611. * If the child_nodeid is non-zero and:
  612. * - matches the inode number for the dentry matching parent/name,
  613. * - is not a mount point
  614. * - is a file or oan empty directory
  615. * then the dentry is unhashed (d_delete()).
  616. */
  617. int fuse_reverse_inval_entry(struct super_block *sb, u64 parent_nodeid,
  618. u64 child_nodeid, struct qstr *name);
  619. int fuse_do_open(struct fuse_conn *fc, u64 nodeid, struct file *file,
  620. bool isdir);
  621. ssize_t fuse_direct_io(struct file *file, const struct iovec *iov,
  622. unsigned long nr_segs, size_t count, loff_t *ppos,
  623. int write);
  624. long fuse_do_ioctl(struct file *file, unsigned int cmd, unsigned long arg,
  625. unsigned int flags);
  626. long fuse_ioctl_common(struct file *file, unsigned int cmd,
  627. unsigned long arg, unsigned int flags);
  628. unsigned fuse_file_poll(struct file *file, poll_table *wait);
  629. int fuse_dev_release(struct inode *inode, struct file *file);
  630. void fuse_write_update_size(struct inode *inode, loff_t pos);
  631. #endif /* _FS_FUSE_I_H */