aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBernd Schubert <bschubert@ddn.com>2025-04-15 20:13:47 +0200
committerBernd Schubert <bernd@bsbernd.com>2025-04-28 19:57:39 +0200
commit538b51feedbcdcd78beefd7517ff19c77c4e4526 (patch)
treef8cb353a4c192e6610d21c62fa7c92ce091a6bb7
parent71b6fb723aacd9c216c68db3cc1f4d87291cf408 (diff)
downloadlibfuse-538b51feedbcdcd78beefd7517ff19c77c4e4526.tar.gz
Add fuse_req_is_uring() to check if a req comes through io-uring
This might be useful to optimize code paths. For example, with io-uring the request buffer is valid until the request is replied to, while without io-uring the request buffer is only valid in current thread context. Signed-off-by: Bernd Schubert <bschubert@ddn.com>
-rw-r--r--include/fuse_lowlevel.h5
-rw-r--r--lib/fuse_lowlevel.c5
-rw-r--r--lib/fuse_versionscript5
3 files changed, 15 insertions, 0 deletions
diff --git a/include/fuse_lowlevel.h b/include/fuse_lowlevel.h
index c7b44d9..138a784 100644
--- a/include/fuse_lowlevel.h
+++ b/include/fuse_lowlevel.h
@@ -2315,6 +2315,11 @@ void fuse_session_process_buf(struct fuse_session *se,
*/
int fuse_session_receive_buf(struct fuse_session *se, struct fuse_buf *buf);
+/**
+ * Check if the request is submitted through fuse-io-uring
+ */
+bool fuse_req_is_uring(fuse_req_t req);
+
#ifdef __cplusplus
}
#endif
diff --git a/lib/fuse_lowlevel.c b/lib/fuse_lowlevel.c
index ad36414..c7cbebd 100644
--- a/lib/fuse_lowlevel.c
+++ b/lib/fuse_lowlevel.c
@@ -3157,6 +3157,11 @@ int fuse_req_interrupted(fuse_req_t req)
return interrupted;
}
+bool fuse_req_is_uring(fuse_req_t req)
+{
+ return req->is_uring;
+}
+
static struct {
void (*func)(fuse_req_t req, const fuse_ino_t node, const void *arg);
const char *name;
diff --git a/lib/fuse_versionscript b/lib/fuse_versionscript
index 6c5fc83..22c59e1 100644
--- a/lib/fuse_versionscript
+++ b/lib/fuse_versionscript
@@ -202,6 +202,11 @@ FUSE_3.17 {
fuse_log_close_syslog;
} FUSE_3.12;
+FUSE_3.18 {
+ global:
+ fuse_req_is_uring;
+} FUSE_3.17;
+
# Local Variables:
# indent-tabs-mode: t
# End: