From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gnuweeb.org (unknown [103.31.38.59]) by teainside.org (Postfix) with ESMTPS id 1D0F37ECA5 for ; Sat, 29 Jan 2022 13:03:26 +0000 (UTC) Received: from integral2.. (unknown [36.81.38.25]) by gnuweeb.org (Postfix) with ESMTPSA id 7BC32C32BD; Sat, 29 Jan 2022 13:03:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=gnuweeb.org; s=default; t=1643461401; bh=/1T2B7uj38XWhZu+Pu1N5081eSZLYd6hVvWWUjEzQ8o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DNyRqeGbxKG+smEQDZjMeUjUQkXjH+77TtSKlncLItJoLgPi2Tx5ovEk5cI3TmM7n 20ai42odw0MGaOKZiAuO+aB7WnBPTVRBjFXMn4lJ5PzPt1/yfoDQiDhuNU6uPJjOlH tcl7jDiV20U6sx9iu1H66idQQyfjEN/CoCLZrJU6gnatAsELHiCHszvXsITM3+VhVO j9WT+6WDdXGfllEfkFov9T7bPe+eXkF5RUINabKS7PwTq5HHeMUIqAcfRguRruSJea qrmxWJHEiICRfIeMmHQQn9vFQ1Yas0SrGt87yLGvJl4SzzqRjivr+KiR7wgOMfulYg 8tTBUJOsOy1SQ== From: Ammar Faizi To: Jens Axboe Cc: Ammar Faizi , io-uring Mailing List , netdev Mailing List , GNU/Weeb Mailing List , Tea Inside Mailing List , Linux Kernel Mailing List , Pavel Begunkov , "David S. Miller" , Jakub Kicinski , Nugra , Praveen Kumar , Alviro Iskandar Setiawan , Ammar Faizi 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 Message-Id: <20220129125021.15223-3-ammarfaizi2@gnuweeb.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220129125021.15223-1-ammarfaizi2@gnuweeb.org> References: <20220129125021.15223-1-ammarfaizi2@gnuweeb.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: 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" Cc: Jakub Kicinski Cc: netdev@vger.kernel.org Cc: Nugra Cc: Alviro Iskandar Setiawan Signed-off-by: Ammar Faizi --- 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