Skip to contentSkip to conversation

net: introduce helper macra CMSG_FOREACH_HDR

PATCH Applied David Miller 2 participants 4 messages Nov 24, 2014 – Dec 9, 2014 1 message not in the archive

Subsystems (3)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

David Miller

author maintainer
#1 lore raw

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.

#2 lore raw

Hi David,

Quoted 3 lines · David Miller

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.

Quoted 3 lines

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

Seems we should say thanks to GFW...

Quoted 3 lines

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

Quoted 1 line
#3 lore raw

PATCH RESEND 1/1 net/socket.c : introduce helper function do_sock_sendmsg to replace reduplicate code

In reply to a message not in the archive

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

---
 net/socket.c |   22 ++++++++++------------
 1 files changed, 10 insertions(+), 12 deletions(-)
net/socket.c +10 -12
index fe20c31..2a6f3c6 100644
@@ -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,
Signature · 3 lines
1.7.7

.
author maintainer Applied
#4 lore raw

Re: [RESEND PATCH] net/socket.c : introduce helper function do_sock_sendmsg to replace reduplicate code

From: Gu Zheng <[email protected]>
Date: Fri, 5 Dec 2014 15:14:23 +0800

Quoted 4 lines

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

Applied, thanks.