All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pavel Begunkov <asml.silence@gmail.com>
To: io-uring@vger.kernel.org
Cc: Jens Axboe <axboe@kernel.dk>, asml.silence@gmail.com
Subject: [PATCH liburing 1/2] Add io_uring_prep_msg_ring_fd_alloc() helper
Date: Thu, 16 Mar 2023 13:09:20 +0000	[thread overview]
Message-ID: <9237f9399e4d8fcc9c8c1996905168138f99d2b3.1678968783.git.asml.silence@gmail.com> (raw)
In-Reply-To: <cover.1678968783.git.asml.silence@gmail.com>

Add a helper initialising msg-ring requests transferring files and
allocating a target file index.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
---
 src/include/liburing.h | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/src/include/liburing.h b/src/include/liburing.h
index bf48141..0848cf0 100644
--- a/src/include/liburing.h
+++ b/src/include/liburing.h
@@ -1015,6 +1015,15 @@ IOURINGINLINE void io_uring_prep_msg_ring_fd(struct io_uring_sqe *sqe, int fd,
 	sqe->msg_ring_flags = flags;
 }
 
+IOURINGINLINE void io_uring_prep_msg_ring_fd_alloc(struct io_uring_sqe *sqe,
+						   int fd, int source_fd,
+						   __u64 data, unsigned int flags)
+{
+	io_uring_prep_msg_ring_fd(sqe, fd, source_fd,
+				  IORING_FILE_INDEX_ALLOC - 1,
+				  data, flags);
+}
+
 IOURINGINLINE void io_uring_prep_getxattr(struct io_uring_sqe *sqe,
 					  const char *name, char *value,
 					  const char *path, unsigned int len)
-- 
2.39.1


  reply	other threads:[~2023-03-16 13:10 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-16 13:09 [PATCH liburing for-next 0/2] fd msg-ring slot allocation tests Pavel Begunkov
2023-03-16 13:09 ` Pavel Begunkov [this message]
2023-03-16 15:01   ` [PATCH liburing 1/2] Add io_uring_prep_msg_ring_fd_alloc() helper Jens Axboe
2023-03-16 13:09 ` [PATCH liburing 2/2] test: test fd msg-ring allocating indexes Pavel Begunkov
2023-03-16 15:02 ` [PATCH liburing for-next 0/2] fd msg-ring slot allocation tests Jens Axboe

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=9237f9399e4d8fcc9c8c1996905168138f99d2b3.1678968783.git.asml.silence@gmail.com \
    --to=asml.silence@gmail.com \
    --cc=axboe@kernel.dk \
    --cc=io-uring@vger.kernel.org \
    /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.