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.

113 lines
2.6 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. #pragma once
  8. #include "fuse.h"
  9. #include "fuse_lowlevel.h"
  10. struct fuse_chan;
  11. struct fuse_ll;
  12. struct fuse_session
  13. {
  14. struct fuse_session_ops op;
  15. int (*receive_buf)(struct fuse_session *se, struct fuse_buf *buf,
  16. struct fuse_chan **chp);
  17. void (*process_buf)(void *data, const struct fuse_buf *buf,
  18. struct fuse_chan *ch);
  19. void *data;
  20. volatile int exited;
  21. struct fuse_chan *ch;
  22. };
  23. struct fuse_req
  24. {
  25. struct fuse_ll *f;
  26. uint64_t unique;
  27. struct fuse_ctx ctx;
  28. struct fuse_chan *ch;
  29. unsigned int ioctl_64bit : 1;
  30. };
  31. struct fuse_notify_req
  32. {
  33. uint64_t unique;
  34. void (*reply)(struct fuse_notify_req *,
  35. fuse_req_t,
  36. uint64_t,
  37. const void *,
  38. const struct fuse_buf *);
  39. struct fuse_notify_req *next;
  40. struct fuse_notify_req *prev;
  41. };
  42. struct fuse_ll
  43. {
  44. int debug;
  45. int no_remote_posix_lock;
  46. int no_remote_flock;
  47. int big_writes;
  48. int splice_write;
  49. int splice_move;
  50. int splice_read;
  51. int no_splice_write;
  52. int no_splice_move;
  53. int no_splice_read;
  54. struct fuse_lowlevel_ops op;
  55. int got_init;
  56. void *userdata;
  57. uid_t owner;
  58. struct fuse_conn_info conn;
  59. pthread_mutex_t lock;
  60. int got_destroy;
  61. pthread_key_t pipe_key;
  62. int broken_splice_nonblock;
  63. uint64_t notify_ctr;
  64. struct fuse_notify_req notify_list;
  65. };
  66. struct fuse_cmd
  67. {
  68. char *buf;
  69. size_t buflen;
  70. struct fuse_chan *ch;
  71. };
  72. struct fuse *fuse_new_common(struct fuse_chan *ch, struct fuse_args *args,
  73. const struct fuse_operations *op,
  74. size_t op_size);
  75. struct fuse_chan *fuse_kern_chan_new(int fd);
  76. struct fuse_session *fuse_lowlevel_new_common(struct fuse_args *args,
  77. const struct fuse_lowlevel_ops *op,
  78. size_t op_size, void *userdata);
  79. int fuse_chan_clearfd(struct fuse_chan *ch);
  80. void fuse_kern_unmount(const char *mountpoint, int fd);
  81. int fuse_kern_mount(const char *mountpoint, struct fuse_args *args);
  82. int fuse_send_reply_iov_nofree(fuse_req_t req, int error, struct iovec *iov,
  83. int count);
  84. void fuse_free_req(fuse_req_t req);
  85. struct fuse *fuse_setup_common(int argc, char *argv[],
  86. const struct fuse_operations *op,
  87. size_t op_size,
  88. char **mountpoint,
  89. int *fd);
  90. int fuse_start_thread(pthread_t *thread_id, void *(*func)(void *), void *arg);