You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

130 lines
3.0 KiB

  1. /*
  2. FUSE: Filesystem in Userspace
  3. Copyright (C) 2001-2007 Miklos Szeredi <miklos@szeredi.hu>
  4. This program can be distributed under the terms of the GNU LGPLv2.
  5. See the file COPYING.LIB
  6. */
  7. #include "fuse.h"
  8. #include "fuse_lowlevel.h"
  9. struct fuse_chan;
  10. struct fuse_ll;
  11. struct fuse_session {
  12. struct fuse_session_ops op;
  13. int (*receive_buf)(struct fuse_session *se, struct fuse_buf *buf,
  14. struct fuse_chan **chp);
  15. void (*process_buf)(void *data, const struct fuse_buf *buf,
  16. struct fuse_chan *ch);
  17. void *data;
  18. volatile int exited;
  19. struct fuse_chan *ch;
  20. };
  21. struct fuse_req {
  22. struct fuse_ll *f;
  23. uint64_t unique;
  24. int ctr;
  25. pthread_mutex_t lock;
  26. struct fuse_ctx ctx;
  27. struct fuse_chan *ch;
  28. int interrupted;
  29. unsigned int ioctl_64bit : 1;
  30. union {
  31. struct {
  32. uint64_t unique;
  33. } i;
  34. struct {
  35. fuse_interrupt_func_t func;
  36. void *data;
  37. } ni;
  38. } u;
  39. struct fuse_req *next;
  40. struct fuse_req *prev;
  41. };
  42. struct fuse_notify_req {
  43. uint64_t unique;
  44. void (*reply)(struct fuse_notify_req *, fuse_req_t, fuse_ino_t,
  45. const void *, const struct fuse_buf *);
  46. struct fuse_notify_req *next;
  47. struct fuse_notify_req *prev;
  48. };
  49. struct fuse_ll {
  50. int debug;
  51. int allow_root;
  52. int atomic_o_trunc;
  53. int no_remote_posix_lock;
  54. int no_remote_flock;
  55. int big_writes;
  56. int splice_write;
  57. int splice_move;
  58. int splice_read;
  59. int no_splice_write;
  60. int no_splice_move;
  61. int no_splice_read;
  62. struct fuse_lowlevel_ops op;
  63. int got_init;
  64. struct cuse_data *cuse_data;
  65. void *userdata;
  66. uid_t owner;
  67. struct fuse_conn_info conn;
  68. struct fuse_req list;
  69. struct fuse_req interrupts;
  70. pthread_mutex_t lock;
  71. int got_destroy;
  72. pthread_key_t pipe_key;
  73. int broken_splice_nonblock;
  74. uint64_t notify_ctr;
  75. struct fuse_notify_req notify_list;
  76. };
  77. struct fuse_cmd {
  78. char *buf;
  79. size_t buflen;
  80. struct fuse_chan *ch;
  81. };
  82. struct fuse *fuse_new_common(struct fuse_chan *ch, struct fuse_args *args,
  83. const struct fuse_operations *op,
  84. size_t op_size, void *user_data, int compat);
  85. int fuse_sync_compat_args(struct fuse_args *args);
  86. struct fuse_chan *fuse_kern_chan_new(int fd);
  87. struct fuse_session *fuse_lowlevel_new_common(struct fuse_args *args,
  88. const struct fuse_lowlevel_ops *op,
  89. size_t op_size, void *userdata);
  90. void fuse_kern_unmount_compat22(const char *mountpoint);
  91. int fuse_chan_clearfd(struct fuse_chan *ch);
  92. void fuse_kern_unmount(const char *mountpoint, int fd);
  93. int fuse_kern_mount(const char *mountpoint, struct fuse_args *args);
  94. int fuse_send_reply_iov_nofree(fuse_req_t req, int error, struct iovec *iov,
  95. int count);
  96. void fuse_free_req(fuse_req_t req);
  97. struct fuse *fuse_setup_common(int argc, char *argv[],
  98. const struct fuse_operations *op,
  99. size_t op_size,
  100. char **mountpoint,
  101. int *multithreaded,
  102. int *fd,
  103. void *user_data,
  104. int compat);
  105. void cuse_lowlevel_init(fuse_req_t req, fuse_ino_t nodeide, const void *inarg);
  106. int fuse_start_thread(pthread_t *thread_id, void *(*func)(void *), void *arg);