diff options
author | Vlad Yasevich <vladislav.yasevich@hp.com> | 2007-11-09 11:43:40 -0500 |
---|---|---|
committer | Vlad Yasevich <vladislav.yasevich@hp.com> | 2007-11-09 11:43:40 -0500 |
commit | d970dbf8455eb1b8cebd3cde6e18f73dd1b3ce38 (patch) | |
tree | e7866d392c3654a379492ca78249231be47401a4 /include/net | |
parent | 123ed979eaa8de0dd2422862d247469eda0bd645 (diff) |
SCTP: Convert custom hash lists to use hlist.
Convert the custom hash list traversals to use hlist functions.
Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com>
Diffstat (limited to 'include/net')
-rw-r--r-- | include/net/sctp/sctp.h | 3 | ||||
-rw-r--r-- | include/net/sctp/structs.h | 10 |
2 files changed, 7 insertions, 6 deletions
diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h index 70827305f501..67c997cecf58 100644 --- a/include/net/sctp/sctp.h +++ b/include/net/sctp/sctp.h | |||
@@ -665,6 +665,9 @@ static inline int sctp_vtag_hashfn(__u16 lport, __u16 rport, __u32 vtag) | |||
665 | return (h & (sctp_assoc_hashsize-1)); | 665 | return (h & (sctp_assoc_hashsize-1)); |
666 | } | 666 | } |
667 | 667 | ||
668 | #define sctp_for_each_hentry(epb, node, head) \ | ||
669 | hlist_for_each_entry(epb, node, head, node) | ||
670 | |||
668 | /* Is a socket of this style? */ | 671 | /* Is a socket of this style? */ |
669 | #define sctp_style(sk, style) __sctp_style((sk), (SCTP_SOCKET_##style)) | 672 | #define sctp_style(sk, style) __sctp_style((sk), (SCTP_SOCKET_##style)) |
670 | static inline int __sctp_style(const struct sock *sk, sctp_socket_type_t style) | 673 | static inline int __sctp_style(const struct sock *sk, sctp_socket_type_t style) |
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h index 44f2672859e2..eb3113c38a94 100644 --- a/include/net/sctp/structs.h +++ b/include/net/sctp/structs.h | |||
@@ -100,20 +100,19 @@ struct crypto_hash; | |||
100 | struct sctp_bind_bucket { | 100 | struct sctp_bind_bucket { |
101 | unsigned short port; | 101 | unsigned short port; |
102 | unsigned short fastreuse; | 102 | unsigned short fastreuse; |
103 | struct sctp_bind_bucket *next; | 103 | struct hlist_node node; |
104 | struct sctp_bind_bucket **pprev; | ||
105 | struct hlist_head owner; | 104 | struct hlist_head owner; |
106 | }; | 105 | }; |
107 | 106 | ||
108 | struct sctp_bind_hashbucket { | 107 | struct sctp_bind_hashbucket { |
109 | spinlock_t lock; | 108 | spinlock_t lock; |
110 | struct sctp_bind_bucket *chain; | 109 | struct hlist_head chain; |
111 | }; | 110 | }; |
112 | 111 | ||
113 | /* Used for hashing all associations. */ | 112 | /* Used for hashing all associations. */ |
114 | struct sctp_hashbucket { | 113 | struct sctp_hashbucket { |
115 | rwlock_t lock; | 114 | rwlock_t lock; |
116 | struct sctp_ep_common *chain; | 115 | struct hlist_head chain; |
117 | } __attribute__((__aligned__(8))); | 116 | } __attribute__((__aligned__(8))); |
118 | 117 | ||
119 | 118 | ||
@@ -1230,8 +1229,7 @@ typedef enum { | |||
1230 | 1229 | ||
1231 | struct sctp_ep_common { | 1230 | struct sctp_ep_common { |
1232 | /* Fields to help us manage our entries in the hash tables. */ | 1231 | /* Fields to help us manage our entries in the hash tables. */ |
1233 | struct sctp_ep_common *next; | 1232 | struct hlist_node node; |
1234 | struct sctp_ep_common **pprev; | ||
1235 | int hashent; | 1233 | int hashent; |
1236 | 1234 | ||
1237 | /* Runtime type information. What kind of endpoint is this? */ | 1235 | /* Runtime type information. What kind of endpoint is this? */ |