linux/fs/ocfs2/cluster
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
..
heartbeat.c ocfs2/cluster: make config_item_type const 2017-10-19 16:15:18 +02:00
heartbeat.h ocfs2: cleanup unused func declaration and assignment 2017-11-15 18:21:01 -08:00
Makefile ocfs2: remove versioning information 2014-01-21 16:19:41 -08:00
masklog.c Replace <asm/uaccess.h> with <linux/uaccess.h> globally 2016-12-24 11:46:01 -08:00
masklog.h ocfs2: reduce object size of mlog uses 2015-06-24 17:49:39 -07:00
netdebug.c ocfs2: free 'dummy_sc' in sc_fop_release() to prevent memory leak 2017-07-06 16:24:30 -07:00
nodemanager.c ocfs2: subsystem.su_mutex is required while accessing the item->ci_parent 2017-11-15 18:21:01 -08:00
nodemanager.h ocfs2/cluster: Make fence method configurable - v2 2009-12-02 16:49:26 -08:00
ocfs2_heartbeat.h
ocfs2_nodemanager.h ocfs2/dlm: Add message DLM_QUERY_REGION 2010-10-09 10:26:23 -07:00
quorum.c ocfs2/cluster: close a race that fence can't be triggered 2018-01-31 17:18:35 -08:00
quorum.h
sys.c VERIFY_OCTAL_PERMISSIONS: stricter checking for sysfs perms. 2014-03-24 12:21:00 +10:30
sys.h
tcp_internal.h ocfs2/cluster: neaten a member of o2net_msg_handler 2018-01-31 17:18:34 -08:00
tcp.c net: make getname() functions return length rather than use int* parameter 2018-02-12 14:15:04 -05:00
tcp.h ocfs2: o2net: set tcp user timeout to max value 2014-08-29 16:28:16 -07:00