sock: introduce SO_MEMINFO getsockopt
authorJosh Hunt <johunt@akamai.com>
Mon, 20 Mar 2017 19:22:03 +0000 (15:22 -0400)
committerDavid S. Miller <davem@davemloft.net>
Wed, 22 Mar 2017 18:18:58 +0000 (11:18 -0700)
commita2d133b1d465016d0d97560b11f54ba0ace56d3e
tree0c41151a6860eb295d7919e22cce1dd5a8b0aea9
parentc7cd4c9bf8df87027e739fe66d0a55951f6875d8
sock: introduce SO_MEMINFO getsockopt

Allows reading of SK_MEMINFO_VARS via socket option. This way an
application can get all meminfo related information in single socket
option call instead of multiple calls.

Adds helper function, sk_get_meminfo(), and uses that for both
getsockopt and sock_diag_put_meminfo().

Suggested by Eric Dumazet.

Signed-off-by: Josh Hunt <johunt@akamai.com>
Reviewed-by: Jason Baron <jbaron@akamai.com>
Acked-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 files changed:
arch/alpha/include/uapi/asm/socket.h
arch/avr32/include/uapi/asm/socket.h
arch/frv/include/uapi/asm/socket.h
arch/ia64/include/uapi/asm/socket.h
arch/m32r/include/uapi/asm/socket.h
arch/mips/include/uapi/asm/socket.h
arch/mn10300/include/uapi/asm/socket.h
arch/parisc/include/uapi/asm/socket.h
arch/powerpc/include/uapi/asm/socket.h
arch/s390/include/uapi/asm/socket.h
arch/sparc/include/uapi/asm/socket.h
arch/xtensa/include/uapi/asm/socket.h
include/net/sock.h
include/uapi/asm-generic/socket.h
net/core/sock.c
net/core/sock_diag.c