summaryrefslogtreecommitdiff
path: root/include/net/sock.h
diff options
context:
space:
mode:
authorStephen Boyd <sboyd@codeaurora.org>2013-06-24 17:45:02 -0700
committerStephen Boyd <sboyd@codeaurora.org>2013-06-24 17:45:02 -0700
commit42cba6e27c4cddc4df701c597dbfa666e1c013c8 (patch)
tree6fe38f37a79391bce3db56f311d0f3b83711fad0 /include/net/sock.h
parentf722406faae2d073cc1d01063d1123c35425939e (diff)
parent2699339361a9bacb3fa663e6b8981a040cfca4ee (diff)
Merge branch 'timers/core' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip into remove-local-timers
Diffstat (limited to 'include/net/sock.h')
-rw-r--r--include/net/sock.h12
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;
struct raw_hashinfo;
struct module;
+/*
+ * caches using SLAB_DESTROY_BY_RCU should let .next pointer from nulls nodes
+ * un-modified. Special care is taken when initializing object to zero.
+ */
+static inline void sk_prot_clear_nulls(struct sock *sk, int size)
+{
+ if (offsetof(struct sock, sk_node.next) != 0)
+ memset(sk, 0, offsetof(struct sock, sk_node.next));
+ memset(&sk->sk_node.pprev, 0,
+ size - offsetof(struct sock, sk_node.pprev));
+}
+
/* Networking protocol blocks we attach to sockets.
* socket layer -> transport layer interface
* transport -> network interface is defined by struct inet_proto