diff options
author | J. Bruce Fields <bfields@citi.umich.edu> | 2007-11-08 16:09:59 -0500 |
---|---|---|
committer | J. Bruce Fields <bfields@citi.umich.edu> | 2008-02-01 16:42:04 -0500 |
commit | df95a9d4fb91d819d3fb55dd437056df59e7f15e (patch) | |
tree | 9c35b2617a202c029803791c19d55a0483d9d225 /net/sunrpc/cache.c | |
parent | d5c3428b2cb26d605fddc4878f4fcc03c23df89f (diff) |
knfsd: cache unregistration needn't return error
There's really nothing much the caller can do if cache unregistration
fails. And indeed, all any caller does in this case is print an error
and continue. So just return void and move the printk's inside
cache_unregister.
Acked-by: NeilBrown <neilb@suse.de>
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Diffstat (limited to 'net/sunrpc/cache.c')
-rw-r--r-- | net/sunrpc/cache.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/net/sunrpc/cache.c b/net/sunrpc/cache.c index 3b11277d27b1..365586a999ea 100644 --- a/net/sunrpc/cache.c +++ b/net/sunrpc/cache.c | |||
@@ -343,7 +343,7 @@ void cache_register(struct cache_detail *cd) | |||
343 | schedule_delayed_work(&cache_cleaner, 0); | 343 | schedule_delayed_work(&cache_cleaner, 0); |
344 | } | 344 | } |
345 | 345 | ||
346 | int cache_unregister(struct cache_detail *cd) | 346 | void cache_unregister(struct cache_detail *cd) |
347 | { | 347 | { |
348 | cache_purge(cd); | 348 | cache_purge(cd); |
349 | spin_lock(&cache_list_lock); | 349 | spin_lock(&cache_list_lock); |
@@ -351,7 +351,7 @@ int cache_unregister(struct cache_detail *cd) | |||
351 | if (cd->entries || atomic_read(&cd->inuse)) { | 351 | if (cd->entries || atomic_read(&cd->inuse)) { |
352 | write_unlock(&cd->hash_lock); | 352 | write_unlock(&cd->hash_lock); |
353 | spin_unlock(&cache_list_lock); | 353 | spin_unlock(&cache_list_lock); |
354 | return -EBUSY; | 354 | goto out; |
355 | } | 355 | } |
356 | if (current_detail == cd) | 356 | if (current_detail == cd) |
357 | current_detail = NULL; | 357 | current_detail = NULL; |
@@ -373,7 +373,9 @@ int cache_unregister(struct cache_detail *cd) | |||
373 | /* module must be being unloaded so its safe to kill the worker */ | 373 | /* module must be being unloaded so its safe to kill the worker */ |
374 | cancel_delayed_work_sync(&cache_cleaner); | 374 | cancel_delayed_work_sync(&cache_cleaner); |
375 | } | 375 | } |
376 | return 0; | 376 | return; |
377 | out: | ||
378 | printk(KERN_ERR "nfsd: failed to unregister %s cache\n", cd->name); | ||
377 | } | 379 | } |
378 | 380 | ||
379 | /* clean cache tries to find something to clean | 381 | /* clean cache tries to find something to clean |