diff options
author | Steven Whitehouse <swhiteho@redhat.com> | 2006-07-17 09:25:26 -0400 |
---|---|---|
committer | Steven Whitehouse <swhiteho@redhat.com> | 2006-07-17 09:25:26 -0400 |
commit | 4bf311ddfbffe12d41ad1a3c311ab727db6f72cb (patch) | |
tree | 9d19a2774e83637d86dc876f3af22af1dacf0bec /net/core/stream.c | |
parent | 597d0cae0f99f62501e229bed50e8149604015bb (diff) | |
parent | 82d6897fefca6206bca7153805b4c5359ce97fc4 (diff) |
Merge branch 'master'
Diffstat (limited to 'net/core/stream.c')
-rw-r--r-- | net/core/stream.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/net/core/stream.c b/net/core/stream.c index e9489696f694..d1d7decf70b0 100644 --- a/net/core/stream.c +++ b/net/core/stream.c | |||
@@ -196,15 +196,13 @@ EXPORT_SYMBOL(sk_stream_error); | |||
196 | 196 | ||
197 | void __sk_stream_mem_reclaim(struct sock *sk) | 197 | void __sk_stream_mem_reclaim(struct sock *sk) |
198 | { | 198 | { |
199 | if (sk->sk_forward_alloc >= SK_STREAM_MEM_QUANTUM) { | 199 | atomic_sub(sk->sk_forward_alloc / SK_STREAM_MEM_QUANTUM, |
200 | atomic_sub(sk->sk_forward_alloc / SK_STREAM_MEM_QUANTUM, | 200 | sk->sk_prot->memory_allocated); |
201 | sk->sk_prot->memory_allocated); | 201 | sk->sk_forward_alloc &= SK_STREAM_MEM_QUANTUM - 1; |
202 | sk->sk_forward_alloc &= SK_STREAM_MEM_QUANTUM - 1; | 202 | if (*sk->sk_prot->memory_pressure && |
203 | if (*sk->sk_prot->memory_pressure && | 203 | (atomic_read(sk->sk_prot->memory_allocated) < |
204 | (atomic_read(sk->sk_prot->memory_allocated) < | 204 | sk->sk_prot->sysctl_mem[0])) |
205 | sk->sk_prot->sysctl_mem[0])) | 205 | *sk->sk_prot->memory_pressure = 0; |
206 | *sk->sk_prot->memory_pressure = 0; | ||
207 | } | ||
208 | } | 206 | } |
209 | 207 | ||
210 | EXPORT_SYMBOL(__sk_stream_mem_reclaim); | 208 | EXPORT_SYMBOL(__sk_stream_mem_reclaim); |