[PATCH] knfsd: misc minor fixes, indentation changes
authorOlaf Kirch <okir@suse.de>
Wed, 4 Oct 2006 09:15:54 +0000 (02:15 -0700)
committerLinus Torvalds <torvalds@g5.osdl.org>
Wed, 4 Oct 2006 14:55:16 +0000 (07:55 -0700)
cleans up some code in lockd/host.c, fixes an error printk and makes it a
fatal BUG if nlmsvc_free_host_resources fails.

Signed-off-by: Olaf Kirch <okir@suse.de>
Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
fs/lockd/host.c
fs/lockd/svcsubs.c

index 0bf4afb71d25317fff0a9c61d39eac3d74a4b4a7..4990223a3e180f3d7b1379da4cd2c8f98c29c077 100644 (file)
@@ -110,16 +110,13 @@ nlm_lookup_host(int server, const struct sockaddr_in *sin,
                if (host->h_server != server)
                        continue;
 
-               {
-                       if (hp != nlm_hosts + hash) {
-                               *hp = host->h_next;
-                               host->h_next = nlm_hosts[hash];
-                               nlm_hosts[hash] = host;
-                       }
-                       nlm_get_host(host);
-                       mutex_unlock(&nlm_host_mutex);
-                       return host;
+               if (hp != nlm_hosts + hash) {
+                       *hp = host->h_next;
+                       host->h_next = nlm_hosts[hash];
+                       nlm_hosts[hash] = host;
                }
+               nlm_get_host(host);
+               goto out;
        }
 
        /* Sadly, the host isn't in our hash table yet. See if
index a92dd98f84013dbece84aa0367f7ed869f487c92..c8308bccd31967f61d48c940a8dafcecce0cee80 100644 (file)
@@ -115,7 +115,7 @@ nlm_lookup_file(struct svc_rqst *rqstp, struct nlm_file **result,
         * the file.
         */
        if ((nfserr = nlmsvc_ops->fopen(rqstp, f, &file->f_file)) != 0) {
-               dprintk("lockd: open failed (nfserr %d)\n", ntohl(nfserr));
+               dprintk("lockd: open failed (error %d)\n", nfserr);
                goto out_free;
        }
 
@@ -313,10 +313,12 @@ nlmsvc_free_host_resources(struct nlm_host *host)
 {
        dprintk("lockd: nlmsvc_free_host_resources\n");
 
-       if (nlm_traverse_files(host, NLM_ACT_UNLOCK))
+       if (nlm_traverse_files(host, NLM_ACT_UNLOCK)) {
                printk(KERN_WARNING
-                       "lockd: couldn't remove all locks held by %s",
+                       "lockd: couldn't remove all locks held by %s\n",
                        host->h_name);
+               BUG();
+       }
 }
 
 /*