.. | .. |
---|
148 | 148 | struct inet_peer *gc_stack[], |
---|
149 | 149 | unsigned int gc_cnt) |
---|
150 | 150 | { |
---|
| 151 | + int peer_threshold, peer_maxttl, peer_minttl; |
---|
151 | 152 | struct inet_peer *p; |
---|
152 | 153 | __u32 delta, ttl; |
---|
153 | 154 | int i; |
---|
154 | 155 | |
---|
155 | | - if (base->total >= inet_peer_threshold) |
---|
| 156 | + peer_threshold = READ_ONCE(inet_peer_threshold); |
---|
| 157 | + peer_maxttl = READ_ONCE(inet_peer_maxttl); |
---|
| 158 | + peer_minttl = READ_ONCE(inet_peer_minttl); |
---|
| 159 | + |
---|
| 160 | + if (base->total >= peer_threshold) |
---|
156 | 161 | ttl = 0; /* be aggressive */ |
---|
157 | 162 | else |
---|
158 | | - ttl = inet_peer_maxttl |
---|
159 | | - - (inet_peer_maxttl - inet_peer_minttl) / HZ * |
---|
160 | | - base->total / inet_peer_threshold * HZ; |
---|
| 163 | + ttl = peer_maxttl - (peer_maxttl - peer_minttl) / HZ * |
---|
| 164 | + base->total / peer_threshold * HZ; |
---|
161 | 165 | for (i = 0; i < gc_cnt; i++) { |
---|
162 | 166 | p = gc_stack[i]; |
---|
163 | 167 | |
---|