diff options
| author | Ingo Molnar <mingo@elte.hu> | 2008-11-10 03:16:27 -0500 |
|---|---|---|
| committer | Ingo Molnar <mingo@elte.hu> | 2008-11-10 03:16:27 -0500 |
| commit | 4ecd33d930591d41fe356160593a9076467b961c (patch) | |
| tree | b9051a334540bbce38db1b2b03cebb4cf1d51f73 /net/sunrpc/auth.c | |
| parent | 7d5a78cd98c3a5eb83bd6a061c5ea6ef1e9b8fcb (diff) | |
| parent | f7160c7573615ec82c691e294cf80d920b5d588d (diff) | |
Merge commit 'v2.6.28-rc4' into x86/apic
Diffstat (limited to 'net/sunrpc/auth.c')
| -rw-r--r-- | net/sunrpc/auth.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/net/sunrpc/auth.c b/net/sunrpc/auth.c index 436bf1b4b76c..cb216b2df666 100644 --- a/net/sunrpc/auth.c +++ b/net/sunrpc/auth.c | |||
| @@ -228,19 +228,21 @@ static int | |||
| 228 | rpcauth_prune_expired(struct list_head *free, int nr_to_scan) | 228 | rpcauth_prune_expired(struct list_head *free, int nr_to_scan) |
| 229 | { | 229 | { |
| 230 | spinlock_t *cache_lock; | 230 | spinlock_t *cache_lock; |
| 231 | struct rpc_cred *cred; | 231 | struct rpc_cred *cred, *next; |
| 232 | unsigned long expired = jiffies - RPC_AUTH_EXPIRY_MORATORIUM; | 232 | unsigned long expired = jiffies - RPC_AUTH_EXPIRY_MORATORIUM; |
| 233 | 233 | ||
| 234 | while (!list_empty(&cred_unused)) { | 234 | list_for_each_entry_safe(cred, next, &cred_unused, cr_lru) { |
| 235 | cred = list_entry(cred_unused.next, struct rpc_cred, cr_lru); | 235 | |
| 236 | /* Enforce a 60 second garbage collection moratorium */ | ||
| 237 | if (time_in_range(cred->cr_expire, expired, jiffies) && | ||
| 238 | test_bit(RPCAUTH_CRED_HASHED, &cred->cr_flags) != 0) | ||
| 239 | continue; | ||
| 240 | |||
| 236 | list_del_init(&cred->cr_lru); | 241 | list_del_init(&cred->cr_lru); |
| 237 | number_cred_unused--; | 242 | number_cred_unused--; |
| 238 | if (atomic_read(&cred->cr_count) != 0) | 243 | if (atomic_read(&cred->cr_count) != 0) |
| 239 | continue; | 244 | continue; |
| 240 | /* Enforce a 5 second garbage collection moratorium */ | 245 | |
| 241 | if (time_in_range(cred->cr_expire, expired, jiffies) && | ||
| 242 | test_bit(RPCAUTH_CRED_UPTODATE, &cred->cr_flags) != 0) | ||
| 243 | continue; | ||
| 244 | cache_lock = &cred->cr_auth->au_credcache->lock; | 246 | cache_lock = &cred->cr_auth->au_credcache->lock; |
| 245 | spin_lock(cache_lock); | 247 | spin_lock(cache_lock); |
| 246 | if (atomic_read(&cred->cr_count) == 0) { | 248 | if (atomic_read(&cred->cr_count) == 0) { |
| @@ -453,7 +455,7 @@ need_lock: | |||
| 453 | } | 455 | } |
| 454 | if (test_bit(RPCAUTH_CRED_UPTODATE, &cred->cr_flags) == 0) | 456 | if (test_bit(RPCAUTH_CRED_UPTODATE, &cred->cr_flags) == 0) |
| 455 | rpcauth_unhash_cred(cred); | 457 | rpcauth_unhash_cred(cred); |
| 456 | else if (test_bit(RPCAUTH_CRED_HASHED, &cred->cr_flags) != 0) { | 458 | if (test_bit(RPCAUTH_CRED_HASHED, &cred->cr_flags) != 0) { |
| 457 | cred->cr_expire = jiffies; | 459 | cred->cr_expire = jiffies; |
| 458 | list_add_tail(&cred->cr_lru, &cred_unused); | 460 | list_add_tail(&cred->cr_lru, &cred_unused); |
| 459 | number_cred_unused++; | 461 | number_cred_unused++; |
