From: Ammar Faizi <ammarfaizi2@gnuweeb.org>
To: Jens Axboe <axboe@kernel.dk>
Cc: Ammar Faizi <ammarfaizi2@gnuweeb.org>,
io-uring Mailing List <io-uring@vger.kernel.org>,
netdev Mailing List <netdev@vger.kernel.org>,
GNU/Weeb Mailing List <gwml@gnuweeb.org>,
Tea Inside Mailing List <timl@vger.teainside.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Pavel Begunkov <asml.silence@gmail.com>,
"David S. Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>, Nugra <richiisei@gmail.com>,
Praveen Kumar <kpraveen.lkml@gmail.com>,
Alviro Iskandar Setiawan <alviro.iskandar@gmail.com>,
Ammar Faizi <ammarfaizi2@gmail.com>
Subject: [PATCH for-5.18 v1 2/3] net: Make `move_addr_to_user()` be a non static function
Date: Sat, 29 Jan 2022 19:50:20 +0700 [thread overview]
Message-ID: <20220129125021.15223-3-ammarfaizi2@gnuweeb.org> (raw)
In-Reply-To: <20220129125021.15223-1-ammarfaizi2@gnuweeb.org>
To add recvfrom() support for io_uring, we need to call
move_addr_to_user() from fs/io_uring.c.
This makes move_addr_to_user() be a non static function so we can call
it from io_uring.
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Jakub Kicinski <kuba@kernel.org>
Cc: netdev@vger.kernel.org
Cc: Nugra <richiisei@gmail.com>
Cc: Alviro Iskandar Setiawan <alviro.iskandar@gmail.com>
Signed-off-by: Ammar Faizi <ammarfaizi2@gnuweeb.org>
---
v1:
- Add Alviro Iskandar Setiawan to CC list (tester).
RFC v4:
* No changes *
RFC v3:
* No changes *
RFC v2:
- Added Nugra to CC list (tester).
---
---
include/linux/socket.h | 2 ++
net/socket.c | 4 ++--
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/include/linux/socket.h b/include/linux/socket.h
index 8ef26d89ef49..0d0bc1ace50c 100644
--- a/include/linux/socket.h
+++ b/include/linux/socket.h
@@ -371,6 +371,8 @@ struct ucred {
#define IPX_TYPE 1
extern int move_addr_to_kernel(void __user *uaddr, int ulen, struct sockaddr_storage *kaddr);
+extern int move_addr_to_user(struct sockaddr_storage *kaddr, int klen,
+ void __user *uaddr, int __user *ulen);
extern int put_cmsg(struct msghdr*, int level, int type, int len, void *data);
struct timespec64;
diff --git a/net/socket.c b/net/socket.c
index 50cf75730fd7..9bc586ab4e93 100644
--- a/net/socket.c
+++ b/net/socket.c
@@ -268,8 +268,8 @@ int move_addr_to_kernel(void __user *uaddr, int ulen, struct sockaddr_storage *k
* specified. Zero is returned for a success.
*/
-static int move_addr_to_user(struct sockaddr_storage *kaddr, int klen,
- void __user *uaddr, int __user *ulen)
+int move_addr_to_user(struct sockaddr_storage *kaddr, int klen,
+ void __user *uaddr, int __user *ulen)
{
int err;
int len;
--
2.32.0
next prev parent 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 ` [PATCH for-5.18 v1 1/3] io_uring: Rename `io_{send,recv}` to `io_{sendto,recvfrom}` Ammar Faizi
2022-01-29 12:50 ` Ammar Faizi [this message]
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 \
--in-reply-to=20220129125021.15223-3-ammarfaizi2@gnuweeb.org \
--to=ammarfaizi2@gnuweeb.org \
--cc=alviro.iskandar@gmail.com \
--cc=ammarfaizi2@gmail.com \
--cc=asml.silence@gmail.com \
--cc=axboe@kernel.dk \
--cc=davem@davemloft.net \
--cc=gwml@gnuweeb.org \
--cc=io-uring@vger.kernel.org \
--cc=kpraveen.lkml@gmail.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=richiisei@gmail.com \
--cc=timl@vger.teainside.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;
as well as URLs for NNTP newsgroup(s).