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.

134 lines
3.1 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. {
  13. struct fuse_session_ops op;
  14. int (*receive_buf)(struct fuse_session *se, struct fuse_buf *buf,
  15. struct fuse_chan **chp);
  16. void (*process_buf)(void *data, const struct fuse_buf *buf,
  17. struct fuse_chan *ch);
  18. void *data;
  19. volatile int exited;
  20. struct fuse_chan *ch;
  21. };
  22. struct fuse_req
  23. {
  24. struct fuse_ll *f;
  25. uint64_t unique;
  26. int ctr;
  27. pthread_mutex_t lock;
  28. struct fuse_ctx ctx;
  29. struct fuse_chan *ch;
  30. int interrupted;
  31. unsigned int ioctl_64bit : 1;
  32. union {
  33. struct {
  34. uint64_t unique;
  35. } i;
  36. struct {
  37. fuse_interrupt_func_t func;
  38. void *data;
  39. } ni;
  40. } u;
  41. struct fuse_req *next;
  42. struct fuse_req *prev;
  43. };
  44. struct fuse_notify_req
  45. {
  46. uint64_t unique;
  47. void (*reply)(struct fuse_notify_req *, fuse_req_t, fuse_ino_t,
  48. const void *, const struct fuse_buf *);
  49. struct fuse_notify_req *next;
  50. struct fuse_notify_req *prev;
  51. };
  52. struct fuse_ll
  53. {
  54. int debug;
  55. int allow_root;
  56. int no_remote_posix_lock;
  57. int no_remote_flock;
  58. int big_writes;
  59. int splice_write;
  60. int splice_move;
  61. int splice_read;
  62. int no_splice_write;
  63. int no_splice_move;
  64. int no_splice_read;
  65. struct fuse_lowlevel_ops op;
  66. int got_init;
  67. struct cuse_data *cuse_data;
  68. void *userdata;
  69. uid_t owner;
  70. struct fuse_conn_info conn;
  71. struct fuse_req list;
  72. struct fuse_req interrupts;
  73. pthread_mutex_t lock;
  74. int got_destroy;
  75. pthread_key_t pipe_key;
  76. int broken_splice_nonblock;
  77. uint64_t notify_ctr;
  78. struct fuse_notify_req notify_list;
  79. };
  80. struct fuse_cmd
  81. {
  82. char *buf;
  83. size_t buflen;
  84. struct fuse_chan *ch;
  85. };
  86. struct fuse *fuse_new_common(struct fuse_chan *ch, struct fuse_args *args,
  87. const struct fuse_operations *op,
  88. size_t op_size, void *user_data, int compat);
  89. int fuse_sync_compat_args(struct fuse_args *args);
  90. struct fuse_chan *fuse_kern_chan_new(int fd);
  91. struct fuse_session *fuse_lowlevel_new_common(struct fuse_args *args,
  92. const struct fuse_lowlevel_ops *op,
  93. size_t op_size, void *userdata);
  94. void fuse_kern_unmount_compat22(const char *mountpoint);
  95. int fuse_chan_clearfd(struct fuse_chan *ch);
  96. void fuse_kern_unmount(const char *mountpoint, int fd);
  97. int fuse_kern_mount(const char *mountpoint, struct fuse_args *args);
  98. int fuse_send_reply_iov_nofree(fuse_req_t req, int error, struct iovec *iov,
  99. int count);
  100. void fuse_free_req(fuse_req_t req);
  101. struct fuse *fuse_setup_common(int argc, char *argv[],
  102. const struct fuse_operations *op,
  103. size_t op_size,
  104. char **mountpoint,
  105. int *multithreaded,
  106. int *fd,
  107. void *user_data,
  108. int compat);
  109. void cuse_lowlevel_init(fuse_req_t req, fuse_ino_t nodeide, const void *inarg);
  110. int fuse_start_thread(pthread_t *thread_id, void *(*func)(void *), void *arg);