diff --git a/example/cuse.c b/example/cuse.c index 4445b011..30080d31 100644 --- a/example/cuse.c +++ b/example/cuse.c @@ -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) diff --git a/example/hello_ll.c b/example/hello_ll.c index 00162512..2356669a 100644 --- a/example/hello_ll.c +++ b/example/hello_ll.c @@ -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; diff --git a/example/hello_ll_uds.c b/example/hello_ll_uds.c index b0a6e9cd..15a40e09 100644 --- a/example/hello_ll_uds.c +++ b/example/hello_ll_uds.c @@ -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) diff --git a/example/notify_inval_entry.c b/example/notify_inval_entry.c index 5fe29d8e..c60482ab 100644 --- a/example/notify_inval_entry.c +++ b/example/notify_inval_entry.c @@ -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, diff --git a/example/notify_inval_inode.c b/example/notify_inval_inode.c index 74beea72..d2108efe 100644 --- a/example/notify_inval_inode.c +++ b/example/notify_inval_inode.c @@ -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) diff --git a/example/notify_prune.c b/example/notify_prune.c index d5504dfc..5afab67f 100644 --- a/example/notify_prune.c +++ b/example/notify_prune.c @@ -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) diff --git a/example/notify_store_retrieve.c b/example/notify_store_retrieve.c index 498216bf..c3f7cc62 100644 --- a/example/notify_store_retrieve.c +++ b/example/notify_store_retrieve.c @@ -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, diff --git a/example/passthrough_hp.cc b/example/passthrough_hp.cc index 56958017..beef94c0 100644 --- a/example/passthrough_hp.cc +++ b/example/passthrough_hp.cc @@ -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; diff --git a/example/passthrough_ll.c b/example/passthrough_ll.c index 9a82d025..1fcc4925 100644 --- a/example/passthrough_ll.c +++ b/example/passthrough_ll.c @@ -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) diff --git a/include/fuse_common.h b/include/fuse_common.h index cd9908d2..5bc62a08 100644 --- a/include/fuse_common.h +++ b/include/fuse_common.h @@ -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 diff --git a/lib/fuse_lowlevel.c b/lib/fuse_lowlevel.c index 4eda5c7b..9d525487 100644 --- a/lib/fuse_lowlevel.c +++ b/lib/fuse_lowlevel.c @@ -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; }