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.

117 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. #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. int splice_write;
  50. int splice_move;
  51. int splice_read;
  52. int no_splice_write;
  53. int no_splice_move;
  54. int no_splice_read;
  55. struct fuse_lowlevel_ops op;
  56. void *userdata;
  57. uid_t owner;
  58. struct fuse_conn_info conn;
  59. pthread_mutex_t lock;
  60. int got_init;
  61. int got_destroy;
  62. pthread_key_t pipe_key;
  63. int broken_splice_nonblock;
  64. uint64_t notify_ctr;
  65. struct fuse_notify_req notify_list;
  66. };
  67. struct fuse_cmd
  68. {
  69. char *buf;
  70. size_t buflen;
  71. struct fuse_chan *ch;
  72. };
  73. EXTERN_C_BEGIN
  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);
  93. EXTERN_C_END