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.

112 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. 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. int got_init;
  57. void *userdata;
  58. uid_t owner;
  59. struct fuse_conn_info conn;
  60. pthread_mutex_t lock;
  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. struct fuse *fuse_new_common(struct fuse_chan *ch, struct fuse_args *args,
  74. const struct fuse_operations *op,
  75. size_t op_size);
  76. struct fuse_chan *fuse_kern_chan_new(int fd);
  77. struct fuse_session *fuse_lowlevel_new_common(struct fuse_args *args,
  78. const struct fuse_lowlevel_ops *op,
  79. size_t op_size, void *userdata);
  80. int fuse_chan_clearfd(struct fuse_chan *ch);
  81. void fuse_kern_unmount(const char *mountpoint, int fd);
  82. int fuse_kern_mount(const char *mountpoint, struct fuse_args *args);
  83. int fuse_send_reply_iov_nofree(fuse_req_t req, int error, struct iovec *iov,
  84. int count);
  85. void fuse_free_req(fuse_req_t req);
  86. struct fuse *fuse_setup_common(int argc, char *argv[],
  87. const struct fuse_operations *op,
  88. size_t op_size,
  89. char **mountpoint,
  90. int *fd);
  91. int fuse_start_thread(pthread_t *thread_id, void *(*func)(void *), void *arg);