From patchwork Thu Dec 9 16:50:10 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chuck Lever X-Patchwork-Id: 395182 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 oB9Go7S0022957 for ; Thu, 9 Dec 2010 16:50:15 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754419Ab0LIQuO (ORCPT ); Thu, 9 Dec 2010 11:50:14 -0500 Received: from mail-gw0-f42.google.com ([74.125.83.42]:44188 "EHLO mail-gw0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753944Ab0LIQuN (ORCPT ); Thu, 9 Dec 2010 11:50:13 -0500 Received: by mail-gw0-f42.google.com with SMTP id 20so2209519gwb.1 for ; Thu, 09 Dec 2010 08:50:13 -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:date :message-id:in-reply-to:references:user-agent:mime-version :content-type:content-transfer-encoding; bh=GGwHt18zP6NWut2w16xa4pStnrdsVEiL5RaHQtuRcc0=; b=E9o59LJjJbrE2IuCE/ULV5Nq3qNr6cY6JWimifCYHHJjqxc78N4VRS2r9tJuAZu/OD FGeFlWKHh4mIu69JTPTTZKCtkgHaGV8DMxMDJN0TuScmNQVEOufFLrPfHEJmn0NAT7Tu +wjW02OlXL01DimtugldVVRZZYumify7l1Mn4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:from:subject:to:date:message-id:in-reply-to:references :user-agent:mime-version:content-type:content-transfer-encoding; b=LtTW8PBjWzW519Kq5eYUoT/VxzZ8/RVwRzXTgjq5JeqbyXN7jW5O0hPVtzanjteZq7 NH8l9BAUwFLazJXkbjpzLarK358ZfuQYkUBzx6M4GNx48/YYPTqyYXI34X20khqppcp/ 4wbftCOnk1KcX6Ff21k0LZN0Ovb0gVXj4wtwM= Received: by 10.151.44.15 with SMTP id w15mr6795106ybj.86.1291913412957; Thu, 09 Dec 2010 08:50:12 -0800 (PST) Received: from matisse.1015granger.net ([99.26.161.222]) by mx.google.com with ESMTPS id v8sm1250032yhg.40.2010.12.09.08.50.11 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 09 Dec 2010 08:50:12 -0800 (PST) From: Chuck Lever Subject: [PATCH 10/11] lockd: Remove nlm_lookup_host() To: linux-nfs@vger.kernel.org Date: Thu, 09 Dec 2010 11:50:10 -0500 Message-ID: <20101209165010.4513.19156.stgit@matisse.1015granger.net> In-Reply-To: <20101209163555.4513.94435.stgit@matisse.1015granger.net> References: <20101209163555.4513.94435.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]); Thu, 09 Dec 2010 16:50:16 +0000 (UTC) diff --git a/fs/lockd/host.c b/fs/lockd/host.c index 43d8d0c..c054689 100644 --- a/fs/lockd/host.c +++ b/fs/lockd/host.c @@ -159,75 +159,6 @@ out: } /* - * Common host lookup routine for server & client - */ -static struct nlm_host *nlm_lookup_host(struct nlm_lookup_host_info *ni) -{ - struct hlist_head *chain; - struct hlist_node *pos; - struct nlm_host *host; - struct nsm_handle *nsm = NULL; - - mutex_lock(&nlm_host_mutex); - - if (time_after_eq(jiffies, next_gc)) - nlm_gc_hosts(); - - /* We may keep several nlm_host objects for a peer, because each - * nlm_host is identified by - * (address, protocol, version, server/client) - * We could probably simplify this a little by putting all those - * different NLM rpc_clients into one single nlm_host object. - * This would allow us to have one nlm_host per address. - */ - 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; - - /* See if we have an NSM handle for this client */ - if (!nsm) - nsm = host->h_nsmhandle; - - if (host->h_proto != ni->protocol) - continue; - if (host->h_version != ni->version) - continue; - if (host->h_server != ni->server) - continue; - if (ni->server && ni->src_len != 0 && - !rpc_cmp_addr(nlm_srcaddr(host), ni->src_sap)) - continue; - - /* Move to head of hash chain. */ - hlist_del(&host->h_hash); - hlist_add_head(&host->h_hash, chain); - - nlm_get_host(host); - dprintk("lockd: nlm_lookup_host found host %s (%s)\n", - host->h_name, host->h_addrbuf); - goto out; - } - - host = nlm_alloc_host(ni, nsm); - if (unlikely(host == NULL)) - goto out; - - memcpy(nlm_srcaddr(host), ni->src_sap, ni->src_len); - host->h_srcaddrlen = ni->src_len; - hlist_add_head(&host->h_hash, chain); - - nrhosts++; - - dprintk("lockd: nlm_lookup_host created host %s\n", - host->h_name); - -out: - mutex_unlock(&nlm_host_mutex); - return host; -} - -/* * Destroy an nlm_host and free associated resources * * Caller must hold nlm_host_mutex.