netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH] net: introduce helper macra CMSG_FOREACH_HDR
       [not found] <1416799125-13972-1-git-send-email-guz.fnst@cn.fujitsu.com>
@ 2014-11-24  5:55 ` David Miller
  2014-11-24  6:08   ` Gu Zheng
  2014-12-05  7:14 ` [RESEND PATCH] net/socket.c : introduce helper function do_sock_sendmsg to replace reduplicate code Gu Zheng
  1 sibling, 1 reply; 4+ messages in thread
From: David Miller @ 2014-11-24  5:55 UTC (permalink / raw)
  To: guz.fnst; +Cc: netdev, linux-kernel


Your postings do not make it to the mailing list, in fact they don't
even make it to the list server itself.

Generally speaking, sites in China have this problem off and on, and
in unpredictable ways.

You need to sort this out because I will not apply patches that don't
hit the mailing list for review.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] net: introduce helper macra CMSG_FOREACH_HDR
  2014-11-24  5:55 ` [PATCH] net: introduce helper macra CMSG_FOREACH_HDR David Miller
@ 2014-11-24  6:08   ` Gu Zheng
  0 siblings, 0 replies; 4+ messages in thread
From: Gu Zheng @ 2014-11-24  6:08 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, linux-kernel

Hi David,
On 11/24/2014 01:55 PM, David Miller wrote:

> 
> Your postings do not make it to the mailing list, in fact they don't
> even make it to the list server itself.

Thanks for your reminder.

> 
> Generally speaking, sites in China have this problem off and on, and
> in unpredictable ways.

Seems we should say thanks to GFW... 

> 
> You need to sort this out because I will not apply patches that don't
> hit the mailing list for review.

I'll confirm it first, and resent the patches once the problem is gone.

Regards,
Gu

> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [RESEND PATCH] net/socket.c : introduce helper function do_sock_sendmsg to replace reduplicate code
       [not found] <1416799125-13972-1-git-send-email-guz.fnst@cn.fujitsu.com>
  2014-11-24  5:55 ` [PATCH] net: introduce helper macra CMSG_FOREACH_HDR David Miller
@ 2014-12-05  7:14 ` Gu Zheng
  2014-12-09 20:24   ` David Miller
  1 sibling, 1 reply; 4+ messages in thread
From: Gu Zheng @ 2014-12-05  7:14 UTC (permalink / raw)
  To: davem; +Cc: netdev, linux-kernel, Gu Zheng

Introduce helper function do_sock_sendmsg() to simplify sock_sendmsg{_nosec},
and replace reduplicate code.

Signed-off-by: Gu Zheng <guz.fnst@cn.fujitsu.com>
---
 net/socket.c |   22 ++++++++++------------
 1 files changed, 10 insertions(+), 12 deletions(-)

diff --git a/net/socket.c b/net/socket.c
index fe20c31..2a6f3c6 100644
--- a/net/socket.c
+++ b/net/socket.c
@@ -651,7 +651,8 @@ static inline int __sock_sendmsg(struct kiocb *iocb, struct socket *sock,
 	return err ?: __sock_sendmsg_nosec(iocb, sock, msg, size);
 }
 
-int sock_sendmsg(struct socket *sock, struct msghdr *msg, size_t size)
+static int do_sock_sendmsg(struct socket *sock, struct msghdr *msg,
+			   size_t size, bool nosec)
 {
 	struct kiocb iocb;
 	struct sock_iocb siocb;
@@ -659,25 +660,22 @@ int sock_sendmsg(struct socket *sock, struct msghdr *msg, size_t size)
 
 	init_sync_kiocb(&iocb, NULL);
 	iocb.private = &siocb;
-	ret = __sock_sendmsg(&iocb, sock, msg, size);
+	ret = nosec ? __sock_sendmsg_nosec(&iocb, sock, msg, size) :
+		      __sock_sendmsg(&iocb, sock, msg, size);
 	if (-EIOCBQUEUED == ret)
 		ret = wait_on_sync_kiocb(&iocb);
 	return ret;
 }
+
+int sock_sendmsg(struct socket *sock, struct msghdr *msg, size_t size)
+{
+	return do_sock_sendmsg(sock, msg, size, false);
+}
 EXPORT_SYMBOL(sock_sendmsg);
 
 static int sock_sendmsg_nosec(struct socket *sock, struct msghdr *msg, size_t size)
 {
-	struct kiocb iocb;
-	struct sock_iocb siocb;
-	int ret;
-
-	init_sync_kiocb(&iocb, NULL);
-	iocb.private = &siocb;
-	ret = __sock_sendmsg_nosec(&iocb, sock, msg, size);
-	if (-EIOCBQUEUED == ret)
-		ret = wait_on_sync_kiocb(&iocb);
-	return ret;
+	return do_sock_sendmsg(sock, msg, size, true);
 }
 
 int kernel_sendmsg(struct socket *sock, struct msghdr *msg,
-- 
1.7.7

.

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [RESEND PATCH] net/socket.c : introduce helper function do_sock_sendmsg to replace reduplicate code
  2014-12-05  7:14 ` [RESEND PATCH] net/socket.c : introduce helper function do_sock_sendmsg to replace reduplicate code Gu Zheng
@ 2014-12-09 20:24   ` David Miller
  0 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2014-12-09 20:24 UTC (permalink / raw)
  To: guz.fnst; +Cc: netdev, linux-kernel

From: Gu Zheng <guz.fnst@cn.fujitsu.com>
Date: Fri, 5 Dec 2014 15:14:23 +0800

> Introduce helper function do_sock_sendmsg() to simplify sock_sendmsg{_nosec},
> and replace reduplicate code.
> 
> Signed-off-by: Gu Zheng <guz.fnst@cn.fujitsu.com>

Applied, thanks.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-12-09 20:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1416799125-13972-1-git-send-email-guz.fnst@cn.fujitsu.com>
2014-11-24  5:55 ` [PATCH] net: introduce helper macra CMSG_FOREACH_HDR David Miller
2014-11-24  6:08   ` Gu Zheng
2014-12-05  7:14 ` [RESEND PATCH] net/socket.c : introduce helper function do_sock_sendmsg to replace reduplicate code Gu Zheng
2014-12-09 20:24   ` David Miller

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).