aboutsummaryrefslogtreecommitdiffstats
path: root/lib/fuse_lowlevel.c
diff options
context:
space:
mode:
authorHorst Birthelmer <hbirthelmer@ddn.com>2024-11-20 16:14:43 +0100
committerBernd Schubert <bernd.schubert@fastmail.fm>2024-11-27 13:38:56 +0100
commit4ec109d1c447bbf5be05854e32d8683bb1df5a80 (patch)
tree4283922b8aee6846ea111499285174232ed062b8 /lib/fuse_lowlevel.c
parent8b34ed03682bb7806a6083b05187c4fc5475a135 (diff)
downloadlibfuse-4ec109d1c447bbf5be05854e32d8683bb1df5a80.tar.gz
support FUSE_TMPFILE in the low level API
Note that name hashes and using paths as parameters makes it very hard to support anonymous files in the high level API. Known Issues: - tests have to bail out when O_TMPFILE is not supported. This will always be the case with high level passthrough implementations. - test_create_and_link_tmpfile has to be skipped due to unidentified problems with github runner
Diffstat (limited to 'lib/fuse_lowlevel.c')
-rw-r--r--lib/fuse_lowlevel.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/lib/fuse_lowlevel.c b/lib/fuse_lowlevel.c
index 9cc96e9..b233e55 100644
--- a/lib/fuse_lowlevel.c
+++ b/lib/fuse_lowlevel.c
@@ -1361,6 +1361,24 @@ static void do_link(fuse_req_t req, fuse_ino_t nodeid, const void *inarg)
fuse_reply_err(req, ENOSYS);
}
+static void do_tmpfile(fuse_req_t req, fuse_ino_t nodeid, const void *inarg)
+{
+ struct fuse_create_in *arg = (struct fuse_create_in *) inarg;
+
+ if (req->se->op.tmpfile) {
+ struct fuse_file_info fi;
+
+ memset(&fi, 0, sizeof(fi));
+ fi.flags = arg->flags;
+
+ if (req->se->conn.proto_minor >= 12)
+ req->ctx.umask = arg->umask;
+
+ req->se->op.tmpfile(req, nodeid, arg->mode, &fi);
+ } else
+ fuse_reply_err(req, ENOSYS);
+}
+
static void do_create(fuse_req_t req, fuse_ino_t nodeid, const void *inarg)
{
struct fuse_create_in *arg = (struct fuse_create_in *) inarg;
@@ -2678,6 +2696,7 @@ static struct {
[FUSE_SETLKW] = { do_setlkw, "SETLKW" },
[FUSE_ACCESS] = { do_access, "ACCESS" },
[FUSE_CREATE] = { do_create, "CREATE" },
+ [FUSE_TMPFILE] = { do_tmpfile, "TMPFILE" },
[FUSE_INTERRUPT] = { do_interrupt, "INTERRUPT" },
[FUSE_BMAP] = { do_bmap, "BMAP" },
[FUSE_IOCTL] = { do_ioctl, "IOCTL" },