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.

126 lines
2.8 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. void *userdata;
  68. uid_t owner;
  69. struct fuse_conn_info conn;
  70. struct fuse_req list;
  71. struct fuse_req interrupts;
  72. pthread_mutex_t lock;
  73. int got_destroy;
  74. pthread_key_t pipe_key;
  75. int broken_splice_nonblock;
  76. uint64_t notify_ctr;
  77. struct fuse_notify_req notify_list;
  78. };
  79. struct fuse_cmd
  80. {
  81. char *buf;
  82. size_t buflen;
  83. struct fuse_chan *ch;
  84. };
  85. struct fuse *fuse_new_common(struct fuse_chan *ch, struct fuse_args *args,
  86. const struct fuse_operations *op,
  87. size_t op_size, void *user_data);
  88. struct fuse_chan *fuse_kern_chan_new(int fd);
  89. struct fuse_session *fuse_lowlevel_new_common(struct fuse_args *args,
  90. const struct fuse_lowlevel_ops *op,
  91. size_t op_size, void *userdata);
  92. int fuse_chan_clearfd(struct fuse_chan *ch);
  93. void fuse_kern_unmount(const char *mountpoint, int fd);
  94. int fuse_kern_mount(const char *mountpoint, struct fuse_args *args);
  95. int fuse_send_reply_iov_nofree(fuse_req_t req, int error, struct iovec *iov,
  96. int count);
  97. void fuse_free_req(fuse_req_t req);
  98. struct fuse *fuse_setup_common(int argc, char *argv[],
  99. const struct fuse_operations *op,
  100. size_t op_size,
  101. char **mountpoint,
  102. int *fd,
  103. void *user_data);
  104. int fuse_start_thread(pthread_t *thread_id, void *(*func)(void *), void *arg);