Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 229197
b: refs/heads/master
c: 2025889
h: refs/heads/master
i:
  229195: f46397c
v: v3
  • Loading branch information
Chuck Lever authored and Trond Myklebust committed Dec 16, 2010
1 parent 4f6bbdb commit b6a6ef1
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 70 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: fcc072c783491ca465e4d1e74da7dbb48dbf7a31
refs/heads/master: 2025889828bb14b56d9aa4c1a785bd9847ccdc4b
69 changes: 0 additions & 69 deletions trunk/fs/lockd/host.c
Original file line number Diff line number Diff line change
Expand Up @@ -162,75 +162,6 @@ static struct nlm_host *nlm_alloc_host(struct nlm_lookup_host_info *ni,
return host;
}

/*
* 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
*
Expand Down

0 comments on commit b6a6ef1

Please sign in to comment.