diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/fuse_lowlevel.c | 19 | ||||
-rw-r--r-- | lib/fuse_versionscript | 1 |
2 files changed, 20 insertions, 0 deletions
diff --git a/lib/fuse_lowlevel.c b/lib/fuse_lowlevel.c index fc76b7c..c7efc3d 100644 --- a/lib/fuse_lowlevel.c +++ b/lib/fuse_lowlevel.c @@ -27,6 +27,7 @@ #include <errno.h> #include <assert.h> #include <sys/file.h> +#include <sys/ioctl.h> #ifndef F_LINUX_SPECIFIC_BASE #define F_LINUX_SPECIFIC_BASE 1024 @@ -388,6 +389,7 @@ static void fill_open(struct fuse_open_out *arg, const struct fuse_file_info *f) { arg->fh = f->fh; + arg->passthrough_fh = f->passthrough_fh; if (f->direct_io) arg->open_flags |= FOPEN_DIRECT_IO; if (f->keep_cache) @@ -457,6 +459,19 @@ int fuse_reply_canonical_path(fuse_req_t req, const char *path) return send_reply_ok(req, path, strlen(path) + 1); } +int fuse_passthrough_enable(fuse_req_t req, unsigned int fd) { + struct fuse_passthrough_out out = {}; + int ret; + + out.fd = fd; + + ret = ioctl(req->se->fd, FUSE_DEV_IOC_PASSTHROUGH_OPEN, &out); + if (ret <= 0) + fuse_log(FUSE_LOG_ERR, "fuse: passthrough_enable: %s\n", strerror(errno)); + + return ret; +} + int fuse_reply_open(fuse_req_t req, const struct fuse_file_info *f) { struct fuse_open_out arg; @@ -1990,6 +2005,8 @@ static void do_init(fuse_req_t req, fuse_ino_t nodeid, const void *inarg) bufsize = max_bufsize; } } + if (arg->flags & FUSE_PASSTHROUGH) + se->conn.capable |= FUSE_PASSTHROUGH; } else { se->conn.max_readahead = 0; } @@ -2102,6 +2119,8 @@ static void do_init(fuse_req_t req, fuse_ino_t nodeid, const void *inarg) outarg.flags |= FUSE_WRITEBACK_CACHE; if (se->conn.want & FUSE_CAP_POSIX_ACL) outarg.flags |= FUSE_POSIX_ACL; + if (se->conn.want & FUSE_CAP_PASSTHROUGH) + outarg.flags |= FUSE_PASSTHROUGH; outarg.max_readahead = se->conn.max_readahead; outarg.max_write = se->conn.max_write; if (se->conn.proto_minor >= 13) { diff --git a/lib/fuse_versionscript b/lib/fuse_versionscript index 4c075a3..b01699a 100644 --- a/lib/fuse_versionscript +++ b/lib/fuse_versionscript @@ -163,6 +163,7 @@ FUSE_3.7 { global: fuse_set_log_func; fuse_log; + fuse_passthrough_enable; fuse_reply_canonical_path; } FUSE_3.3; |