diff options
author | Bernd Schubert <bschubert@ddn.com> | 2025-05-28 15:13:47 +0200 |
---|---|---|
committer | Bernd Schubert <bernd@bsbernd.com> | 2025-08-22 23:07:24 +0200 |
commit | d52ae4f9d44d7e08375bfacac0bc7cc02ad1b54b (patch) | |
tree | 4a0e084061d7e5305c4eee54ce062118eeda3854 /include | |
parent | 253ea916fd5122e1c182cb3ffbff1ac2eeea3991 (diff) | |
download | libfuse-d52ae4f9d44d7e08375bfacac0bc7cc02ad1b54b.tar.gz |
Allow applications to retrieve the req payload (io-uring only)
With io-uring the req owns the payload buffer, the application
can directly access it and copy data into it.
fuse_buf_copy_one() already has a check for dstmem == srcmem
and skips data copies.
fuse_reply_data
fuse_reply_data_uring
fuse_buf_copy
fuse_buf_copy_one
Signed-off-by: Bernd Schubert <bschubert@ddn.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/fuse_lowlevel.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/include/fuse_lowlevel.h b/include/fuse_lowlevel.h index 844ee71..dc4ec07 100644 --- a/include/fuse_lowlevel.h +++ b/include/fuse_lowlevel.h @@ -2367,6 +2367,24 @@ int fuse_session_receive_buf(struct fuse_session *se, struct fuse_buf *buf); */ bool fuse_req_is_uring(fuse_req_t req); +/** + * Get the payload of a request + * (for requests submitted through fuse-io-uring only) + * + * This is useful for a file system that wants to write data directly + * to the request buffer. With io-uring the req is the buffer owner + * and the file system can write directly to the buffer and avoid + * extra copying. For example useful for network file systems. + * + * @param req the request + * @param payload pointer to the payload + * @param payload_sz size of the payload + * @param mr memory registration handle, currently unused + * @return 0 on success, -errno on failure + */ +int fuse_req_get_payload(fuse_req_t req, char **payload, size_t *payload_sz, + void **mr); + #ifdef __cplusplus } #endif |