mirror of
https://github.com/libfuse/libfuse.git
synced 2026-07-07 14:47:41 +08:00
Support request timeouts
This adds the libfuse changes needed to support request timeouts. A timeout may be set by the server in its init call. If a request is not completed by the timeout, the connection will be aborted by the kernel. Signed-off-by: Joanne Koong <joannelkoong@gmail.com>
This commit is contained in:
committed by
Bernd Schubert
parent
cd50316828
commit
84a27de6a6
@@ -708,10 +708,16 @@ struct fuse_conn_info {
|
||||
*/
|
||||
uint64_t want_ext;
|
||||
|
||||
/**
|
||||
* Request timeout (in seconds). If the request is not answered by
|
||||
* this timeout, the connection will be aborted by the kernel.
|
||||
*/
|
||||
uint16_t request_timeout;
|
||||
|
||||
/**
|
||||
* For future use.
|
||||
*/
|
||||
uint32_t reserved[16];
|
||||
uint16_t reserved[31];
|
||||
};
|
||||
fuse_static_assert(sizeof(struct fuse_conn_info) == 128,
|
||||
"Size of struct fuse_conn_info must be 128 bytes");
|
||||
|
||||
@@ -2720,6 +2720,11 @@ _do_init(fuse_req_t req, const fuse_ino_t nodeid, const void *op_in,
|
||||
enable_io_uring = true;
|
||||
}
|
||||
|
||||
if ((inargflags & FUSE_REQUEST_TIMEOUT) && se->conn.request_timeout) {
|
||||
outargflags |= FUSE_REQUEST_TIMEOUT;
|
||||
outarg.request_timeout = se->conn.request_timeout;
|
||||
}
|
||||
|
||||
if (inargflags & FUSE_INIT_EXT) {
|
||||
outargflags |= FUSE_INIT_EXT;
|
||||
outarg.flags2 = outargflags >> 32;
|
||||
|
||||
Reference in New Issue
Block a user