public inbox for [email protected]
 help / color / mirror / Atom feed
From: Ammar Faizi <[email protected]>
To: Jens Axboe <[email protected]>
Cc: Ammar Faizi <[email protected]>,
	io-uring Mailing List <[email protected]>,
	netdev Mailing List <[email protected]>,
	GNU/Weeb Mailing List <[email protected]>,
	Tea Inside Mailing List <[email protected]>,
	Linux Kernel Mailing List <[email protected]>,
	Pavel Begunkov <[email protected]>,
	"David S. Miller" <[email protected]>,
	Jakub Kicinski <[email protected]>, Nugra <[email protected]>,
	Praveen Kumar <[email protected]>,
	Alviro Iskandar Setiawan <[email protected]>,
	Ammar Faizi <[email protected]>
Subject: [PATCH for-5.18 v1 1/3] io_uring: Rename `io_{send,recv}` to `io_{sendto,recvfrom}`
Date: Sat, 29 Jan 2022 19:50:19 +0700	[thread overview]
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>

This is a preparation to add sendto() and recvfrom() support for
io_uring.
_____________________________________________________
The following call

    send(sockfd, buf, len, flags);

is equivalent to

    sendto(sockfd, buf, len, flags, NULL, 0);
_____________________________________________________
The following call

    recv(sockfd, buf, len, flags);

is equivalent to

    recvfrom(sockfd, buf, len, flags, NULL, NULL);
_____________________________________________________

Currently, io_uring supports send() and recv() operation. Now, we are
going to add sendto() and recvfrom() support. Since the latter is the
superset of the former, change the function name to the latter.

This renames:
  - io_send() to io_sendto()
  - io_recv() to io_recvfrom()

Cc: Nugra <[email protected]>
Cc: Alviro Iskandar Setiawan <[email protected]>
Signed-off-by: Ammar Faizi <[email protected]>
---
v1:
  - Rebase the work (sync with "io_uring-5.17" branch in Jens' tree).
  - Reword the commit message.
  - Add Alviro Iskandar Setiawan to CC list (tester).

RFC v4:
  - Rebase the work (sync with "for-next" branch in Jens' tree).

RFC v3:
  - Fix build error when CONFIG_NET is undefined for PATCH 1/3. I
    tried to fix it in PATCH 3/3, but it should be fixed in PATCH 1/3,
    otherwise it breaks the build in PATCH 1/3.

RFC v2:
  - Add Nugra to CC list (tester).

---
---
 fs/io_uring.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/fs/io_uring.c b/fs/io_uring.c
index 2e04f718319d..742e252a052a 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -4961,7 +4961,7 @@ static int io_sendmsg(struct io_kiocb *req, unsigned int issue_flags)
 	return 0;
 }
 
-static int io_send(struct io_kiocb *req, unsigned int issue_flags)
+static int io_sendto(struct io_kiocb *req, unsigned int issue_flags)
 {
 	struct io_sr_msg *sr = &req->sr_msg;
 	struct msghdr msg;
@@ -5187,7 +5187,7 @@ static int io_recvmsg(struct io_kiocb *req, unsigned int issue_flags)
 	return 0;
 }
 
-static int io_recv(struct io_kiocb *req, unsigned int issue_flags)
+static int io_recvfrom(struct io_kiocb *req, unsigned int issue_flags)
 {
 	struct io_buffer *kbuf;
 	struct io_sr_msg *sr = &req->sr_msg;
@@ -5395,8 +5395,8 @@ IO_NETOP_PREP_ASYNC(sendmsg);
 IO_NETOP_PREP_ASYNC(recvmsg);
 IO_NETOP_PREP_ASYNC(connect);
 IO_NETOP_PREP(accept);
-IO_NETOP_FN(send);
-IO_NETOP_FN(recv);
+IO_NETOP_FN(sendto);
+IO_NETOP_FN(recvfrom);
 #endif /* CONFIG_NET */
 
 struct io_poll_table {
@@ -6771,13 +6771,13 @@ static int io_issue_sqe(struct io_kiocb *req, unsigned int issue_flags)
 		ret = io_sendmsg(req, issue_flags);
 		break;
 	case IORING_OP_SEND:
-		ret = io_send(req, issue_flags);
+		ret = io_sendto(req, issue_flags);
 		break;
 	case IORING_OP_RECVMSG:
 		ret = io_recvmsg(req, issue_flags);
 		break;
 	case IORING_OP_RECV:
-		ret = io_recv(req, issue_flags);
+		ret = io_recvfrom(req, issue_flags);
 		break;
 	case IORING_OP_TIMEOUT:
 		ret = io_timeout(req, issue_flags);
-- 
2.32.0


  reply	other threads:[~2022-01-29 13:03 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-29 12:50 [PATCH for-5.18 v1 0/3] Add `sendto(2)` and `recvfrom(2)` support Ammar Faizi
2022-01-29 12:50 ` Ammar Faizi [this message]
2022-01-29 12:50 ` [PATCH for-5.18 v1 2/3] net: Make `move_addr_to_user()` be a non static function Ammar Faizi
2022-01-29 12:50 ` [PATCH for-5.18 v1 3/3] io_uring: Add `sendto(2)` and `recvfrom(2)` support Ammar Faizi
2022-01-29 18:32 ` [PATCH for-5.18 v1 0/3] " Jens Axboe
2022-01-29 23:30   ` Ammar Faizi

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 \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    /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