]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
knfsd: cache unregistration needn't return error
authorJ. Bruce Fields <bfields@citi.umich.edu>
Thu, 8 Nov 2007 21:09:59 +0000 (16:09 -0500)
committerJ. Bruce Fields <bfields@citi.umich.edu>
Fri, 1 Feb 2008 21:42:04 +0000 (16:42 -0500)
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>
fs/nfsd/export.c
fs/nfsd/nfs4idmap.c
include/linux/sunrpc/cache.h
net/sunrpc/auth_gss/svcauth_gss.c
net/sunrpc/cache.c
net/sunrpc/sunrpc_syms.c

index 66d0aeb32a47e5f4385e68c1947a8d8c1ab3a7e5..d29b70a28f2bc6e1854350ad467c50796c6fc83a 100644 (file)
@@ -1670,10 +1670,8 @@ nfsd_export_shutdown(void)
 
        exp_writelock();
 
-       if (cache_unregister(&svc_expkey_cache))
-               printk(KERN_ERR "nfsd: failed to unregister expkey cache\n");
-       if (cache_unregister(&svc_export_cache))
-               printk(KERN_ERR "nfsd: failed to unregister export cache\n");
+       cache_unregister(&svc_expkey_cache);
+       cache_unregister(&svc_export_cache);
        svcauth_unix_purge();
 
        exp_writeunlock();
index 5b56c77c15c568b362526bbf9c6338daf29fe0a9..ef22179c49ad6f768303c8c946fe4211acaf516b 100644 (file)
@@ -474,10 +474,8 @@ nfsd_idmap_init(void)
 void
 nfsd_idmap_shutdown(void)
 {
-       if (cache_unregister(&idtoname_cache))
-               printk(KERN_ERR "nfsd: failed to unregister idtoname cache\n");
-       if (cache_unregister(&nametoid_cache))
-               printk(KERN_ERR "nfsd: failed to unregister nametoid cache\n");
+       cache_unregister(&idtoname_cache);
+       cache_unregister(&nametoid_cache);
 }
 
 /*
index bd7a6b0a87af654e080093037915238b6fc4fd74..b683b5ddeea98304817872fe01c99b49d5e7ba69 100644 (file)
@@ -170,7 +170,7 @@ extern void cache_flush(void);
 extern void cache_purge(struct cache_detail *detail);
 #define NEVER (0x7FFFFFFF)
 extern void cache_register(struct cache_detail *cd);
-extern int cache_unregister(struct cache_detail *cd);
+extern void cache_unregister(struct cache_detail *cd);
 
 extern void qword_add(char **bpp, int *lp, char *str);
 extern void qword_addhex(char **bpp, int *lp, char *buf, int blen);
index 73940df6c460c210d15e9f3c42c3a7b52a2694c7..d329a12500aae8dfd35a38679fdde6af8999cbf0 100644 (file)
@@ -1396,9 +1396,7 @@ gss_svc_init(void)
 void
 gss_svc_shutdown(void)
 {
-       if (cache_unregister(&rsc_cache))
-               printk(KERN_ERR "auth_rpcgss: failed to unregister rsc cache\n");
-       if (cache_unregister(&rsi_cache))
-               printk(KERN_ERR "auth_rpcgss: failed to unregister rsi cache\n");
+       cache_unregister(&rsc_cache);
+       cache_unregister(&rsi_cache);
        svc_auth_unregister(RPC_AUTH_GSS);
 }
index 3b11277d27b1fbfe92c5b8096a1793a942026c55..365586a999eaddf514a66660b97393102984a39c 100644 (file)
@@ -343,7 +343,7 @@ void cache_register(struct cache_detail *cd)
        schedule_delayed_work(&cache_cleaner, 0);
 }
 
-int cache_unregister(struct cache_detail *cd)
+void cache_unregister(struct cache_detail *cd)
 {
        cache_purge(cd);
        spin_lock(&cache_list_lock);
@@ -351,7 +351,7 @@ int cache_unregister(struct cache_detail *cd)
        if (cd->entries || atomic_read(&cd->inuse)) {
                write_unlock(&cd->hash_lock);
                spin_unlock(&cache_list_lock);
-               return -EBUSY;
+               goto out;
        }
        if (current_detail == cd)
                current_detail = NULL;
@@ -373,7 +373,9 @@ int cache_unregister(struct cache_detail *cd)
                /* module must be being unloaded so its safe to kill the worker */
                cancel_delayed_work_sync(&cache_cleaner);
        }
-       return 0;
+       return;
+out:
+       printk(KERN_ERR "nfsd: failed to unregister %s cache\n", cd->name);
 }
 
 /* clean cache tries to find something to clean
index 1a7e309d008bcd9624dff48195c8052c515a3791..ef7dc78e2c7bc6983b18fe8177ffcf3262ac1b15 100644 (file)
@@ -98,10 +98,8 @@ cleanup_sunrpc(void)
        cleanup_socket_xprt();
        unregister_rpc_pipefs();
        rpc_destroy_mempool();
-       if (cache_unregister(&ip_map_cache))
-               printk(KERN_ERR "sunrpc: failed to unregister ip_map cache\n");
-       if (cache_unregister(&unix_gid_cache))
-             printk(KERN_ERR "sunrpc: failed to unregister unix_gid cache\n");
+       cache_unregister(&ip_map_cache);
+       cache_unregister(&unix_gid_cache);
 #ifdef RPC_DEBUG
        rpc_unregister_sysctl();
 #endif