diff options
author | Chuck Lever <chuck.lever@oracle.com> | 2010-12-14 10:06:41 -0500 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2010-12-16 12:37:27 -0500 |
commit | 2025889828bb14b56d9aa4c1a785bd9847ccdc4b (patch) | |
tree | 20707cb2e2ca0f484ccdaf86f14e9ec1c10bdffb /fs/lockd | |
parent | fcc072c783491ca465e4d1e74da7dbb48dbf7a31 (diff) |
lockd: Remove nlm_lookup_host()
Clean up.
Remove the now unused helper nlm_lookup_host().
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/lockd')
-rw-r--r-- | fs/lockd/host.c | 69 |
1 files changed, 0 insertions, 69 deletions
diff --git a/fs/lockd/host.c b/fs/lockd/host.c index 77ec21a808db..6d4aa8b3d610 100644 --- a/fs/lockd/host.c +++ b/fs/lockd/host.c | |||
@@ -163,75 +163,6 @@ out: | |||
163 | } | 163 | } |
164 | 164 | ||
165 | /* | 165 | /* |
166 | * Common host lookup routine for server & client | ||
167 | */ | ||
168 | static struct nlm_host *nlm_lookup_host(struct nlm_lookup_host_info *ni) | ||
169 | { | ||
170 | struct hlist_head *chain; | ||
171 | struct hlist_node *pos; | ||
172 | struct nlm_host *host; | ||
173 | struct nsm_handle *nsm = NULL; | ||
174 | |||
175 | mutex_lock(&nlm_host_mutex); | ||
176 | |||
177 | if (time_after_eq(jiffies, next_gc)) | ||
178 | nlm_gc_hosts(); | ||
179 | |||
180 | /* We may keep several nlm_host objects for a peer, because each | ||
181 | * nlm_host is identified by | ||
182 | * (address, protocol, version, server/client) | ||
183 | * We could probably simplify this a little by putting all those | ||
184 | * different NLM rpc_clients into one single nlm_host object. | ||
185 | * This would allow us to have one nlm_host per address. | ||
186 | */ | ||
187 | chain = &nlm_server_hosts[nlm_hash_address(ni->sap)]; | ||
188 | hlist_for_each_entry(host, pos, chain, h_hash) { | ||
189 | if (!rpc_cmp_addr(nlm_addr(host), ni->sap)) | ||
190 | continue; | ||
191 | |||
192 | /* See if we have an NSM handle for this client */ | ||
193 | if (!nsm) | ||
194 | nsm = host->h_nsmhandle; | ||
195 | |||
196 | if (host->h_proto != ni->protocol) | ||
197 | continue; | ||
198 | if (host->h_version != ni->version) | ||
199 | continue; | ||
200 | if (host->h_server != ni->server) | ||
201 | continue; | ||
202 | if (ni->server && ni->src_len != 0 && | ||
203 | !rpc_cmp_addr(nlm_srcaddr(host), ni->src_sap)) | ||
204 | continue; | ||
205 | |||
206 | /* Move to head of hash chain. */ | ||
207 | hlist_del(&host->h_hash); | ||
208 | hlist_add_head(&host->h_hash, chain); | ||
209 | |||
210 | nlm_get_host(host); | ||
211 | dprintk("lockd: nlm_lookup_host found host %s (%s)\n", | ||
212 | host->h_name, host->h_addrbuf); | ||
213 | goto out; | ||
214 | } | ||
215 | |||
216 | host = nlm_alloc_host(ni, nsm); | ||
217 | if (unlikely(host == NULL)) | ||
218 | goto out; | ||
219 | |||
220 | memcpy(nlm_srcaddr(host), ni->src_sap, ni->src_len); | ||
221 | host->h_srcaddrlen = ni->src_len; | ||
222 | hlist_add_head(&host->h_hash, chain); | ||
223 | |||
224 | nrhosts++; | ||
225 | |||
226 | dprintk("lockd: nlm_lookup_host created host %s\n", | ||
227 | host->h_name); | ||
228 | |||
229 | out: | ||
230 | mutex_unlock(&nlm_host_mutex); | ||
231 | return host; | ||
232 | } | ||
233 | |||
234 | /* | ||
235 | * Destroy an nlm_host and free associated resources | 166 | * Destroy an nlm_host and free associated resources |
236 | * | 167 | * |
237 | * Caller must hold nlm_host_mutex. | 168 | * Caller must hold nlm_host_mutex. |