Linux io-uring development
 help / color / mirror / Atom feed
From: Gabriel Krisman Bertazi <krisman@suse.de>
To: axboe@kernel.dk
Cc: io-uring@vger.kernel.org, asml.silence@gmail.com,
	Gabriel Krisman Bertazi <krisman@suse.de>
Subject: [PATCH liburing v2 1/5] liburing: Add helper to prepare IORING_OP_BIND command
Date: Tue, 23 Jul 2024 19:17:29 -0400	[thread overview]
Message-ID: <20240723231733.31884-2-krisman@suse.de> (raw)
In-Reply-To: <20240723231733.31884-1-krisman@suse.de>

Signed-off-by: Gabriel Krisman Bertazi <krisman@suse.de>
---
 src/include/liburing.h          | 7 +++++++
 src/include/liburing/io_uring.h | 1 +
 src/liburing-ffi.map            | 1 +
 3 files changed, 9 insertions(+)

diff --git a/src/include/liburing.h b/src/include/liburing.h
index e8626f0..04cb65c 100644
--- a/src/include/liburing.h
+++ b/src/include/liburing.h
@@ -669,6 +669,13 @@ IOURINGINLINE void io_uring_prep_connect(struct io_uring_sqe *sqe, int fd,
 	io_uring_prep_rw(IORING_OP_CONNECT, sqe, fd, addr, 0, addrlen);
 }
 
+IOURINGINLINE void io_uring_prep_bind(struct io_uring_sqe *sqe, int fd,
+				      struct sockaddr *addr,
+				      socklen_t addrlen)
+{
+	io_uring_prep_rw(IORING_OP_BIND, sqe, fd, addr, 0, addrlen);
+}
+
 IOURINGINLINE void io_uring_prep_files_update(struct io_uring_sqe *sqe,
 					      int *fds, unsigned nr_fds,
 					      int offset)
diff --git a/src/include/liburing/io_uring.h b/src/include/liburing/io_uring.h
index 9330733..177ace6 100644
--- a/src/include/liburing/io_uring.h
+++ b/src/include/liburing/io_uring.h
@@ -257,6 +257,7 @@ enum io_uring_op {
 	IORING_OP_FUTEX_WAITV,
 	IORING_OP_FIXED_FD_INSTALL,
 	IORING_OP_FTRUNCATE,
+	IORING_OP_BIND,
 
 	/* this goes last, obviously */
 	IORING_OP_LAST,
diff --git a/src/liburing-ffi.map b/src/liburing-ffi.map
index 0e4bd9d..de2cb09 100644
--- a/src/liburing-ffi.map
+++ b/src/liburing-ffi.map
@@ -201,4 +201,5 @@ LIBURING_2.6 {
 LIBURING_2.7 {
 		io_uring_prep_fadvise64;
 		io_uring_prep_madvise64;
+		io_uring_prep_bind;
 } LIBURING_2.6;
-- 
2.45.2


  reply	other threads:[~2024-07-23 23:17 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-23 23:17 [PATCH liburing v2 0/5] IORING_OP_BIND/LISTEN support Gabriel Krisman Bertazi
2024-07-23 23:17 ` Gabriel Krisman Bertazi [this message]
2024-07-23 23:17 ` [PATCH liburing v2 2/5] liburing: Add helper to prepare IORING_OP_LISTEN command Gabriel Krisman Bertazi
2024-07-23 23:17 ` [PATCH liburing v2 3/5] tests: Add test for bind/listen commands Gabriel Krisman Bertazi
2024-07-23 23:17 ` [PATCH liburing v2 4/5] man/io_uring_prep_bind.3: Document the IORING_OP_BIND operation Gabriel Krisman Bertazi
2024-07-23 23:17 ` [PATCH liburing v2 5/5] man/io_uring_prep_listen.3: Document IORING_OP_LISTEN operation Gabriel Krisman Bertazi
2024-07-24  0:22 ` [PATCH liburing v2 0/5] IORING_OP_BIND/LISTEN support 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=20240723231733.31884-2-krisman@suse.de \
    --to=krisman@suse.de \
    --cc=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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox