diff options
Diffstat (limited to 'include/net/sock.h')
-rw-r--r-- | include/net/sock.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/include/net/sock.h b/include/net/sock.h index 5c97b0fc5623..66772cf8c3c5 100644 --- a/include/net/sock.h +++ b/include/net/sock.h | |||
@@ -866,6 +866,18 @@ struct inet_hashinfo; | |||
866 | struct raw_hashinfo; | 866 | struct raw_hashinfo; |
867 | struct module; | 867 | struct module; |
868 | 868 | ||
869 | /* | ||
870 | * caches using SLAB_DESTROY_BY_RCU should let .next pointer from nulls nodes | ||
871 | * un-modified. Special care is taken when initializing object to zero. | ||
872 | */ | ||
873 | static inline void sk_prot_clear_nulls(struct sock *sk, int size) | ||
874 | { | ||
875 | if (offsetof(struct sock, sk_node.next) != 0) | ||
876 | memset(sk, 0, offsetof(struct sock, sk_node.next)); | ||
877 | memset(&sk->sk_node.pprev, 0, | ||
878 | size - offsetof(struct sock, sk_node.pprev)); | ||
879 | } | ||
880 | |||
869 | /* Networking protocol blocks we attach to sockets. | 881 | /* Networking protocol blocks we attach to sockets. |
870 | * socket layer -> transport layer interface | 882 | * socket layer -> transport layer interface |
871 | * transport -> network interface is defined by struct inet_proto | 883 | * transport -> network interface is defined by struct inet_proto |