libfuse
fuse_uring_i.h
1/*
2 * FUSE: Filesystem in Userspace
3 * Copyright (C) 2025 Bernd Schubert <bschubert@ddn.com>
4 * This program can be distributed under the terms of the GNU LGPLv2.
5 * See the file LGPL2.txt
6 */
7
8#ifndef FUSE_URING_I_H_
9#define FUSE_URING_I_H_
10
11#include "fuse_config.h"
12#include "fuse_lowlevel.h"
13#include "fuse_kernel.h"
14
15#ifndef HAVE_URING
16#include "util.h"
17#endif
18
19#include <errno.h> // IWYU pragma: keep
20
21/* io-uring defaults */
22#define SESSION_DEF_URING_ENABLE (0)
23#define SESSION_DEF_URING_Q_DEPTH (8)
24
25void fuse_session_process_uring_cqe(struct fuse_session *se,
26 struct fuse_req *req,
27 struct fuse_in_header *in, void *in_header,
28 void *in_payload, size_t payload_len);
29
30#ifdef HAVE_URING
31
32struct fuse_in_header;
33
34int fuse_uring_start(struct fuse_session *se);
35void fuse_uring_wake_ring_threads(struct fuse_session *se);
36int fuse_uring_stop(struct fuse_session *se);
37int send_reply_uring(fuse_req_t req, int error, const void *arg,
38 size_t argsize);
39
40int fuse_reply_data_uring(fuse_req_t req, struct fuse_bufvec *bufv,
41 enum fuse_buf_copy_flags flags);
42int fuse_send_msg_uring(fuse_req_t req, struct iovec *iov, int count);
43
44#else // HAVE_URING
45
46static inline int fuse_uring_start(struct fuse_session *se FUSE_VAR_UNUSED)
47{
48 return -ENOTSUP;
49}
50
51static inline void
52fuse_uring_wake_ring_threads(struct fuse_session *se FUSE_VAR_UNUSED)
53{
54}
55
56static inline int fuse_uring_stop(struct fuse_session *se FUSE_VAR_UNUSED)
57{
58 return -ENOTSUP;
59}
60
61static inline int send_reply_uring(fuse_req_t req FUSE_VAR_UNUSED,
62 int error FUSE_VAR_UNUSED,
63 const void *arg FUSE_VAR_UNUSED,
64 size_t argsize FUSE_VAR_UNUSED)
65{
66 return -ENOTSUP;
67}
68
69static inline int
70fuse_reply_data_uring(fuse_req_t req FUSE_VAR_UNUSED,
71 struct fuse_bufvec *bufv FUSE_VAR_UNUSED,
72 enum fuse_buf_copy_flags flags FUSE_VAR_UNUSED)
73{
74 return -ENOTSUP;
75}
76
77static inline int fuse_send_msg_uring(fuse_req_t req FUSE_VAR_UNUSED,
78 struct iovec *iov FUSE_VAR_UNUSED,
79 int count FUSE_VAR_UNUSED)
80{
81 return -ENOTSUP;
82}
83
84#endif // HAVE_URING
85
86#endif // FUSE_URING_I_H_
fuse_buf_copy_flags
struct fuse_req * fuse_req_t