浏览代码

net: add a wrapper sk_entry()

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Li Zefan 15 年之前
父节点
当前提交
c4146644a5
共有 1 个文件被更改,包括 5 次插入0 次删除
  1. 5 0
      include/net/sock.h

+ 5 - 0
include/net/sock.h

@@ -317,6 +317,11 @@ struct sock {
 /*
 /*
  * Hashed lists helper routines
  * Hashed lists helper routines
  */
  */
+static inline struct sock *sk_entry(const struct hlist_node *node)
+{
+	return hlist_entry(node, struct sock, sk_node);
+}
+
 static inline struct sock *__sk_head(const struct hlist_head *head)
 static inline struct sock *__sk_head(const struct hlist_head *head)
 {
 {
 	return hlist_entry(head->first, struct sock, sk_node);
 	return hlist_entry(head->first, struct sock, sk_node);