diff options
Diffstat (limited to 'net/iucv/af_iucv.c')
-rw-r--r-- | net/iucv/af_iucv.c | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/net/iucv/af_iucv.c b/net/iucv/af_iucv.c index cd6f7a991d80..a7d11ffe4284 100644 --- a/net/iucv/af_iucv.c +++ b/net/iucv/af_iucv.c | |||
@@ -156,14 +156,13 @@ static int afiucv_pm_freeze(struct device *dev) | |||
156 | { | 156 | { |
157 | struct iucv_sock *iucv; | 157 | struct iucv_sock *iucv; |
158 | struct sock *sk; | 158 | struct sock *sk; |
159 | struct hlist_node *node; | ||
160 | int err = 0; | 159 | int err = 0; |
161 | 160 | ||
162 | #ifdef CONFIG_PM_DEBUG | 161 | #ifdef CONFIG_PM_DEBUG |
163 | printk(KERN_WARNING "afiucv_pm_freeze\n"); | 162 | printk(KERN_WARNING "afiucv_pm_freeze\n"); |
164 | #endif | 163 | #endif |
165 | read_lock(&iucv_sk_list.lock); | 164 | read_lock(&iucv_sk_list.lock); |
166 | sk_for_each(sk, node, &iucv_sk_list.head) { | 165 | sk_for_each(sk, &iucv_sk_list.head) { |
167 | iucv = iucv_sk(sk); | 166 | iucv = iucv_sk(sk); |
168 | switch (sk->sk_state) { | 167 | switch (sk->sk_state) { |
169 | case IUCV_DISCONN: | 168 | case IUCV_DISCONN: |
@@ -194,13 +193,12 @@ static int afiucv_pm_freeze(struct device *dev) | |||
194 | static int afiucv_pm_restore_thaw(struct device *dev) | 193 | static int afiucv_pm_restore_thaw(struct device *dev) |
195 | { | 194 | { |
196 | struct sock *sk; | 195 | struct sock *sk; |
197 | struct hlist_node *node; | ||
198 | 196 | ||
199 | #ifdef CONFIG_PM_DEBUG | 197 | #ifdef CONFIG_PM_DEBUG |
200 | printk(KERN_WARNING "afiucv_pm_restore_thaw\n"); | 198 | printk(KERN_WARNING "afiucv_pm_restore_thaw\n"); |
201 | #endif | 199 | #endif |
202 | read_lock(&iucv_sk_list.lock); | 200 | read_lock(&iucv_sk_list.lock); |
203 | sk_for_each(sk, node, &iucv_sk_list.head) { | 201 | sk_for_each(sk, &iucv_sk_list.head) { |
204 | switch (sk->sk_state) { | 202 | switch (sk->sk_state) { |
205 | case IUCV_CONNECTED: | 203 | case IUCV_CONNECTED: |
206 | sk->sk_err = EPIPE; | 204 | sk->sk_err = EPIPE; |
@@ -390,9 +388,8 @@ static int afiucv_hs_send(struct iucv_message *imsg, struct sock *sock, | |||
390 | static struct sock *__iucv_get_sock_by_name(char *nm) | 388 | static struct sock *__iucv_get_sock_by_name(char *nm) |
391 | { | 389 | { |
392 | struct sock *sk; | 390 | struct sock *sk; |
393 | struct hlist_node *node; | ||
394 | 391 | ||
395 | sk_for_each(sk, node, &iucv_sk_list.head) | 392 | sk_for_each(sk, &iucv_sk_list.head) |
396 | if (!memcmp(&iucv_sk(sk)->src_name, nm, 8)) | 393 | if (!memcmp(&iucv_sk(sk)->src_name, nm, 8)) |
397 | return sk; | 394 | return sk; |
398 | 395 | ||
@@ -1678,7 +1675,6 @@ static int iucv_callback_connreq(struct iucv_path *path, | |||
1678 | unsigned char user_data[16]; | 1675 | unsigned char user_data[16]; |
1679 | unsigned char nuser_data[16]; | 1676 | unsigned char nuser_data[16]; |
1680 | unsigned char src_name[8]; | 1677 | unsigned char src_name[8]; |
1681 | struct hlist_node *node; | ||
1682 | struct sock *sk, *nsk; | 1678 | struct sock *sk, *nsk; |
1683 | struct iucv_sock *iucv, *niucv; | 1679 | struct iucv_sock *iucv, *niucv; |
1684 | int err; | 1680 | int err; |
@@ -1689,7 +1685,7 @@ static int iucv_callback_connreq(struct iucv_path *path, | |||
1689 | read_lock(&iucv_sk_list.lock); | 1685 | read_lock(&iucv_sk_list.lock); |
1690 | iucv = NULL; | 1686 | iucv = NULL; |
1691 | sk = NULL; | 1687 | sk = NULL; |
1692 | sk_for_each(sk, node, &iucv_sk_list.head) | 1688 | sk_for_each(sk, &iucv_sk_list.head) |
1693 | if (sk->sk_state == IUCV_LISTEN && | 1689 | if (sk->sk_state == IUCV_LISTEN && |
1694 | !memcmp(&iucv_sk(sk)->src_name, src_name, 8)) { | 1690 | !memcmp(&iucv_sk(sk)->src_name, src_name, 8)) { |
1695 | /* | 1691 | /* |
@@ -2115,7 +2111,6 @@ static int afiucv_hs_callback_rx(struct sock *sk, struct sk_buff *skb) | |||
2115 | static int afiucv_hs_rcv(struct sk_buff *skb, struct net_device *dev, | 2111 | static int afiucv_hs_rcv(struct sk_buff *skb, struct net_device *dev, |
2116 | struct packet_type *pt, struct net_device *orig_dev) | 2112 | struct packet_type *pt, struct net_device *orig_dev) |
2117 | { | 2113 | { |
2118 | struct hlist_node *node; | ||
2119 | struct sock *sk; | 2114 | struct sock *sk; |
2120 | struct iucv_sock *iucv; | 2115 | struct iucv_sock *iucv; |
2121 | struct af_iucv_trans_hdr *trans_hdr; | 2116 | struct af_iucv_trans_hdr *trans_hdr; |
@@ -2132,7 +2127,7 @@ static int afiucv_hs_rcv(struct sk_buff *skb, struct net_device *dev, | |||
2132 | iucv = NULL; | 2127 | iucv = NULL; |
2133 | sk = NULL; | 2128 | sk = NULL; |
2134 | read_lock(&iucv_sk_list.lock); | 2129 | read_lock(&iucv_sk_list.lock); |
2135 | sk_for_each(sk, node, &iucv_sk_list.head) { | 2130 | sk_for_each(sk, &iucv_sk_list.head) { |
2136 | if (trans_hdr->flags == AF_IUCV_FLAG_SYN) { | 2131 | if (trans_hdr->flags == AF_IUCV_FLAG_SYN) { |
2137 | if ((!memcmp(&iucv_sk(sk)->src_name, | 2132 | if ((!memcmp(&iucv_sk(sk)->src_name, |
2138 | trans_hdr->destAppName, 8)) && | 2133 | trans_hdr->destAppName, 8)) && |
@@ -2225,10 +2220,9 @@ static void afiucv_hs_callback_txnotify(struct sk_buff *skb, | |||
2225 | struct sk_buff *list_skb; | 2220 | struct sk_buff *list_skb; |
2226 | struct sk_buff *nskb; | 2221 | struct sk_buff *nskb; |
2227 | unsigned long flags; | 2222 | unsigned long flags; |
2228 | struct hlist_node *node; | ||
2229 | 2223 | ||
2230 | read_lock_irqsave(&iucv_sk_list.lock, flags); | 2224 | read_lock_irqsave(&iucv_sk_list.lock, flags); |
2231 | sk_for_each(sk, node, &iucv_sk_list.head) | 2225 | sk_for_each(sk, &iucv_sk_list.head) |
2232 | if (sk == isk) { | 2226 | if (sk == isk) { |
2233 | iucv = iucv_sk(sk); | 2227 | iucv = iucv_sk(sk); |
2234 | break; | 2228 | break; |
@@ -2299,14 +2293,13 @@ static int afiucv_netdev_event(struct notifier_block *this, | |||
2299 | unsigned long event, void *ptr) | 2293 | unsigned long event, void *ptr) |
2300 | { | 2294 | { |
2301 | struct net_device *event_dev = (struct net_device *)ptr; | 2295 | struct net_device *event_dev = (struct net_device *)ptr; |
2302 | struct hlist_node *node; | ||
2303 | struct sock *sk; | 2296 | struct sock *sk; |
2304 | struct iucv_sock *iucv; | 2297 | struct iucv_sock *iucv; |
2305 | 2298 | ||
2306 | switch (event) { | 2299 | switch (event) { |
2307 | case NETDEV_REBOOT: | 2300 | case NETDEV_REBOOT: |
2308 | case NETDEV_GOING_DOWN: | 2301 | case NETDEV_GOING_DOWN: |
2309 | sk_for_each(sk, node, &iucv_sk_list.head) { | 2302 | sk_for_each(sk, &iucv_sk_list.head) { |
2310 | iucv = iucv_sk(sk); | 2303 | iucv = iucv_sk(sk); |
2311 | if ((iucv->hs_dev == event_dev) && | 2304 | if ((iucv->hs_dev == event_dev) && |
2312 | (sk->sk_state == IUCV_CONNECTED)) { | 2305 | (sk->sk_state == IUCV_CONNECTED)) { |