fuse: add FUSE_CONN_FLAG_NO_INTERRUPT conn flag

fuse_set_conn_flag() collects the libfuse-side connection hints that are
not negotiated with the kernel. no_interrupt was the one such hint still
set only by direct field assignment.

Define FUSE_CONN_FLAG_NO_INTERRUPT alongside FUSE_CONN_FLAG_SINGLE_ISSUER
and map it onto conn->no_interrupt in the same switch, and convert the
example init() handlers to set it through the setter.

Signed-off-by: Bernd Schubert <bernd@bsbernd.com>
This commit is contained in:
Bernd Schubert
2026-06-22 10:17:19 +02:00
parent 2ad90f04dc
commit 3a3dd7b02d
11 changed files with 17 additions and 11 deletions
+1 -1
View File
@@ -92,7 +92,7 @@ static void cusexmp_init(void *userdata, struct fuse_conn_info *conn)
(void)userdata;
/* Disable the receiving and processing of FUSE_INTERRUPT requests */
conn->no_interrupt = 1;
fuse_set_conn_flag(conn, FUSE_CONN_FLAG_NO_INTERRUPT);
}
static void cusexmp_open(fuse_req_t req, struct fuse_file_info *fi)
+1 -1
View File
@@ -65,7 +65,7 @@ static void hello_ll_init(void *userdata, struct fuse_conn_info *conn)
fuse_set_conn_flag(conn, FUSE_CONN_FLAG_SINGLE_ISSUER);
/* Disable the receiving and processing of FUSE_INTERRUPT requests */
conn->no_interrupt = 1;
fuse_set_conn_flag(conn, FUSE_CONN_FLAG_NO_INTERRUPT);
/* Test setting flags the old way */
conn->want = FUSE_CAP_ASYNC_READ;
+1 -1
View File
@@ -82,7 +82,7 @@ static void hello_ll_init(void *userdata, struct fuse_conn_info *conn)
(void)userdata;
/* Disable the receiving and processing of FUSE_INTERRUPT requests */
conn->no_interrupt = 1;
fuse_set_conn_flag(conn, FUSE_CONN_FLAG_NO_INTERRUPT);
}
static void hello_ll_lookup(fuse_req_t req, fuse_ino_t parent, const char *name)
+1 -1
View File
@@ -155,7 +155,7 @@ static void tfs_init(void *userdata, struct fuse_conn_info *conn) {
fuse_set_conn_flag(conn, FUSE_CONN_FLAG_SINGLE_ISSUER);
/* Disable the receiving and processing of FUSE_INTERRUPT requests */
conn->no_interrupt = 1;
fuse_set_conn_flag(conn, FUSE_CONN_FLAG_NO_INTERRUPT);
}
static void tfs_lookup(fuse_req_t req, fuse_ino_t parent,
+1 -1
View File
@@ -129,7 +129,7 @@ static void tfs_init(void *userdata, struct fuse_conn_info *conn) {
fuse_set_conn_flag(conn, FUSE_CONN_FLAG_SINGLE_ISSUER);
/* Disable the receiving and processing of FUSE_INTERRUPT requests */
conn->no_interrupt = 1;
fuse_set_conn_flag(conn, FUSE_CONN_FLAG_NO_INTERRUPT);
}
static void tfs_destroy(void *userarg)
+1 -1
View File
@@ -140,7 +140,7 @@ static void tfs_init(void *userdata, struct fuse_conn_info *conn)
fuse_set_conn_flag(conn, FUSE_CONN_FLAG_SINGLE_ISSUER);
/* Disable the receiving and processing of FUSE_INTERRUPT requests */
conn->no_interrupt = 1;
fuse_set_conn_flag(conn, FUSE_CONN_FLAG_NO_INTERRUPT);
}
static void tfs_destroy(void *userarg)
+1 -1
View File
@@ -138,7 +138,7 @@ static void tfs_init(void *userdata, struct fuse_conn_info *conn) {
fuse_set_conn_flag(conn, FUSE_CONN_FLAG_SINGLE_ISSUER);
/* Disable the receiving and processing of FUSE_INTERRUPT requests */
conn->no_interrupt = 1;
fuse_set_conn_flag(conn, FUSE_CONN_FLAG_NO_INTERRUPT);
}
static void tfs_lookup(fuse_req_t req, fuse_ino_t parent,
+1 -1
View File
@@ -249,7 +249,7 @@ static void sfs_init(void *userdata, fuse_conn_info *conn)
fuse_set_feature_flag(conn, FUSE_CAP_NO_EXPORT_SUPPORT);
/* Disable the receiving and processing of FUSE_INTERRUPT requests */
conn->no_interrupt = 1;
fuse_set_conn_flag(conn, FUSE_CONN_FLAG_NO_INTERRUPT);
/* Try a large IO by default */
conn->max_write = 4 * 1024 * 1024;
+1 -1
View File
@@ -184,7 +184,7 @@ static void lo_init(void *userdata,
}
/* Disable the receiving and processing of FUSE_INTERRUPT requests */
conn->no_interrupt = 1;
fuse_set_conn_flag(conn, FUSE_CONN_FLAG_NO_INTERRUPT);
}
static void lo_destroy(void *userdata)
+5 -2
View File
@@ -1151,10 +1151,13 @@ void fuse_unset_feature_flag(struct fuse_conn_info *conn, uint64_t flag);
*/
bool fuse_get_feature_flag(const struct fuse_conn_info *conn, uint64_t flag);
/* The file system replies to requests from the same thread that received them,
* allowing io-uring optimizations
/**
* FUSE_CONN_FLAG_SINGLE_ISSUER: Reply from the same thread that received
* requests, which allows io-uring optimizations
* FUSE_CONN_FLAG_NO_INTERRUPT: Disable fuse interrupt handling and (libfuse overhead)
*/
#define FUSE_CONN_FLAG_SINGLE_ISSUER (1u << 0)
#define FUSE_CONN_FLAG_NO_INTERRUPT (1u << 1)
/**
* Set a libfuse connection flag (a FUSE_CONN_FLAG_* value). Unlike
+3
View File
@@ -2706,6 +2706,9 @@ bool fuse_set_conn_flag(struct fuse_conn_info *conn, uint64_t flag)
case FUSE_CONN_FLAG_SINGLE_ISSUER:
conn->io_uring_single_issuer = 1;
return true;
case FUSE_CONN_FLAG_NO_INTERRUPT:
conn->no_interrupt = 1;
return true;
default:
return false;
}