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.

118 lines
2.7 KiB

5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
  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. typedef struct fuse_chan_t fuse_chan_t;
  10. struct fuse_ll;
  11. struct fuse_session
  12. {
  13. struct fuse_session_ops op;
  14. void *data;
  15. volatile int exited;
  16. int devfuse_fd;
  17. };
  18. struct fuse_req
  19. {
  20. struct fuse_ll *f;
  21. uint64_t unique;
  22. int ctr;
  23. pthread_mutex_t lock;
  24. struct fuse_ctx ctx;
  25. fuse_chan_t *ch;
  26. int interrupted;
  27. unsigned int ioctl_64bit : 1;
  28. union {
  29. struct {
  30. uint64_t unique;
  31. } i;
  32. struct {
  33. fuse_interrupt_func_t func;
  34. void *data;
  35. } ni;
  36. } u;
  37. struct fuse_req *next;
  38. struct fuse_req *prev;
  39. };
  40. struct fuse_notify_req
  41. {
  42. uint64_t unique;
  43. void (*reply)(struct fuse_notify_req *, fuse_req_t, fuse_ino_t,
  44. const void *, const struct fuse_buf *);
  45. struct fuse_notify_req *next;
  46. struct fuse_notify_req *prev;
  47. };
  48. struct fuse_ll
  49. {
  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. void *userdata;
  65. uid_t owner;
  66. struct fuse_conn_info conn;
  67. struct fuse_req list;
  68. struct fuse_req interrupts;
  69. pthread_mutex_t lock;
  70. int got_destroy;
  71. pthread_key_t pipe_key;
  72. int broken_splice_nonblock;
  73. uint64_t notify_ctr;
  74. struct fuse_notify_req notify_list;
  75. };
  76. struct fuse_cmd
  77. {
  78. char *buf;
  79. size_t buflen;
  80. fuse_chan_t *ch;
  81. };
  82. struct fuse *fuse_new_common(int devfuse_fd, struct fuse_args *args,
  83. const struct fuse_operations *op,
  84. size_t op_size, void *user_data);
  85. int fuse_sync_compat_args(struct fuse_args *args);
  86. struct fuse_session *fuse_lowlevel_new_common(struct fuse_args *args,
  87. const struct fuse_lowlevel_ops *op,
  88. size_t op_size, void *userdata);
  89. void fuse_kern_unmount_compat22(const char *mountpoint);
  90. int fuse_chan_clearfd(fuse_chan_t *ch);
  91. void fuse_kern_unmount(const char *mountpoint, int fd);
  92. int fuse_kern_mount(const char *mountpoint, struct fuse_args *args);
  93. int fuse_send_reply_iov_nofree(fuse_req_t req, int error, struct iovec *iov,
  94. int count);
  95. void fuse_free_req(fuse_req_t req);
  96. struct fuse *fuse_setup_common(int argc, char *argv[],
  97. const struct fuse_operations *op,
  98. size_t op_size,
  99. char **mountpoint,
  100. void *user_data);
  101. int fuse_start_thread(pthread_t *thread_id, void *(*func)(void *), void *arg);