auth.c (020abf03cd659388f94cb328e1e1df0656e0d7ff) | auth.c (1495f230fa7750479c79e3656286b9183d662077) |
---|---|
1/* 2 * linux/net/sunrpc/auth.c 3 * 4 * Generic RPC client authentication API. 5 * 6 * Copyright (C) 1996, Olaf Kirch <okir@monad.swb.de> 7 */ 8 --- 312 unchanged lines hidden (view full) --- 321 } 322 return (number_cred_unused / 100) * sysctl_vfs_cache_pressure; 323} 324 325/* 326 * Run memory cache shrinker. 327 */ 328static int | 1/* 2 * linux/net/sunrpc/auth.c 3 * 4 * Generic RPC client authentication API. 5 * 6 * Copyright (C) 1996, Olaf Kirch <okir@monad.swb.de> 7 */ 8 --- 312 unchanged lines hidden (view full) --- 321 } 322 return (number_cred_unused / 100) * sysctl_vfs_cache_pressure; 323} 324 325/* 326 * Run memory cache shrinker. 327 */ 328static int |
329rpcauth_cache_shrinker(struct shrinker *shrink, int nr_to_scan, gfp_t gfp_mask) | 329rpcauth_cache_shrinker(struct shrinker *shrink, struct shrink_control *sc) |
330{ 331 LIST_HEAD(free); 332 int res; | 330{ 331 LIST_HEAD(free); 332 int res; |
333 int nr_to_scan = sc->nr_to_scan; 334 gfp_t gfp_mask = sc->gfp_mask; |
|
333 334 if ((gfp_mask & GFP_KERNEL) != GFP_KERNEL) 335 return (nr_to_scan == 0) ? 0 : -1; 336 if (list_empty(&cred_unused)) 337 return 0; 338 spin_lock(&rpc_credcache_lock); 339 res = rpcauth_prune_expired(&free, nr_to_scan); 340 spin_unlock(&rpc_credcache_lock); --- 346 unchanged lines hidden --- | 335 336 if ((gfp_mask & GFP_KERNEL) != GFP_KERNEL) 337 return (nr_to_scan == 0) ? 0 : -1; 338 if (list_empty(&cred_unused)) 339 return 0; 340 spin_lock(&rpc_credcache_lock); 341 res = rpcauth_prune_expired(&free, nr_to_scan); 342 spin_unlock(&rpc_credcache_lock); --- 346 unchanged lines hidden --- |