Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

inet_diag: add module pointer to "struct inet_diag_handler"

Following patch is going to use RCU instead of
inet_diag_table_mutex acquisition.

This patch is a preparation, no change of behavior yet.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Guillaume Nault <gnault@redhat.com>
Reviewed-by: Kuniyuki Iwashima <kuniyu@amazon.com>
Reviewed-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>

authored by

Eric Dumazet and committed by
Paolo Abeni
db591469 e50e10ae

+8
+1
include/linux/inet_diag.h
··· 8 8 struct inet_hashinfo; 9 9 10 10 struct inet_diag_handler { 11 + struct module *owner; 11 12 void (*dump)(struct sk_buff *skb, 12 13 struct netlink_callback *cb, 13 14 const struct inet_diag_req_v2 *r);
+1
net/dccp/diag.c
··· 58 58 } 59 59 60 60 static const struct inet_diag_handler dccp_diag_handler = { 61 + .owner = THIS_MODULE, 61 62 .dump = dccp_diag_dump, 62 63 .dump_one = dccp_diag_dump_one, 63 64 .idiag_get_info = dccp_diag_get_info,
+1
net/ipv4/raw_diag.c
··· 213 213 #endif 214 214 215 215 static const struct inet_diag_handler raw_diag_handler = { 216 + .owner = THIS_MODULE, 216 217 .dump = raw_diag_dump, 217 218 .dump_one = raw_diag_dump_one, 218 219 .idiag_get_info = raw_diag_get_info,
+1
net/ipv4/tcp_diag.c
··· 222 222 #endif 223 223 224 224 static const struct inet_diag_handler tcp_diag_handler = { 225 + .owner = THIS_MODULE, 225 226 .dump = tcp_diag_dump, 226 227 .dump_one = tcp_diag_dump_one, 227 228 .idiag_get_info = tcp_diag_get_info,
+2
net/ipv4/udp_diag.c
··· 237 237 #endif 238 238 239 239 static const struct inet_diag_handler udp_diag_handler = { 240 + .owner = THIS_MODULE, 240 241 .dump = udp_diag_dump, 241 242 .dump_one = udp_diag_dump_one, 242 243 .idiag_get_info = udp_diag_get_info, ··· 261 260 } 262 261 263 262 static const struct inet_diag_handler udplite_diag_handler = { 263 + .owner = THIS_MODULE, 264 264 .dump = udplite_diag_dump, 265 265 .dump_one = udplite_diag_dump_one, 266 266 .idiag_get_info = udp_diag_get_info,
+1
net/mptcp/mptcp_diag.c
··· 225 225 } 226 226 227 227 static const struct inet_diag_handler mptcp_diag_handler = { 228 + .owner = THIS_MODULE, 228 229 .dump = mptcp_diag_dump, 229 230 .dump_one = mptcp_diag_dump_one, 230 231 .idiag_get_info = mptcp_diag_get_info,
+1
net/sctp/diag.c
··· 507 507 } 508 508 509 509 static const struct inet_diag_handler sctp_diag_handler = { 510 + .owner = THIS_MODULE, 510 511 .dump = sctp_diag_dump, 511 512 .dump_one = sctp_diag_dump_one, 512 513 .idiag_get_info = sctp_diag_get_info,