kernel_optimize_test/net
Denys Vlasenko 9b2c45d479 net: make getname() functions return length rather than use int* parameter
Changes since v1:
Added changes in these files:
    drivers/infiniband/hw/usnic/usnic_transport.c
    drivers/staging/lustre/lnet/lnet/lib-socket.c
    drivers/target/iscsi/iscsi_target_login.c
    drivers/vhost/net.c
    fs/dlm/lowcomms.c
    fs/ocfs2/cluster/tcp.c
    security/tomoyo/network.c

Before:
All these functions either return a negative error indicator,
or store length of sockaddr into "int *socklen" parameter
and return zero on success.

"int *socklen" parameter is awkward. For example, if caller does not
care, it still needs to provide on-stack storage for the value
it does not need.

None of the many FOO_getname() functions of various protocols
ever used old value of *socklen. They always just overwrite it.

This change drops this parameter, and makes all these functions, on success,
return length of sockaddr. It's always >= 0 and can be differentiated
from an error.

Tests in callers are changed from "if (err)" to "if (err < 0)", where needed.

rpc_sockname() lost "int buflen" parameter, since its only use was
to be passed to kernel_getsockname() as &buflen and subsequently
not used in any way.

Userspace API is not changed.

    text    data     bss      dec     hex filename
30108430 2633624  873672 33615726 200ef6e vmlinux.before.o
30108109 2633612  873672 33615393 200ee21 vmlinux.o

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
CC: David S. Miller <davem@davemloft.net>
CC: linux-kernel@vger.kernel.org
CC: netdev@vger.kernel.org
CC: linux-bluetooth@vger.kernel.org
CC: linux-decnet-user@lists.sourceforge.net
CC: linux-wireless@vger.kernel.org
CC: linux-rdma@vger.kernel.org
CC: linux-sctp@vger.kernel.org
CC: linux-nfs@vger.kernel.org
CC: linux-x25@vger.kernel.org
Signed-off-by: David S. Miller <davem@davemloft.net>
2018-02-12 14:15:04 -05:00
..
6lowpan
9p vfs: do bulk POLL* -> EPOLL* replacement 2018-02-11 14:34:03 -08:00
802
8021q
appletalk net: make getname() functions return length rather than use int* parameter 2018-02-12 14:15:04 -05:00
atm net: make getname() functions return length rather than use int* parameter 2018-02-12 14:15:04 -05:00
ax25 net: make getname() functions return length rather than use int* parameter 2018-02-12 14:15:04 -05:00
batman-adv vfs: do bulk POLL* -> EPOLL* replacement 2018-02-11 14:34:03 -08:00
bluetooth net: make getname() functions return length rather than use int* parameter 2018-02-12 14:15:04 -05:00
bpf
bridge
caif vfs: do bulk POLL* -> EPOLL* replacement 2018-02-11 14:34:03 -08:00
can net: make getname() functions return length rather than use int* parameter 2018-02-12 14:15:04 -05:00
ceph
core net: make getname() functions return length rather than use int* parameter 2018-02-12 14:15:04 -05:00
dcb
dccp vfs: do bulk POLL* -> EPOLL* replacement 2018-02-11 14:34:03 -08:00
decnet net: make getname() functions return length rather than use int* parameter 2018-02-12 14:15:04 -05:00
dns_resolver afs: Support the AFS dynamic root 2018-02-06 14:43:37 +00:00
dsa
ethernet
hsr
ieee802154
ife
ipv4 net: make getname() functions return length rather than use int* parameter 2018-02-12 14:15:04 -05:00
ipv6 net: make getname() functions return length rather than use int* parameter 2018-02-12 14:15:04 -05:00
iucv net: make getname() functions return length rather than use int* parameter 2018-02-12 14:15:04 -05:00
kcm vfs: do bulk POLL* -> EPOLL* replacement 2018-02-11 14:34:03 -08:00
key
l2tp net: make getname() functions return length rather than use int* parameter 2018-02-12 14:15:04 -05:00
l3mdev
lapb
llc net: make getname() functions return length rather than use int* parameter 2018-02-12 14:15:04 -05:00
mac80211
mac802154
mpls mpls, nospec: Sanitize array index in mpls_label_ok() 2018-02-08 15:24:12 -05:00
ncsi
netfilter netfilter: nf_flow_offload: fix use-after-free and a resource leak 2018-02-07 11:55:52 +01:00
netlabel
netlink net: make getname() functions return length rather than use int* parameter 2018-02-12 14:15:04 -05:00
netrom net: make getname() functions return length rather than use int* parameter 2018-02-12 14:15:04 -05:00
nfc net: make getname() functions return length rather than use int* parameter 2018-02-12 14:15:04 -05:00
nsh
openvswitch
packet net: make getname() functions return length rather than use int* parameter 2018-02-12 14:15:04 -05:00
phonet net: make getname() functions return length rather than use int* parameter 2018-02-12 14:15:04 -05:00
psample
qrtr net: make getname() functions return length rather than use int* parameter 2018-02-12 14:15:04 -05:00
rds net: make getname() functions return length rather than use int* parameter 2018-02-12 14:15:04 -05:00
rfkill vfs: do bulk POLL* -> EPOLL* replacement 2018-02-11 14:34:03 -08:00
rose net: make getname() functions return length rather than use int* parameter 2018-02-12 14:15:04 -05:00
rxrpc vfs: do bulk POLL* -> EPOLL* replacement 2018-02-11 14:34:03 -08:00
sched Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2018-02-09 15:34:18 -08:00
sctp net: make getname() functions return length rather than use int* parameter 2018-02-12 14:15:04 -05:00
smc net: make getname() functions return length rather than use int* parameter 2018-02-12 14:15:04 -05:00
strparser
sunrpc net: make getname() functions return length rather than use int* parameter 2018-02-12 14:15:04 -05:00
switchdev
tipc net: make getname() functions return length rather than use int* parameter 2018-02-12 14:15:04 -05:00
tls net: add a UID to use for ULP socket assignment 2018-02-06 11:39:31 +01:00
unix net: make getname() functions return length rather than use int* parameter 2018-02-12 14:15:04 -05:00
vmw_vsock net: make getname() functions return length rather than use int* parameter 2018-02-12 14:15:04 -05:00
wimax
wireless
x25 net: make getname() functions return length rather than use int* parameter 2018-02-12 14:15:04 -05:00
xfrm
compat.c
Kconfig
Makefile
socket.c net: make getname() functions return length rather than use int* parameter 2018-02-12 14:15:04 -05:00
sysctl_net.c