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.

110 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. 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 *, fuse_req_t, fuse_ino_t,
  35. const void *, const struct fuse_buf *);
  36. struct fuse_notify_req *next;
  37. struct fuse_notify_req *prev;
  38. };
  39. struct fuse_ll
  40. {
  41. int debug;
  42. int no_remote_posix_lock;
  43. int no_remote_flock;
  44. int big_writes;
  45. int splice_write;
  46. int splice_move;
  47. int splice_read;
  48. int no_splice_write;
  49. int no_splice_move;
  50. int no_splice_read;
  51. struct fuse_lowlevel_ops op;
  52. int got_init;
  53. void *userdata;
  54. uid_t owner;
  55. struct fuse_conn_info conn;
  56. pthread_mutex_t lock;
  57. int got_destroy;
  58. pthread_key_t pipe_key;
  59. int broken_splice_nonblock;
  60. uint64_t notify_ctr;
  61. struct fuse_notify_req notify_list;
  62. };
  63. struct fuse_cmd
  64. {
  65. char *buf;
  66. size_t buflen;
  67. struct fuse_chan *ch;
  68. };
  69. struct fuse *fuse_new_common(struct fuse_chan *ch, struct fuse_args *args,
  70. const struct fuse_operations *op,
  71. size_t op_size);
  72. struct fuse_chan *fuse_kern_chan_new(int fd);
  73. struct fuse_session *fuse_lowlevel_new_common(struct fuse_args *args,
  74. const struct fuse_lowlevel_ops *op,
  75. size_t op_size, void *userdata);
  76. int fuse_chan_clearfd(struct fuse_chan *ch);
  77. void fuse_kern_unmount(const char *mountpoint, int fd);
  78. int fuse_kern_mount(const char *mountpoint, struct fuse_args *args);
  79. int fuse_send_reply_iov_nofree(fuse_req_t req, int error, struct iovec *iov,
  80. int count);
  81. void fuse_free_req(fuse_req_t req);
  82. struct fuse *fuse_setup_common(int argc, char *argv[],
  83. const struct fuse_operations *op,
  84. size_t op_size,
  85. char **mountpoint,
  86. int *fd);
  87. int fuse_start_thread(pthread_t *thread_id, void *(*func)(void *), void *arg);