diff mbox series

[for-5.18,v1,2/3] net: Make `move_addr_to_user()` be a non static function

Message ID 20220129125021.15223-3-ammarfaizi2@gnuweeb.org (mailing list archive)
State Not Applicable
Delegated to: Netdev Maintainers
Headers show
Series [for-5.18,v1,1/3] io_uring: Rename `io_{send,recv}` to `io_{sendto,recvfrom}` | expand

Checks

Context Check Description
netdev/fixes_present success Fixes tag not required for -next series
netdev/subject_prefix success Link
netdev/cover_letter success Pull request is its own cover letter
netdev/patch_count success Link
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 6763 this patch: 6763
netdev/cc_maintainers warning 1 maintainers not CCed: dong.menglong@zte.com.cn
netdev/build_clang success Errors and warnings before: 1471 this patch: 1471
netdev/module_param success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 12040 this patch: 12040
netdev/checkpatch warning CHECK: extern prototypes should be avoided in .h files
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/tree_selection success Guessing tree name failed - patch did not apply, async

Commit Message

Ammar Faizi Jan. 29, 2022, 12:50 p.m. UTC
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 mbox series

Patch

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;