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 <[email protected]>
Reviewed-by: Jason Baron <[email protected]>
Acked-by: Eric Dumazet <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
Josh Hunt 2017-03-20 15:22:03 -04:00 • committed by David S. Miller
commit a2d133b1d4
16 changed files with 60 additions and 9 deletions

View file

@ -99,4 +99,6 @@
#define SCM_TIMESTAMPING_OPT_STATS 54
#define SO_MEMINFO 55
#endif /* _UAPI_ASM_SOCKET_H */