[PATCH] net: move â__zerocopy_sg_from_iterâ prototype to header file <linux/skbuff.h>

From: Mathieu Malaterre
Date: Wed Oct 31 2018 - 07:35:15 EST

This makes it clear the function is part of the API. Also this will
remove a warning triggered at W=1:

net/core/datagram.c:581:5: warning: no previous prototype for â__zerocopy_sg_from_iterâ [-Wmissing-prototypes]

Signed-off-by: Mathieu Malaterre <malat@xxxxxxxxxx>
include/linux/skbuff.h | 2 ++
net/core/skbuff.c | 3 ---
2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 0ba687454267..cca7c0a3c176 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -3311,6 +3311,8 @@ int skb_copy_and_csum_datagram_msg(struct sk_buff *skb, int hlen,
struct msghdr *msg);
int skb_copy_datagram_from_iter(struct sk_buff *skb, int offset,
struct iov_iter *from, int len);
+int __zerocopy_sg_from_iter(struct sock *sk, struct sk_buff *skb,
+ struct iov_iter *from, size_t length);
int zerocopy_sg_from_iter(struct sk_buff *skb, struct iov_iter *frm);
void skb_free_datagram(struct sock *sk, struct sk_buff *skb);
void __skb_free_datagram_locked(struct sock *sk, struct sk_buff *skb, int len);
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 946de0e24c87..7eb7e0e104d4 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -1102,9 +1102,6 @@ void sock_zerocopy_put_abort(struct ubuf_info *uarg)

-extern int __zerocopy_sg_from_iter(struct sock *sk, struct sk_buff *skb,
- struct iov_iter *from, size_t length);
int skb_zerocopy_iter_stream(struct sock *sk, struct sk_buff *skb,
struct msghdr *msg, int len,
struct ubuf_info *uarg)