From: Kevin Wolf <kwolf@redhat.com>
To: Brian Song <hibriansong@gmail.com>
Cc: Stefan Hajnoczi <stefanha@redhat.com>,
qemu-block@nongnu.org, qemu-devel@nongnu.org, armbru@redhat.com,
bschubert@ddn.com, fam@euphon.net, hreitz@redhat.com
Subject: Re: [PATCH RFC 1/1] block/export: FUSE-over-io_uring Support for QEMU FUSE Exports
Date: Tue, 22 Jul 2025 17:17:11 +0200 [thread overview]
Message-ID: <aH-rdx4HisUvpu6-@redhat.com> (raw)
In-Reply-To: <CAKWCU7WEv=qohQJ6XUzHS9ffHN8gT0yuRZojmrTgpqja3ghaiw@mail.gmail.com>
Am 22.07.2025 um 14:00 hat Brian Song geschrieben:
> On 7/20/25 8:53 PM, Stefan Hajnoczi wrote:
> > On Wed, Jul 16, 2025 at 02:38:24PM -0400, Brian Song wrote:
> >> + case FUSE_FSYNC:
> >> + ret = fuse_co_fsync(exp);
> >> + break;
> >> +
> >> + case FUSE_FLUSH:
> >> + ret = fuse_co_flush(exp);
> >> + break;
> >> +
> >> +#ifdef CONFIG_FUSE_LSEEK
> >> + case FUSE_LSEEK: {
> >> + const struct fuse_lseek_in *in =
> >> + (const struct fuse_lseek_in *)&rrh->op_in;
> >> + ret = fuse_co_lseek(exp, (struct fuse_lseek_out *)out_op_hdr,
> >> + in->offset, in->whence);
> >> + break;
> >> + }
> >> +#endif
> >> +
> >> + default:
> >> + ret = -ENOSYS;
> >> + }
> >
> > It would be nice to reuse the non-io_uring code rather than duplicating
> > the switch statement that covers each FUSE opcode. Is the memory layout
> > so different that the code cannot be shared?
>
> Yes. But I think the main issue is that we have to handle too many
> differences when it comes to various operations and the final step of
> replying to the request. There would be a lot of #ifdef
> CONFIG_LINUX_IO_URING and if statements. So, for simplicity, I made it a
> separate function.
>
> In the traditional model:
> q->request_buf = fuse_in_header + struct fuse_opsxx_in +
> FUSE_IN_PLACE_WRITE_BYTES (used for part of the payload data)
> q->spillover_buf is used for the rest of the payload data.
>
> In Fuse-over-io_uring:
> FuseRingEnt contains req_header (which includes in_out for
> fuse_in/out_header, and op_in for struct fuse_opsxx_in)
> op_payload corresponds to the final FUSE_IN_PLACE_WRITE_BYTES bytes from
> request_buf + spillover_buf in the traditional model but carries either
> the out operation headers (fuse_ops_out) or the file data to be written
> or read.
The individual opcode handlers you call from both functions are already
generic enough to work for both cases, e.g. fuse_co_write() takes both
an in_place_buf and spillover_buf. In the io_uring case you just pass
NULL for in_place_buf.
Why doesn't the same approach work for fuse_co_process_request()? Can't
you just pass three pointers for header, in_place_buf and spillover_buf
to it and have two very small wrappers around it that take care of
passing the right pointers for the respective case?
Kevin
next prev parent reply other threads:[~2025-07-22 16:05 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-16 18:38 [PATCH RFC 0/1] block/export: FUSE-over-io_uring Support for QEMU FUSE Exports Brian Song
2025-07-16 18:38 ` [PATCH RFC 1/1] " Brian Song
2025-07-17 6:03 ` Markus Armbruster
2025-07-22 12:00 ` Brian Song
2025-07-21 0:53 ` Stefan Hajnoczi
2025-07-22 12:00 ` Brian Song
2025-07-22 15:17 ` Kevin Wolf [this message]
2025-07-22 14:06 ` Bernd Schubert
2025-07-22 15:43 ` Stefan Hajnoczi
2025-07-22 16:20 ` Bernd Schubert
2025-07-21 13:51 ` Bernd Schubert
2025-07-21 18:26 ` Stefan Hajnoczi
2025-07-22 12:00 ` Brian Song
2025-07-22 14:51 ` Stefan Hajnoczi
2025-07-24 20:36 ` Stefan Hajnoczi
2025-07-22 13:32 ` Kevin Wolf
2025-12-10 22:10 ` Bernd Schubert
2025-12-11 4:40 ` Brian Song
2025-07-20 16:13 ` [PATCH RFC 0/1] " Stefan Hajnoczi
2025-07-22 12:00 ` Brian Song
2025-07-22 14:47 ` Stefan Hajnoczi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aH-rdx4HisUvpu6-@redhat.com \
--to=kwolf@redhat.com \
--cc=armbru@redhat.com \
--cc=bschubert@ddn.com \
--cc=fam@euphon.net \
--cc=hibriansong@gmail.com \
--cc=hreitz@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.