From patchwork Tue Dec 14 15:06:22 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chuck Lever X-Patchwork-Id: 410351 X-Patchwork-Delegate: Trond.Myklebust@netapp.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id oBEF5SG2013575 for ; Tue, 14 Dec 2010 15:06:26 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757961Ab0LNPG0 (ORCPT ); Tue, 14 Dec 2010 10:06:26 -0500 Received: from mail-iw0-f174.google.com ([209.85.214.174]:45794 "EHLO mail-iw0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757715Ab0LNPGZ (ORCPT ); Tue, 14 Dec 2010 10:06:25 -0500 Received: by mail-iw0-f174.google.com with SMTP id 9so869885iwn.19 for ; Tue, 14 Dec 2010 07:06:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:from:subject:to:cc :date:message-id:in-reply-to:references:user-agent:mime-version :content-type:content-transfer-encoding; bh=VYmlD567I0hEUOu7/jozR6pQoXxzUdeKf5r26ZdZA9M=; b=XNsgr/9gkl5bsistd1Mg9zOX7gq1orUpA7bDe4AjQhXW0y2ILoOoQFdSCa0DqJOjAj v8yoI8ibJrFjM/4o6jpKJISf/YmfbG7/b/qqTS9w3B85ZML/K5gjIeKOipWNnQBgkM3K d1pfXQ8g3gCSTgoKi6XkibAX4btBLRWmvcui0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:from:subject:to:cc:date:message-id:in-reply-to:references :user-agent:mime-version:content-type:content-transfer-encoding; b=BfK5s0EViNLT8VFYVG9JBNOBruuhhtcDsWyKIXx6z01A1nCukqPHjsi1kiiaHacfMl chJyzJumgPgLI+VkuFsnxn23zyYOAKISFTh9xBkx0O/x+YNYzwgkg1Sx9dqVe4HIUZ3F MlbvP+p89VZRBYyv5Vp4shN2nWrUfteE6MS9I= Received: by 10.231.13.137 with SMTP id c9mr3387440iba.37.1292339185113; Tue, 14 Dec 2010 07:06:25 -0800 (PST) Received: from matisse.1015granger.net ([99.26.161.222]) by mx.google.com with ESMTPS id i16sm108476ibl.18.2010.12.14.07.06.23 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 14 Dec 2010 07:06:24 -0800 (PST) From: Chuck Lever Subject: [PATCH 08/11] lockd: Rename nlm_hosts To: trond.myklebust@netapp.com Cc: linux-nfs@vger.kernel.org Date: Tue, 14 Dec 2010 10:06:22 -0500 Message-ID: <20101214150622.2736.23447.stgit@matisse.1015granger.net> In-Reply-To: <20101214150036.2736.98254.stgit@matisse.1015granger.net> References: <20101214150036.2736.98254.stgit@matisse.1015granger.net> User-Agent: StGIT/0.14.3 MIME-Version: 1.0 Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Tue, 14 Dec 2010 15:06:27 +0000 (UTC) diff --git a/fs/lockd/host.c b/fs/lockd/host.c index 0250b0e..87fbde1 100644 --- a/fs/lockd/host.c +++ b/fs/lockd/host.c @@ -25,7 +25,7 @@ #define NLM_HOST_EXPIRE (300 * HZ) #define NLM_HOST_COLLECT (120 * HZ) -static struct hlist_head nlm_hosts[NLM_HOST_NRHASH]; +static struct hlist_head nlm_server_hosts[NLM_HOST_NRHASH]; static struct hlist_head nlm_client_hosts[NLM_HOST_NRHASH]; #define for_each_host(host, pos, chain, table) \ @@ -184,7 +184,7 @@ static struct nlm_host *nlm_lookup_host(struct nlm_lookup_host_info *ni) * different NLM rpc_clients into one single nlm_host object. * This would allow us to have one nlm_host per address. */ - chain = &nlm_hosts[nlm_hash_address(ni->sap)]; + chain = &nlm_server_hosts[nlm_hash_address(ni->sap)]; hlist_for_each_entry(host, pos, chain, h_hash) { if (!rpc_cmp_addr(nlm_addr(host), ni->sap)) continue; @@ -428,7 +428,7 @@ struct nlm_host *nlmsvc_lookup_host(const struct svc_rqst *rqstp, if (time_after_eq(jiffies, next_gc)) nlm_gc_hosts(); - chain = &nlm_hosts[nlm_hash_address(ni.sap)]; + chain = &nlm_server_hosts[nlm_hash_address(ni.sap)]; hlist_for_each_entry(host, pos, chain, h_hash) { if (!rpc_cmp_addr(nlm_addr(host), ni.sap)) continue; @@ -632,7 +632,7 @@ void nlm_host_rebooted(const struct nlm_reboot *info) * lock for this. * To avoid processing a host several times, we match the nsmstate. */ - while ((host = next_host_state(nlm_hosts, nsm, info)) != NULL) { + while ((host = next_host_state(nlm_server_hosts, nsm, info)) != NULL) { nlmsvc_free_host_resources(host); nlmsvc_release_host(host); } @@ -660,7 +660,7 @@ nlm_shutdown_hosts(void) /* First, make all hosts eligible for gc */ dprintk("lockd: nuking all hosts...\n"); - for_each_host(host, pos, chain, nlm_hosts) { + for_each_host(host, pos, chain, nlm_server_hosts) { host->h_expires = jiffies - 1; if (host->h_rpcclnt) { rpc_shutdown_client(host->h_rpcclnt); @@ -676,7 +676,7 @@ nlm_shutdown_hosts(void) if (nrhosts) { printk(KERN_WARNING "lockd: couldn't shutdown host module!\n"); dprintk("lockd: %d hosts left:\n", nrhosts); - for_each_host(host, pos, chain, nlm_hosts) { + for_each_host(host, pos, chain, nlm_server_hosts) { dprintk(" %s (cnt %d use %d exp %ld)\n", host->h_name, atomic_read(&host->h_count), host->h_inuse, host->h_expires); @@ -697,13 +697,13 @@ nlm_gc_hosts(void) struct nlm_host *host; dprintk("lockd: host garbage collection\n"); - for_each_host(host, pos, chain, nlm_hosts) + for_each_host(host, pos, chain, nlm_server_hosts) host->h_inuse = 0; /* Mark all hosts that hold locks, blocks or shares */ nlmsvc_mark_resources(); - for_each_host_safe(host, pos, next, chain, nlm_hosts) { + for_each_host_safe(host, pos, next, chain, nlm_server_hosts) { if (atomic_read(&host->h_count) || host->h_inuse || time_before(jiffies, host->h_expires)) { dprintk("nlm_gc_hosts skipping %s "