remove scm_cookie parameter to send/recvmsg
Subsystems (11)
Hey Dave, please do a
bk pull kernel.bkbits.net:/bcrl/net-2.5
The changeset removes the struct scm_cookie * from the esnd/recvmsg ops, as well as removing the struct from the sock_iocb. This helps speed up tcp_bw in LMbench by elimnating the excess memset and credentials setup and teardown. Cheers,
-ben
This will update the following files:
arch/ia64/ia32/sys_ia32.c | 5 +- arch/parisc/kernel/sys_parisc32.c | 6 ++- arch/ppc64/kernel/sys_ppc32.c | 6 ++- arch/s390x/kernel/linux32.c | 11 +++-- arch/sparc64/kernel/sys_sparc32.c | 5 +- arch/x86_64/ia32/socket32.c | 5 +- drivers/net/pppoe.c | 7 ++- fs/smbfs/sock.c | 72 ++---------------------------------- include/linux/net.h | 15 +++---- include/net/bluetooth/bluetooth.h | 2 - include/net/inet_common.h | 4 +- include/net/sock.h | 9 +--- net/appletalk/ddp.c | 4 +- net/atm/common.c | 4 +- net/atm/common.h | 4 +- net/ax25/af_ax25.c | 5 +- net/bluetooth/af_bluetooth.c | 2 - net/bluetooth/bnep/core.c | 29 +------------- net/bluetooth/hci_sock.c | 5 +- net/bluetooth/l2cap.c | 2 - net/bluetooth/rfcomm/core.c | 31 +-------------- net/bluetooth/rfcomm/sock.c | 5 +- net/bluetooth/sco.c | 2 - net/core/sock.c | 4 +- net/decnet/af_decnet.c | 4 +- net/econet/af_econet.c | 5 +- net/ipv4/af_inet.c | 4 +- net/ipx/af_ipx.c | 4 +- net/irda/af_irda.c | 22 +++++------ net/key/af_key.c | 5 +- net/llc/af_llc.c | 7 +-- net/netlink/af_netlink.c | 29 +++++++++++--- net/netrom/af_netrom.c | 5 +- net/packet/af_packet.c | 8 +--- net/rose/af_rose.c | 5 +- net/socket.c | 27 +++---------- net/unix/af_unix.c | 74 ++++++++++++++++++++++++++------------ net/wanrouter/af_wanpipe.c | 5 +- net/x25/af_x25.c | 4 +- 39 files changed, 178 insertions(+), 274 deletions(-)
through these ChangeSets:
<[email protected]> (03/01/20 1.946.1.1)
Remove struct scm_cookie * from socket send/recvmsg() ops. Credentials are only used by af_unix and af_netlink anyways, so by only using them in those paths we eliminate overhead from all other network protocols' fastpaths.
through these patches:
# This is a BitKeeper generated patch for the following project:
# Project Name: Linux kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas:
# ChangeSet 1.946 -> 1.946.1.1
# net/llc/af_llc.c 1.32 -> 1.33
# net/bluetooth/rfcomm/core.c 1.8 -> 1.9
# arch/x86_64/ia32/socket32.c 1.3 -> 1.4
# net/ipv4/af_inet.c 1.37 -> 1.38
# net/ipx/af_ipx.c 1.22 -> 1.23
# net/bluetooth/af_bluetooth.c 1.11 -> 1.12
# net/bluetooth/sco.c 1.8 -> 1.9 # net/key/af_key.c 1.12 -> 1.13 # net/irda/af_irda.c 1.35 -> 1.36 # arch/parisc/kernel/sys_parisc32.c 1.5 -> 1.6 # net/socket.c 1.41 -> 1.42 # fs/smbfs/sock.c 1.13 -> 1.14 # include/linux/net.h 1.7 -> 1.8
# include/net/bluetooth/bluetooth.h 1.10 -> 1.11
# net/econet/af_econet.c 1.12 -> 1.13
# net/netrom/af_netrom.c 1.21 -> 1.22
# net/rose/af_rose.c 1.18 -> 1.19
# net/netlink/af_netlink.c 1.15 -> 1.16
# net/decnet/af_decnet.c 1.20 -> 1.21
# net/bluetooth/hci_sock.c 1.14 -> 1.15
# arch/ia64/ia32/sys_ia32.c 1.36 -> 1.37
# net/unix/af_unix.c 1.34 -> 1.35
# arch/sparc64/kernel/sys_sparc32.c 1.59 -> 1.60
# drivers/net/pppoe.c 1.20 -> 1.21
# net/bluetooth/rfcomm/sock.c 1.9 -> 1.10
# net/packet/af_packet.c 1.18 -> 1.19
# net/bluetooth/bnep/core.c 1.9 -> 1.10
# net/bluetooth/l2cap.c 1.13 -> 1.14
# arch/ppc64/kernel/sys_ppc32.c 1.44 -> 1.45
# arch/s390x/kernel/linux32.c 1.33 -> 1.34
# include/net/sock.h 1.29 -> 1.30
# net/core/sock.c 1.14 -> 1.15
# include/net/inet_common.h 1.4 -> 1.5
# net/atm/common.h 1.2 -> 1.3 # net/ax25/af_ax25.c 1.17 -> 1.18 # net/x25/af_x25.c 1.21 -> 1.22
# net/wanrouter/af_wanpipe.c 1.13 -> 1.14
# net/appletalk/ddp.c 1.16 -> 1.17
# net/atm/common.c 1.11 -> 1.12
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 03/01/16 [email protected] 1.944.1.1
# [PATCH] alpha PCI setup update
#
# Until now, we were configuring all PCI resources from scratch. # This patch allows to use unchanged PCI setup on platforms
# where the firmware does it reasonably well (titan and marvel). # # [The patch to setup-bus.c that removes "FIXME" from here (ie makes # pci_assign_unassigned_resources to match its name) exists at least # for two months, but I've yet to convince Linus that it does the # right thing...] # # Ivan. # -------------------------------------------- # 03/01/16 [email protected] 1.944.1.2 # [PATCH] alpha_remap_area_pages # From [email protected]: # # Add arch/alpha/mm/remap.c (__alpha_remap_area_pages). # -------------------------------------------- # 03/01/16 [email protected] 1.944.1.3 # [PATCH] alpha titan update # From [email protected]: # # Update titan system support include AlphaServer DS25, AGP, # enhanced machine check handling. # -------------------------------------------- # 03/01/16 [email protected] 1.947 # Merge http://linux-voyager.bkbits.net/eisa-sysfs-2.5 # into home.transmeta.com:/home/torvalds/v2.5/linux # -------------------------------------------- # 03/01/16 [email protected] 1.944.1.4 # [ALPHA] Use direct calls to titan_ioremap/unmap when building # a titan specific kernel. # -------------------------------------------- # 03/01/16 [email protected] 1.944.1.5 # [PATCH] alpha irq proc update # From [email protected]: # # - Only create smp_affinity /proc nodes if a set_affinity handler # is provided. # - Limit the number of irq nodes that will be created in /proc # to avoid overfilling the /proc inode space. # -------------------------------------------- # 03/01/16 [email protected] 1.944.1.6 # [PATCH] alpha smp callin # From [email protected]: # # Add platform-specific callin for SMP. # -------------------------------------------- # 03/01/16 [email protected] 1.948 # [PATCH] x86_64 update # # x86-64 updates for 2.5.58. Changes only x86-64 specific files. # # - Rewrote module allocation. Lots of bugs fixed. Module loading # should work now again. # - Kconfig help fixes from Randy Dunlap # - Makefile cleanups from Pavel Machek and Sam Ravnborg # - Assembly cleanups from Pavel # - defconfig update # - Better strlen_user/strnlen_user # - Merge with i386: new ptrace commands, 32bit vsyscall signal trampolines # new deactivate_mm, add asm/bug.h # - Make sure initramfs is freed after booting (thanks to Kai for the hint) # - User per cpu data for profile counters (Ravikiran Thirumalai) # - 32bit compat_* updates from Stephen Rothwell # - Fix race in context switch. The exception handler for bogus segment # loads in __switch_to needs to keep interrupts disabled, otherwise an # interrupt can deadlock on scheduler locks. Also make sure they don't # printk or set oops_in_progress during printk because printk does a # wake_up too. # - Disable 64bit GS base changes for processes. I cannot get it to work # reliably. # - Clear IOPL on kernel entry # -------------------------------------------- # 03/01/16 [email protected] 1.949 # [PATCH] remove MOD_IN_USE # # Another left-over from ancient module code, it was supposed to return # non-zero if the module has a use count, but currently it always # evaluates to 0. # # There are a few users of different types: # (1) ioctl that perform a while(MOD_IN_USE) MOD_DEC_USE_COUNT loop. # Just rip them out, we now have forced module unloading. # (2) printk's that moan if the use-count in not zero in the exitfunc. # Just rip them out, this can't happen. # (3) if(MOD_IN_USE) MOD_DEC_USE_COUNT constructs in ->close of a few # serial drivers. Just remove the conditional, we did a # MOD_INC_USE_COUNT in ->open. # (4) This one is interesting: drivers/sbus/char/display7seg.c uses # the module use count to track openers. Replace this with an # atomic_t. # # In addition remove tons of stale comments in network driver that aren't # understandable for anyone who doesn't know ancient Linux module semantics. # -------------------------------------------- # 03/01/16 [email protected] 1.950 # [PATCH] (1/3) Minimal NUMA scheduler # # Patch from Martin J. Bligh # # This adds a small hook to the find_busiest_queue routine to allow us to # specify a mask of which CPUs to search over. In the NUMA case, it will # only balance inside the node (much cheaper to search, and stops tasks # from bouncing across nodes, which is very costly). The cpus_to_balance # routine is conditionally defined to ensure no impact to non-NUMA machines. # # This is a tiny NUMA scheduler, but it needs the assistance of the second # and third patches in order to spread tasks across nodes. # -------------------------------------------- # 03/01/16 [email protected] 1.951 # [PATCH] (2/3) Initial load balancing # # Patch from Michael Hohnbaum # # This adds a hook, sched_balance_exec(), to the exec code, to make it # place the exec'ed task on the least loaded queue. We have less state # to move at exec time than fork time, so this is the cheapest point # to cross-node migrate. Experience in Dynix/PTX and testing on Linux # has confirmed that this is the cheapest time to move tasks between nodes. # # It also macro-wraps changes to nr_running, to allow us to keep track of # per-node nr_running as well. Again, no impact on non-NUMA machines. # -------------------------------------------- # 03/01/16 [email protected] 1.952 # [PATCH] (3/3) NUMA rebalancer # # Patch from Erich Focht # # This adds a hook to rebalance globally across nodes every NODE_BALANCE_RATE # iterations of the rebalancer. This allows us to easily tune on an architecture # specific basis how often we wish to rebalance - machines with higher NUMA # ratios (more expensive off-node access) will want to do this less often. # It's currently set to 100 for NUMA-Q and 10 for other machines. If the # imbalance between nodes is > 125%, we'll rebalance them. The hook for this # is added to the NUMA definition of cpus_to_balance, so again, no impact # on non-NUMA machines. # -------------------------------------------- # 03/01/16 [email protected] 1.944.1.7 # [ALPHA] AGP infrastructure for AGP implemented in Alpha corelogic # (Titan / Marvel), Kconfig and headers. # # From Jeff Wiedemeier. # -------------------------------------------- # 03/01/16 [email protected] 1.944.1.8 # [ALPHA] Marvel (AlphaServer ES47, ES80, GS1280) support. # From [email protected]. # -------------------------------------------- # 03/01/16 [email protected] 1.944.1.9 # [ALPHA] Fixups to Marvel and Titan for incomplete merging # of AGP and SRMCONS patches. # -------------------------------------------- # 03/01/16 [email protected] 1.944.1.10 # [ALPHA] Formatting cleanup, warning removal, move declarations # to header files where they belong. # -------------------------------------------- # 03/01/16 [email protected] 1.944.1.11 # [ALPHA] Correct io.h exports and inlining for marvel and titan. # -------------------------------------------- # 03/01/16 [email protected] 1.953 # Merge kanga.twiddle.net:/home/rth/linux/linus-2.5 # into kanga.twiddle.net:/home/rth/linux/axp-2.5 # -------------------------------------------- # 03/01/16 [email protected] 1.954 # [PATCH] Fix marvel irq count computation. # # Found a buglet in the marvel code -- doesn't change the number of IRQS # just the logic to get there.. This applies on top of the other marvel # code. # # /jeff # -------------------------------------------- # 03/01/16 [email protected] 1.955 # Merge bk://bk.arm.linux.org.uk # into home.transmeta.com:/home/torvalds/v2.5/linux # -------------------------------------------- # 03/01/16 [email protected] 1.956 # Linux v2.5.59 # -------------------------------------------- # 03/01/20 [email protected] 1.946.1.1 # Remove struct scm_cookie * from socket send/recvmsg() ops. Credentials # are only used by af_unix and af_netlink anyways, so by only using them # in those paths we eliminate overhead from all other network protocols' # fastpaths. # -------------------------------------------- # diff -Nru a/arch/ia64/ia32/sys_ia32.c b/arch/ia64/ia32/sys_ia32.c --- a/arch/ia64/ia32/sys_ia32.c Mon Jan 20 16:00:08 2003 +++ b/arch/ia64/ia32/sys_ia32.c Mon Jan 20 16:00:08 2003 @@ -1649,20 +1649,21 @@ /* XXX This code needs massive updating... -DaveM */ lock_kernel(); { + struct scm_cookie scm; struct sock_iocb *si; struct kiocb iocb;
init_sync_kiocb(&iocb, NULL); si = kiocb_to_siocb(&iocb); si->sock = sock;
- si->scm = &si->async_scm;
+ si->scm = &scm;
si->msg = &msg_sys;
si->size = total_len; si->flags = flags; memset(si->scm, 0, sizeof(*si->scm));
err = sock->ops->recvmsg(&iocb, sock, &msg_sys, total_len,
- flags, si->scm);
+ flags);
if (-EIOCBQUEUED == err)
err = wait_on_sync_kiocb(&iocb);
arch/parisc/kernel/sys_parisc32.c +4 -2
@@ -1600,21 +1600,23 @@if (sock !=NULL ) {struct sock_iocb *si;struct kiocb iocb; +struct scm_cookie scm;if (sock->file->f_flags &O_NONBLOCK ) user_flags |=MSG_DONTWAIT ; +memset (&scm,0 ,sizeof (scm));init_sync_kiocb (&iocb,NULL ); si =kiocb_to_siocb (&iocb); si->sock = sock; - si->scm = &si->async_scm; + si->scm = &scm; si->msg = &kern_msg; si->size = total_len; si->flags = user_flags;memset (si->scm,0 ,sizeof (*si->scm)); err = sock->ops->recvmsg (&iocb, sock, &kern_msg, total_len, - user_flags, si->scm); + user_flags);if (-EIOCBQUEUED == err) err =wait_on_sync_kiocb (&iocb);
arch/ppc64/kernel/sys_ppc32.c +4 -2
@@ -2833,21 +2833,23 @@if (sock !=NULL ) {struct sock_iocb *si;struct kiocb iocb; +struct scm_cookie scm;if (sock->file->f_flags &O_NONBLOCK ) user_flags |=MSG_DONTWAIT ; +memset (&scm,0 ,sizeof (scm));init_sync_kiocb (&iocb,NULL ); si =kiocb_to_siocb (&iocb); si->sock = sock; - si->scm = &si->async_scm; + si->scm = &scm; si->msg = &kern_msg; si->size = total_len; si->flags = user_flags;memset (si->scm,0 ,sizeof (*si->scm)); err = sock->ops->recvmsg (&iocb, sock, &kern_msg, total_len, - user_flags, si->scm); + user_flags);if (-EIOCBQUEUED == err) err =wait_on_sync_kiocb (&iocb);
arch/s390x/kernel/linux32.c +6 -5
@@ -2390,24 +2390,25 @@ {struct sock_iocb *si;struct kiocb iocb; +struct scm_cookie scm;init_sync_kiocb (&iocb,NULL ); si =kiocb_to_siocb (&iocb); si->sock = sock; - si->scm = &si->async_scm; + si->scm = &scm; si->msg = msg; si->size = size; si->flags = flags;memset (si->scm,0 ,sizeof (*si->scm)); - size = sock->ops->recvmsg (&iocb, sock, msg, size, flags, si->scm); -if (size >=0 ) -scm_recv32 (sock, msg, si->scm, flags, cmsg_ptr); - + size = sock->ops->recvmsg (&iocb, sock, msg, size, flags);if (-EIOCBQUEUED == size) size =wait_on_sync_kiocb (&iocb); + +if (size >=0 ) +scm_recv32 (sock, msg, si->scm, flags, cmsg_ptr);return size; }
arch/sparc64/kernel/sys_sparc32.c +3 -2
@@ -2421,6 +2421,7 @@if (sock !=NULL ) {struct sock_iocb *si;struct kiocb iocb; +struct scm_cookie scm;if (sock->file->f_flags &O_NONBLOCK ) user_flags |=MSG_DONTWAIT ;
@@ -2428,14 +2429,14 @@init_sync_kiocb (&iocb,NULL ); si =kiocb_to_siocb (&iocb); si->sock = sock; - si->scm = &si->async_scm; + si->scm = &scm; si->msg = &kern_msg; si->size = total_len; si->flags = user_flags;memset (si->scm,0 ,sizeof (*si->scm)); err = sock->ops->recvmsg (&iocb, sock, &kern_msg, total_len, - user_flags, si->scm); + user_flags);if (-EIOCBQUEUED == err) err =wait_on_sync_kiocb (&iocb);
arch/x86_64/ia32/socket32.c +3 -2
@@ -442,6 +442,7 @@if (sock !=NULL ) {struct sock_iocb *si;struct kiocb iocb; +struct scm_cookie scm;if (sock->file->f_flags &O_NONBLOCK ) user_flags |=MSG_DONTWAIT ;
@@ -449,14 +450,14 @@init_sync_kiocb (&iocb,NULL ); si =kiocb_to_siocb (&iocb); si->sock = sock; - si->scm = &si->async_scm; + si->scm = &scm; si->msg = &kern_msg; si->size = total_len; si->flags = user_flags;memset (si->scm,0 ,sizeof (*si->scm)); err = sock->ops->recvmsg (&iocb, sock, &kern_msg, total_len, - user_flags, si->scm); + user_flags);if (-EIOCBQUEUED == err) err =wait_on_sync_kiocb (&iocb);
drivers/net/pppoe.c +4 -3
@@ -777,7 +777,7 @@int pppoe_sendmsg (struct kiocb *iocb,struct socket *sock,struct msghdr *m, -int total_len,struct scm_cookie *scm) +int total_len) {struct sk_buff *skb =NULL ;struct sock *sk = sock->sk;
@@ -937,7 +937,8 @@struct ppp_channel_ops pppoe_chan_ops = { pppoe_xmit ,NULL }; -int pppoe_rcvmsg (struct kiocb *iocb,struct socket *sock,struct msghdr *m,int total_len,int flags,struct scm_cookie *scm) +int pppoe_recvmsg (struct kiocb *iocb,struct socket *sock, +struct msghdr *m,int total_len,int flags) {struct sock *sk = sock->sk;struct sk_buff *skb =NULL ;
@@ -1089,7 +1090,7 @@ .setsockopt = sock_no_setsockopt, .getsockopt = sock_no_getsockopt, .sendmsg = pppoe_sendmsg, - .recvmsg = pppoe_rcvmsg, + .recvmsg = pppoe_recvmsg, .mmap = sock_no_mmap };
fs/smbfs/sock.c +4 -68
122 lines not on this page · raw message
include/linux/net.h +6 -9
@@ -78,7 +78,6 @@unsigned char passcred; }; -struct scm_cookie ;struct vm_area_struct ;struct page ;struct kiocb ;
@@ -106,11 +105,9 @@int (*getsockopt) (struct socket *sock,int level,int optname,char *optval,int *optlen);int (*sendmsg) (struct kiocb *iocb,struct socket *sock, -struct msghdr *m,int total_len, -struct scm_cookie *scm); +struct msghdr *m,int total_len);int (*recvmsg) (struct kiocb *iocb,struct socket *sock, -struct msghdr *m,int total_len,int flags, -struct scm_cookie *scm); +struct msghdr *m,int total_len,int flags);int (*mmap) (struct file *file,struct socket *sock,struct vm_area_struct * vma);ssize_t (*sendpage) (struct socket *sock,struct page *page,int offset,size_t size,int flags); };
@@ -202,10 +199,10 @@ char *optval, int optlen), (sock, level, optname, optval, optlen)) \ SOCKCALL_WRAP(name, getsockopt, (struct socket *sock, int level, int optname, \ char *optval, int *optlen), (sock, level, optname, optval, optlen)) \ -SOCKCALL_WRAP(name, sendmsg, (struct kiocb *iocb, struct socket *sock, struct msghdr *m, int len, struct scm_cookie *scm), \ - (iocb, sock, m, len, scm)) \ -SOCKCALL_WRAP(name, recvmsg, (struct kiocb *iocb, struct socket *sock, struct msghdr *m, int len, int flags, struct scm_cookie *scm), \ - (iocb, sock, m, len, flags, scm)) \ +SOCKCALL_WRAP(name, sendmsg, (struct kiocb *iocb, struct socket *sock, struct msghdr *m, int len), \ + (iocb, sock, m, len)) \ +SOCKCALL_WRAP(name, recvmsg, (struct kiocb *iocb, struct socket *sock, struct msghdr *m, int len, int flags), \ + (iocb, sock, m, len, flags)) \ SOCKCALL_WRAP(name, mmap, (struct file *file, struct socket *sock, struct vm_area_struct *vma), \ (file, sock, vma)) \ \
include/net/bluetooth/bluetooth.h +1 -1
@@ -128,7 +128,7 @@struct sock *bt_sock_alloc (struct socket *sock,int proto,int pi_size,int prio);void bt_sock_link (struct bt_sock_list *l,struct sock *s);void bt_sock_unlink (struct bt_sock_list *l,struct sock *s); -int bt_sock_recvmsg (struct kiocb *iocb,struct socket *sock,struct msghdr *msg,int len,int flags,struct scm_cookie *scm); +int bt_sock_recvmsg (struct kiocb *iocb,struct socket *sock,struct msghdr *msg,int len,int flags);uint bt_sock_poll (struct file * file,struct socket *sock,poll_table *wait);int bt_sock_w4_connect (struct sock *sk,int flags);
include/net/inet_common.h +2 -2
@@ -23,11 +23,11 @@extern int inet_recvmsg (struct kiocb *iocb,struct socket *sock,struct msghdr *ubuf, -int size,int flags,struct scm_cookie *scm); +int size,int flags);extern int inet_sendmsg (struct kiocb *iocb,struct socket *sock,struct msghdr *msg, -int size,struct scm_cookie *scm); +int size);extern int inet_shutdown (struct socket *sock,int how);extern unsigned int inet_poll (struct file * file,struct socket *sock,struct poll_table_struct *wait); extern int inet_setsockopt(struct socket *sock, int level,
include/net/sock.h +3 -6
@@ -51,7 +51,6 @@#include <asm/atomic.h> #include <net/dst.h> -#include <net/scm.h> /* * This structure really needs to be cleaned up.
@@ -305,9 +304,9 @@int size;struct socket *sock;struct sock *sk; +struct scm_cookie *scm;struct msghdr *msg, async_msg;struct iovec async_iov; -struct scm_cookie *scm, async_scm; };static inline struct sock_iocb *kiocb_to_siocb (struct kiocb *iocb)
@@ -433,11 +432,9 @@extern int sock_no_setsockopt (struct socket *,int ,int ,char *,int );extern int sock_no_sendmsg (struct kiocb *,struct socket *, -struct msghdr *,int , -struct scm_cookie *); +struct msghdr *,int );extern int sock_no_recvmsg (struct kiocb *,struct socket *, -struct msghdr *,int ,int , -struct scm_cookie *); +struct msghdr *,int ,int );extern int sock_no_mmap (struct file *file,struct socket *sock,struct vm_area_struct *vma);
net/appletalk/ddp.c +2 -2
@@ -1492,7 +1492,7 @@ }static int atalk_sendmsg (struct kiocb *iocb,struct socket *sock,struct msghdr *msg, -int len,struct scm_cookie *scm) +int len) {struct sock *sk = sock->sk;struct atalk_sock *at =at_sk (sk);
@@ -1651,7 +1651,7 @@ }static int atalk_recvmsg (struct kiocb *iocb,struct socket *sock,struct msghdr *msg, -int size,int flags,struct scm_cookie *scm) +int size,int flags) {struct sock *sk = sock->sk;struct sockaddr_at *sat = (struct sockaddr_at *)msg->msg_name;
net/atm/common.c +2 -2
@@ -337,7 +337,7 @@int atm_recvmsg (struct kiocb *iocb,struct socket *sock,struct msghdr *m, -int total_len,int flags,struct scm_cookie *scm) +int total_len,int flags) {DECLARE_WAITQUEUE (wait,current);struct atm_vcc *vcc;
@@ -418,7 +418,7 @@int atm_sendmsg (struct kiocb *iocb,struct socket *sock,struct msghdr *m, -int total_len,struct scm_cookie *scm) +int total_len) {DECLARE_WAITQUEUE (wait,current);struct atm_vcc *vcc;
net/atm/common.h +2 -2
@@ -14,9 +14,9 @@int atm_release (struct socket *sock);int atm_connect (struct socket *sock,int itf,short vpi,int vci);int atm_recvmsg (struct kiocb *iocb,struct socket *sock,struct msghdr *m, -int total_len,int flags,struct scm_cookie *scm); +int total_len,int flags);int atm_sendmsg (struct kiocb *iocb,struct socket *sock,struct msghdr *m, -int total_len,struct scm_cookie *scm); +int total_len);unsigned int atm_poll (struct file *file,struct socket *sock,poll_table *wait);int atm_ioctl (struct socket *sock,unsigned int cmd,unsigned long arg); int atm_setsockopt(struct socket *sock,int level,int optname,char *optval,
net/ax25/af_ax25.c +2 -3
@@ -1411,8 +1411,7 @@ }static int ax25_sendmsg (struct kiocb *iocb,struct socket *sock, -struct msghdr *msg,int len, -struct scm_cookie *scm) +struct msghdr *msg,int len) {struct sockaddr_ax25 *usax = (struct sockaddr_ax25 *)msg->msg_name;struct sock *sk = sock->sk;
@@ -1590,7 +1589,7 @@ }static int ax25_recvmsg (struct kiocb *iocb,struct socket *sock, -struct msghdr *msg,int size,int flags,struct scm_cookie *scm) +struct msghdr *msg,int size,int flags) {struct sock *sk = sock->sk;struct sk_buff *skb;
net/bluetooth/af_bluetooth.c +1 -1
@@ -212,7 +212,7 @@ }int bt_sock_recvmsg (struct kiocb *iocb,struct socket *sock, -struct msghdr *msg,int len,int flags,struct scm_cookie *scm) +struct msghdr *msg,int len,int flags) {int noblock = flags &MSG_DONTWAIT ;struct sock *sk = sock->sk;
net/bluetooth/bnep/core.c +2 -27
@@ -97,26 +97,12 @@static int bnep_send (struct bnep_session *s,void *data,size_t len) { -struct kiocb iocb; -struct sock_iocb *si;struct socket *sock = s->sock;struct iovec iv = { data, len }; -int err; s->msg.msg_iov = &iv; s->msg.msg_iovlen =1 ; -init_sync_kiocb (&iocb,NULL ); - si =kiocb_to_siocb (&iocb); - si->scm =NULL ; - si->sock = sock; - si->msg = &s->msg; - si->size = len; - - err = sock->ops->sendmsg (&iocb, sock, &s->msg, len,NULL ); -if (-EIOCBQUEUED == err) - err =wait_on_sync_kiocb (&iocb); - -return err; +return sock_sendmsg (sock, &s->msg, len); }static int bnep_send_rsp (struct bnep_session *s,u8 ctrl,u16 resp)
@@ -442,20 +428,9 @@/* FIXME: linearize skb */ { -struct kiocb iocb; -struct sock_iocb *si; - s->msg.msg_iov = iv; s->msg.msg_iovlen = il; -init_sync_kiocb (&iocb,NULL ); - si =kiocb_to_siocb (&iocb); - si->scm =NULL ; - si->sock = sock; - si->msg = &s->msg; - si->size = len; - len = sock->ops->sendmsg (&iocb, sock, &s->msg, len,NULL ); -if (-EIOCBQUEUED == len) - len =wait_on_sync_kiocb (&iocb); + len =sock_sendmsg (sock, &s->msg, len); }kfree_skb (skb);
net/bluetooth/hci_sock.c +2 -3
@@ -316,7 +316,7 @@put_cmsg (msg,SOL_HCI ,HCI_CMSG_TSTAMP ,sizeof (skb->stamp), &skb->stamp); } -static int hci_sock_recvmsg (struct kiocb *iocb,struct socket *sock,struct msghdr *msg,int len,int flags,struct scm_cookie *scm) +static int hci_sock_recvmsg (struct kiocb *iocb,struct socket *sock,struct msghdr *msg,int len,int flags) {int noblock = flags &MSG_DONTWAIT ;struct sock *sk = sock->sk;
@@ -352,8 +352,7 @@return err ? : copied; } -static int hci_sock_sendmsg (struct kiocb *iocb,struct socket *sock,struct msghdr *msg,int len, -struct scm_cookie *scm) +static int hci_sock_sendmsg (struct kiocb *iocb,struct socket *sock,struct msghdr *msg,int len) {struct sock *sk = sock->sk;struct hci_dev *hdev;
net/bluetooth/l2cap.c +1 -1
@@ -709,7 +709,7 @@return err; } -static int l2cap_sock_sendmsg (struct kiocb *iocb,struct socket *sock,struct msghdr *msg,int len,struct scm_cookie *scm) +static int l2cap_sock_sendmsg (struct kiocb *iocb,struct socket *sock,struct msghdr *msg,int len) {struct sock *sk = sock->sk;int err =0 ;
net/bluetooth/rfcomm/core.c +3 -28
@@ -604,29 +604,17 @@/* ---- RFCOMM frame sending ---- */ static int rfcomm_send_frame (struct rfcomm_session *s,u8 *data,int len) { -struct kiocb iocb; -struct sock_iocb *si;struct socket *sock = s->sock;struct iovec iv = { data, len };struct msghdr msg; -int err;BT_DBG ("session %p len %d" , s, len);memset (&msg,0 ,sizeof (msg)); msg.msg_iovlen =1 ; msg.msg_iov = &iv; -init_sync_kiocb (&iocb,NULL ); - si =kiocb_to_siocb (&iocb); - si->scm =NULL ; - si->sock = sock; - si->msg = &msg; - si->size = len; - - err = sock->ops->sendmsg (&iocb, sock, &msg, len,NULL ); -if (-EIOCBQUEUED == err) - err =wait_on_sync_kiocb (&iocb); -return err; + +return sock_sendmsg (sock, &msg, len); }static int rfcomm_send_sabm (struct rfcomm_session *s,u8 dlci)
@@ -838,13 +826,10 @@static int rfcomm_send_test (struct rfcomm_session *s,int cr,u8 *pattern,int len) { -struct kiocb iocb; -struct sock_iocb *si;struct socket *sock = s->sock;struct iovec iv[3 ];struct msghdr msg;unsigned char hdr[5 ], crc[1 ]; -int err;if (len >125 )return -EINVAL ;
@@ -869,18 +854,8 @@memset (&msg,0 ,sizeof (msg)); msg.msg_iovlen =3 ; msg.msg_iov = iv; -init_sync_kiocb (&iocb,NULL ); - si =kiocb_to_siocb (&iocb); - si->scm =NULL ; - si->sock = sock; - si->msg = &msg; - si->size =6 + len; - - err = sock->ops->sendmsg (&iocb, sock, &msg,6 + len,NULL ); -if (-EIOCBQUEUED == err) - err =wait_on_sync_kiocb (&iocb); -return err; +return sock_sendmsg (sock, &msg,6 + len); }static int rfcomm_send_credits (struct rfcomm_session *s,u8 addr,u8 credits)
net/bluetooth/rfcomm/sock.c +2 -3
@@ -479,7 +479,7 @@ }static int rfcomm_sock_sendmsg (struct kiocb *iocb,struct socket *sock, -struct msghdr *msg,int len,struct scm_cookie *scm) +struct msghdr *msg,int len) {struct sock *sk = sock->sk;struct rfcomm_dlc *d =rfcomm_pi (sk)->dlc;
@@ -553,8 +553,7 @@ }static int rfcomm_sock_recvmsg (struct kiocb *iocb,struct socket *sock, -struct msghdr *msg,int size,int flags, -struct scm_cookie *scm) +struct msghdr *msg,int size,int flags) {struct sock *sk = sock->sk;int target, err =0 , copied =0 ;
net/bluetooth/sco.c +1 -1
@@ -632,7 +632,7 @@return 0 ; } -static int sco_sock_sendmsg (struct kiocb *iocb,struct socket *sock,struct msghdr *msg,int len,struct scm_cookie *scm) +static int sco_sock_sendmsg (struct kiocb *iocb,struct socket *sock,struct msghdr *msg,int len) {struct sock *sk = sock->sk;int err =0 ;
net/core/sock.c +2 -2
@@ -960,13 +960,13 @@ }int sock_no_sendmsg (struct kiocb *iocb,struct socket *sock,struct msghdr *m, -int flags,struct scm_cookie *scm) +int flags) {return -EOPNOTSUPP ; }int sock_no_recvmsg (struct kiocb *iocb,struct socket *sock,struct msghdr *m, -int len,int flags,struct scm_cookie *scm) +int len,int flags) {return -EOPNOTSUPP ; }
net/decnet/af_decnet.c +2 -2
@@ -1718,7 +1718,7 @@static int dn_recvmsg (struct kiocb *iocb,struct socket *sock, -struct msghdr *msg,int size,int flags,struct scm_cookie *scm) +struct msghdr *msg,int size,int flags) {struct sock *sk = sock->sk;struct dn_scp *scp =DN_SK (sk);
@@ -1889,7 +1889,7 @@ }static int dn_sendmsg (struct kiocb *iocb,struct socket *sock, -struct msghdr *msg,int size,struct scm_cookie *scm) +struct msghdr *msg,int size) {struct sock *sk = sock->sk;struct dn_scp *scp =DN_SK (sk);
net/econet/af_econet.c +2 -3
@@ -126,8 +126,7 @@*/ static int econet_recvmsg (struct kiocb *iocb,struct socket *sock, -struct msghdr *msg,int len,int flags, -struct scm_cookie *scm) +struct msghdr *msg,int len,int flags) {struct sock *sk = sock->sk;struct sk_buff *skb;
@@ -260,7 +259,7 @@*/ static int econet_sendmsg (struct kiocb *iocb,struct socket *sock, -struct msghdr *msg,int len,struct scm_cookie *scm) +struct msghdr *msg,int len) {struct sock *sk = sock->sk;struct sockaddr_ec *saddr=(struct sockaddr_ec *)msg->msg_name;
net/ipv4/af_inet.c +2 -2
@@ -730,7 +730,7 @@int inet_recvmsg (struct kiocb *iocb,struct socket *sock,struct msghdr *msg, -int size,int flags,struct scm_cookie *scm) +int size,int flags) {struct sock *sk = sock->sk;int addr_len =0 ;
@@ -745,7 +745,7 @@int inet_sendmsg (struct kiocb *iocb,struct socket *sock,struct msghdr *msg, -int size,struct scm_cookie *scm) +int size) {struct sock *sk = sock->sk;
net/ipx/af_ipx.c +2 -2
@@ -2010,7 +2010,7 @@ }static int ipx_sendmsg (struct kiocb *iocb,struct socket *sock, -struct msghdr *msg,int len,struct scm_cookie *scm) +struct msghdr *msg,int len) {struct sock *sk = sock->sk;struct ipx_opt *ipxs =ipx_sk (sk);
@@ -2070,7 +2070,7 @@static int ipx_recvmsg (struct kiocb *iocb,struct socket *sock, -struct msghdr *msg,int size,int flags,struct scm_cookie *scm) +struct msghdr *msg,int size,int flags) {struct sock *sk = sock->sk;struct ipx_opt *ipxs =ipx_sk (sk);
net/irda/af_irda.c +10 -12
@@ -1253,14 +1253,14 @@ }/* -* Function irda_sendmsg (iocb, sock, msg, len, scm) +* Function irda_sendmsg (iocb, sock, msg, len) * * Send message down to TinyTP. This function is used for both STREAM and * SEQPACK services. This is possible since it forces the client to * fragment the message if necessary */ static int irda_sendmsg (struct kiocb *iocb,struct socket *sock, -struct msghdr *msg,int len,struct scm_cookie *scm) +struct msghdr *msg,int len) {struct sock *sk = sock->sk;struct irda_sock *self;
@@ -1326,14 +1326,13 @@ }/* -* Function irda_recvmsg_dgram (iocb, sock, msg, size, flags, scm) +* Function irda_recvmsg_dgram (iocb, sock, msg, size, flags) * * Try to receive message and copy it to user. The frame is discarded * after being read, regardless of how much the user actually read */ static int irda_recvmsg_dgram (struct kiocb *iocb,struct socket *sock, -struct msghdr *msg,int size,int flags, -struct scm_cookie *scm) +struct msghdr *msg,int size,int flags) {struct sock *sk = sock->sk;struct irda_sock *self =irda_sk (sk);
@@ -1380,11 +1379,10 @@ }/* -* Function irda_recvmsg_stream (iocb, sock, msg, size, flags, scm) +* Function irda_recvmsg_stream (iocb, sock, msg, size, flags) */ static int irda_recvmsg_stream (struct kiocb *iocb,struct socket *sock, -struct msghdr *msg,int size,int flags, -struct scm_cookie *scm) +struct msghdr *msg,int size,int flags) {struct sock *sk = sock->sk;struct irda_sock *self =irda_sk (sk);
@@ -1504,14 +1502,14 @@ }/* -* Function irda_sendmsg_dgram (iocb, sock, msg, len, scm) +* Function irda_sendmsg_dgram (iocb, sock, msg, len) * * Send message down to TinyTP for the unreliable sequenced * packet service... * */ static int irda_sendmsg_dgram (struct kiocb *iocb,struct socket *sock, -struct msghdr *msg,int len,struct scm_cookie *scm) +struct msghdr *msg,int len) {struct sock *sk = sock->sk;struct irda_sock *self;
@@ -1570,14 +1568,14 @@ }/* -* Function irda_sendmsg_ultra (iocb, sock, msg, len, scm) +* Function irda_sendmsg_ultra (iocb, sock, msg, len) * * Send message down to IrLMP for the unreliable Ultra * packet service... */ #ifdef CONFIG_IRDA_ULTRA static int irda_sendmsg_ultra (struct kiocb *iocb,struct socket *sock, -struct msghdr *msg,int len,struct scm_cookie *scm) +struct msghdr *msg,int len) {struct sock *sk = sock->sk;struct irda_sock *self;
net/key/af_key.c +2 -3
@@ -2141,8 +2141,7 @@ }static int pfkey_sendmsg (struct kiocb *kiocb, -struct socket *sock,struct msghdr *msg,int len, -struct scm_cookie *scm) +struct socket *sock,struct msghdr *msg,int len) {struct sock *sk = sock->sk;struct sk_buff *skb =NULL ;
@@ -2185,7 +2184,7 @@static int pfkey_recvmsg (struct kiocb *kiocb,struct socket *sock,struct msghdr *msg,int len, -int flags,struct scm_cookie *scm) +int flags) {struct sock *sk = sock->sk;struct sk_buff *skb;
net/llc/af_llc.c +2 -5
@@ -672,14 +672,12 @@* @msg: Various user space related information. * @size: Size of user buffer. * @flags: User specified flags. -* @scm: Unknown. * * Copy received data to the socket user. * Returns non-negative upon success, negative otherwise. */ static int llc_ui_recvmsg (struct kiocb *iocb,struct socket *sock, -struct msghdr *msg,int size,int flags, -struct scm_cookie *scm) +struct msghdr *msg,int size,int flags) {struct sock *sk = sock->sk;struct sockaddr_llc *uaddr = (struct sockaddr_llc *)msg->msg_name;
@@ -727,13 +725,12 @@* @sock: Socket to transmit data from. * @msg: Various user related information. * @len: Length of data to transmit. -* @scm: Unknown. * * Transmit data provided by the socket user. * Returns non-negative upon success, negative otherwise. */ static int llc_ui_sendmsg (struct kiocb *iocb,struct socket *sock, -struct msghdr *msg,int len,struct scm_cookie *scm) +struct msghdr *msg,int len) {struct sock *sk = sock->sk;struct llc_opt *llc =llc_sk (sk);
net/netlink/af_netlink.c +22 -7
@@ -584,10 +584,10 @@read_unlock (&nl_table_lock); } -static int netlink_sendmsg (struct kiocb *iocb,struct socket *sock, -struct msghdr *msg,int len, -struct scm_cookie *scm) +static int netlink_sendmsg (struct kiocb *kiocb,struct socket *sock, +struct msghdr *msg,int len) { +struct sock_iocb *siocb =kiocb_to_siocb (kiocb);struct sock *sk = sock->sk;struct netlink_opt *nlk =nlk_sk (sk);struct sockaddr_nl *addr=msg->msg_name;
@@ -595,10 +595,17 @@u32 dst_groups;struct sk_buff *skb;int err; +struct scm_cookie scm;if (msg->msg_flags&MSG_OOB )return -EOPNOTSUPP ; +if (NULL == siocb->scm) + siocb->scm = &scm; + err =scm_send (sock, msg, siocb->scm); +if (err <0 ) +return err; +if (msg->msg_namelen) {if (addr->nl_family !=AF_NETLINK )return -EINVAL ;
@@ -629,7 +636,7 @@NETLINK_CB (skb).groups = nlk->groups;NETLINK_CB (skb).dst_pid = dst_pid;NETLINK_CB (skb).dst_groups = dst_groups; -memcpy (NETLINK_CREDS (skb), &scm->creds,sizeof (struct ucred )); +memcpy (NETLINK_CREDS (skb), &siocb->scm->creds,sizeof (struct ucred ));/* What can I do? Netlink is asynchronous, so that we will have to save current capabilities to
@@ -654,10 +661,12 @@return err; } -static int netlink_recvmsg (struct kiocb *iocb,struct socket *sock, +static int netlink_recvmsg (struct kiocb *kiocb,struct socket *sock,struct msghdr *msg,int len, -int flags,struct scm_cookie *scm) +int flags) { +struct sock_iocb *siocb =kiocb_to_siocb (kiocb); +struct scm_cookie scm;struct sock *sk = sock->sk;struct netlink_opt *nlk =nlk_sk (sk);int noblock = flags&MSG_DONTWAIT ;
@@ -693,11 +702,17 @@ msg->msg_namelen =sizeof (*addr); } - scm->creds = *NETLINK_CREDS (skb); +if (NULL == siocb->scm) { +memset (&scm,0 ,sizeof (scm)); + siocb->scm = &scm; + } + siocb->scm->creds = *NETLINK_CREDS (skb);skb_free_datagram (sk, skb);if (nlk->cb &&atomic_read (&sk->rmem_alloc) <= sk->rcvbuf /2 )netlink_dump (sk); + +scm_recv (sock, msg, siocb->scm, flags); out:if (skb_queue_len (&sk->receive_queue) <= sk->rcvbuf/2 ) {
net/netrom/af_netrom.c +2 -3
@@ -967,7 +967,7 @@ }static int nr_sendmsg (struct kiocb *iocb,struct socket *sock, -struct msghdr *msg,int len,struct scm_cookie *scm) +struct msghdr *msg,int len) {struct sock *sk = sock->sk;nr_cb *nr =nr_sk (sk);
@@ -1058,8 +1058,7 @@ }static int nr_recvmsg (struct kiocb *iocb,struct socket *sock, -struct msghdr *msg,int size,int flags, -struct scm_cookie *scm) +struct msghdr *msg,int size,int flags) {struct sock *sk = sock->sk;struct sockaddr_ax25 *sax = (struct sockaddr_ax25 *)msg->msg_name;
net/packet/af_packet.c +3 -5
@@ -280,8 +280,7 @@*/ static int packet_sendmsg_spkt (struct kiocb *iocb,struct socket *sock, -struct msghdr *msg,int len, -struct scm_cookie *scm) +struct msghdr *msg,int len) {struct sock *sk = sock->sk;struct sockaddr_pkt *saddr=(struct sockaddr_pkt *)msg->msg_name;
@@ -658,7 +657,7 @@static int packet_sendmsg (struct kiocb *iocb,struct socket *sock, -struct msghdr *msg,int len,struct scm_cookie *scm) +struct msghdr *msg,int len) {struct sock *sk = sock->sk;struct sockaddr_ll *saddr=(struct sockaddr_ll *)msg->msg_name;
@@ -1013,8 +1012,7 @@*/ static int packet_recvmsg (struct kiocb *iocb,struct socket *sock, -struct msghdr *msg,int len, -int flags,struct scm_cookie *scm) +struct msghdr *msg,int len,int flags) {struct sock *sk = sock->sk;struct sk_buff *skb;
net/rose/af_rose.c +2 -3
@@ -1026,7 +1026,7 @@ }static int rose_sendmsg (struct kiocb *iocb,struct socket *sock, -struct msghdr *msg,int len,struct scm_cookie *scm) +struct msghdr *msg,int len) {struct sock *sk = sock->sk;rose_cb *rose =rose_sk (sk);
@@ -1190,8 +1190,7 @@static int rose_recvmsg (struct kiocb *iocb,struct socket *sock, -struct msghdr *msg,int size,int flags, -struct scm_cookie *scm) +struct msghdr *msg,int size,int flags) {struct sock *sk = sock->sk;rose_cb *rose =rose_sk (sk);
net/socket.c +6 -21
@@ -89,7 +89,6 @@#include <asm/uaccess.h> #include <net/sock.h> -#include <net/scm.h> #include <linux/netfilter.h> static int sock_no_open (struct inode *irrelevant,struct file *dontcare);
@@ -517,23 +516,16 @@ sock->file=NULL ; } -static int __sock_sendmsg (struct kiocb *iocb,struct socket *sock,struct msghdr *msg,int size) +static inline int __sock_sendmsg (struct kiocb *iocb,struct socket *sock,struct msghdr *msg,int size) {struct sock_iocb *si =kiocb_to_siocb (iocb); -int err; - si->scm = &si->async_scm; si->sock = sock; + si->scm =NULL ; si->msg = msg; si->size = size; - err =scm_send (sock, msg, si->scm); -if (err >=0 ) { - err = sock->ops->sendmsg (iocb, sock, msg, size, si->scm); -if (-EIOCBQUEUED != err) -scm_destroy (si->scm); - } -return err; +return sock->ops->sendmsg (iocb, sock, msg, size); }int sock_sendmsg (struct socket *sock,struct msghdr *msg,int size)
@@ -549,24 +541,17 @@ } -int __sock_recvmsg (struct kiocb *iocb,struct socket *sock,struct msghdr *msg,int size,int flags) +static inline int __sock_recvmsg (struct kiocb *iocb,struct socket *sock,struct msghdr *msg,int size,int flags) {struct sock_iocb *si =kiocb_to_siocb (iocb); si->sock = sock; - si->scm = &si->async_scm; - si->sock = sock; + si->scm =NULL ; si->msg = msg; si->size = size; si->flags = flags; -memset (si->scm,0 ,sizeof (*si->scm)); - - size = sock->ops->recvmsg (iocb, sock, msg, size, flags, si->scm); -if (size >=0 ) -scm_recv (sock, msg, si->scm, flags); - -return size; +return sock->ops->recvmsg (iocb, sock, msg, size, flags); }int sock_recvmsg (struct socket *sock,struct msghdr *msg,int size,int flags)
net/unix/af_unix.c +52 -22
208 lines not on this page · raw message
net/wanrouter/af_wanpipe.c +2 -3
@@ -542,7 +542,7 @@*===========================================================*/ static int wanpipe_sendmsg (struct kiocb *iocb,struct socket *sock, -struct msghdr *msg,int len,struct scm_cookie *scm) +struct msghdr *msg,int len) {wanpipe_opt *wp;struct sock *sk = sock->sk;
@@ -1649,8 +1649,7 @@*===========================================================*/ static int wanpipe_recvmsg (struct kiocb *iocb,struct socket *sock, -struct msghdr *msg,int len,int flags, -struct scm_cookie *scm) +struct msghdr *msg,int len,int flags) {struct sock *sk = sock->sk;struct sk_buff *skb;
net/x25/af_x25.c +2 -2
@@ -917,7 +917,7 @@ }static int x25_sendmsg (struct kiocb *iocb,struct socket *sock, -struct msghdr *msg,int len,struct scm_cookie *scm) +struct msghdr *msg,int len) {struct sock *sk = sock->sk;struct x25_opt *x25 =x25_sk (sk);
@@ -1093,7 +1093,7 @@static int x25_recvmsg (struct kiocb *iocb,struct socket *sock,struct msghdr *msg,int size, -int flags,struct scm_cookie *scm) +int flags) {struct sock *sk = sock->sk;struct x25_opt *x25 =x25_sk (sk);
Mail text in /tmp/linus.txt; please check and send using your favourite mailer.
From: Benjamin LaHaise <[email protected]>
Date: Mon, 20 Jan 2003 16:17:55 -0500
+ memset(&scm, 0, sizeof(scm));
init_sync_kiocb(&iocb, NULL);
si = kiocb_to_siocb(&iocb);
si->sock = sock;
- si->scm = &si->async_scm;
+ si->scm = &scm;
si->msg = &kern_msg;
si->size = total_len;
si->flags = user_flags;
memset(si->scm, 0, sizeof(*si->scm));We're now memset()'ing it twice? :) I think the first memset isn't needed, and this makes the code consistent with the other places this logic is duplicated.
Otherwise the patch is fine, please fix this stuff up and resubmit, thanks.