diff options
Diffstat (limited to 'include/net')
| -rw-r--r-- | include/net/inetpeer.h | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/include/net/inetpeer.h b/include/net/inetpeer.h index 6efe73c79c52..058271bde27a 100644 --- a/include/net/inetpeer.h +++ b/include/net/inetpeer.h | |||
| @@ -177,16 +177,9 @@ static inline void inet_peer_refcheck(const struct inet_peer *p) | |||
| 177 | /* can be called with or without local BH being disabled */ | 177 | /* can be called with or without local BH being disabled */ |
| 178 | static inline int inet_getid(struct inet_peer *p, int more) | 178 | static inline int inet_getid(struct inet_peer *p, int more) |
| 179 | { | 179 | { |
| 180 | int old, new; | ||
| 181 | more++; | 180 | more++; |
| 182 | inet_peer_refcheck(p); | 181 | inet_peer_refcheck(p); |
| 183 | do { | 182 | return atomic_add_return(more, &p->ip_id_count) - more; |
| 184 | old = atomic_read(&p->ip_id_count); | ||
| 185 | new = old + more; | ||
| 186 | if (!new) | ||
| 187 | new = 1; | ||
| 188 | } while (atomic_cmpxchg(&p->ip_id_count, old, new) != old); | ||
| 189 | return new; | ||
| 190 | } | 183 | } |
| 191 | 184 | ||
| 192 | #endif /* _NET_INETPEER_H */ | 185 | #endif /* _NET_INETPEER_H */ |
