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.

111 lines
2.5 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. #include "fuse_msgbuf.h"
  11. #include "extern_c.h"
  12. struct fuse_chan;
  13. struct fuse_ll;
  14. struct fuse_session
  15. {
  16. int (*receive_buf)(struct fuse_session *se,
  17. fuse_msgbuf_t *msgbuf);
  18. void (*process_buf)(struct fuse_session *se,
  19. const fuse_msgbuf_t *msgbuf);
  20. void (*destroy)(void *data);
  21. struct fuse_ll *f;
  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. struct fuse_notify_req *next;
  41. struct fuse_notify_req *prev;
  42. };
  43. struct fuse_ll
  44. {
  45. int debug;
  46. int no_remote_posix_lock;
  47. int no_remote_flock;
  48. int big_writes;
  49. struct fuse_lowlevel_ops op;
  50. void *userdata;
  51. uid_t owner;
  52. struct fuse_conn_info conn;
  53. pthread_mutex_t lock;
  54. int got_init;
  55. int got_destroy;
  56. pthread_key_t pipe_key;
  57. int broken_splice_nonblock;
  58. uint64_t notify_ctr;
  59. struct fuse_notify_req notify_list;
  60. };
  61. struct fuse_cmd
  62. {
  63. char *buf;
  64. size_t buflen;
  65. struct fuse_chan *ch;
  66. };
  67. EXTERN_C_BEGIN
  68. struct fuse *fuse_new_common(struct fuse_chan *ch, struct fuse_args *args,
  69. const struct fuse_operations *op,
  70. size_t op_size);
  71. struct fuse_chan *fuse_kern_chan_new(int fd);
  72. struct fuse_session *fuse_lowlevel_new_common(struct fuse_args *args,
  73. const struct fuse_lowlevel_ops *op,
  74. size_t op_size, void *userdata);
  75. int fuse_chan_clearfd(struct fuse_chan *ch);
  76. void fuse_kern_unmount(const char *mountpoint, int fd);
  77. int fuse_kern_mount(const char *mountpoint, struct fuse_args *args);
  78. int fuse_send_reply_iov_nofree(fuse_req_t req, int error, struct iovec *iov,
  79. int count);
  80. void fuse_free_req(fuse_req_t req);
  81. struct fuse *fuse_setup_common(int argc, char *argv[],
  82. const struct fuse_operations *op,
  83. size_t op_size,
  84. char **mountpoint,
  85. int *fd);
  86. int fuse_start_thread(pthread_t *thread_id, void *(*func)(void *), void *arg);
  87. EXTERN_C_END