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