diff mbox series

[v2,3/7] fuse: {uring} Add struct fuse_req parameter to several functions

Message ID 20250125-optimize-fuse-uring-req-timeouts-v2-3-7771a2300343@ddn.com (mailing list archive)
State New
Headers show
Series fuse: {io-uring} Ensure fuse requests are set/read with locks | expand

Commit Message

Bernd Schubert Jan. 25, 2025, 5:43 p.m. UTC
This is just a preparation for the follow up commit and adds
'struct fuse_req *' as parameter these functions

fuse_uring_prepare_send
fuse_uring_send_next_to_ring

Signed-off-by: Bernd Schubert <bschubert@ddn.com>
---
 fs/fuse/dev_uring.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)
diff mbox series

Patch

diff --git a/fs/fuse/dev_uring.c b/fs/fuse/dev_uring.c
index 3f2aef702694444cb3b817fd2f58b898a0af86bd..62a063fda3951d29c27f95c1941a06f38f7b8248 100644
--- a/fs/fuse/dev_uring.c
+++ b/fs/fuse/dev_uring.c
@@ -675,9 +675,9 @@  static int fuse_uring_copy_to_ring(struct fuse_ring_ent *ent,
 	return 0;
 }
 
-static int fuse_uring_prepare_send(struct fuse_ring_ent *ent)
+static int fuse_uring_prepare_send(struct fuse_ring_ent *ent,
+				   struct fuse_req *req)
 {
-	struct fuse_req *req = ent->fuse_req;
 	int err;
 
 	err = fuse_uring_copy_to_ring(ent, req);
@@ -695,13 +695,14 @@  static int fuse_uring_prepare_send(struct fuse_ring_ent *ent)
  * This is comparable with classical read(/dev/fuse)
  */
 static int fuse_uring_send_next_to_ring(struct fuse_ring_ent *ent,
+					struct fuse_req *req,
 					unsigned int issue_flags)
 {
 	struct fuse_ring_queue *queue = ent->queue;
 	int err;
 	struct io_uring_cmd *cmd;
 
-	err = fuse_uring_prepare_send(ent);
+	err = fuse_uring_prepare_send(ent, req);
 	if (err)
 		return err;
 
@@ -838,7 +839,8 @@  static void fuse_uring_next_fuse_req(struct fuse_ring_ent *ent,
 	spin_unlock(&queue->lock);
 
 	if (has_next) {
-		err = fuse_uring_send_next_to_ring(ent, issue_flags);
+		err = fuse_uring_send_next_to_ring(ent, ent->fuse_req,
+						   issue_flags);
 		if (err)
 			goto retry;
 	}
@@ -1205,7 +1207,7 @@  static void fuse_uring_send_in_task(struct io_uring_cmd *cmd,
 	int err;
 
 	if (!(issue_flags & IO_URING_F_TASK_DEAD)) {
-		err = fuse_uring_prepare_send(ent);
+		err = fuse_uring_prepare_send(ent, ent->fuse_req);
 		if (err) {
 			fuse_uring_next_fuse_req(ent, queue, issue_flags);
 			return;