diff options
Diffstat (limited to 'fs/lockd/host.c')
-rw-r--r-- | fs/lockd/host.c | 53 |
1 files changed, 28 insertions, 25 deletions
diff --git a/fs/lockd/host.c b/fs/lockd/host.c index fb24a9730345..3d4610c2a266 100644 --- a/fs/lockd/host.c +++ b/fs/lockd/host.c | |||
@@ -36,34 +36,14 @@ static DEFINE_MUTEX(nlm_host_mutex); | |||
36 | static void nlm_gc_hosts(void); | 36 | static void nlm_gc_hosts(void); |
37 | static struct nsm_handle * __nsm_find(const struct sockaddr_in *, | 37 | static struct nsm_handle * __nsm_find(const struct sockaddr_in *, |
38 | const char *, int, int); | 38 | const char *, int, int); |
39 | 39 | static struct nsm_handle * nsm_find(const struct sockaddr_in *sin, | |
40 | /* | 40 | const char *hostname, |
41 | * Find an NLM server handle in the cache. If there is none, create it. | 41 | int hostname_len); |
42 | */ | ||
43 | struct nlm_host * | ||
44 | nlmclnt_lookup_host(const struct sockaddr_in *sin, int proto, int version, | ||
45 | const char *hostname, int hostname_len) | ||
46 | { | ||
47 | return nlm_lookup_host(0, sin, proto, version, | ||
48 | hostname, hostname_len); | ||
49 | } | ||
50 | |||
51 | /* | ||
52 | * Find an NLM client handle in the cache. If there is none, create it. | ||
53 | */ | ||
54 | struct nlm_host * | ||
55 | nlmsvc_lookup_host(struct svc_rqst *rqstp, | ||
56 | const char *hostname, int hostname_len) | ||
57 | { | ||
58 | return nlm_lookup_host(1, &rqstp->rq_addr, | ||
59 | rqstp->rq_prot, rqstp->rq_vers, | ||
60 | hostname, hostname_len); | ||
61 | } | ||
62 | 42 | ||
63 | /* | 43 | /* |
64 | * Common host lookup routine for server & client | 44 | * Common host lookup routine for server & client |
65 | */ | 45 | */ |
66 | struct nlm_host * | 46 | static struct nlm_host * |
67 | nlm_lookup_host(int server, const struct sockaddr_in *sin, | 47 | nlm_lookup_host(int server, const struct sockaddr_in *sin, |
68 | int proto, int version, | 48 | int proto, int version, |
69 | const char *hostname, | 49 | const char *hostname, |
@@ -195,6 +175,29 @@ nlm_destroy_host(struct nlm_host *host) | |||
195 | } | 175 | } |
196 | 176 | ||
197 | /* | 177 | /* |
178 | * Find an NLM server handle in the cache. If there is none, create it. | ||
179 | */ | ||
180 | struct nlm_host * | ||
181 | nlmclnt_lookup_host(const struct sockaddr_in *sin, int proto, int version, | ||
182 | const char *hostname, int hostname_len) | ||
183 | { | ||
184 | return nlm_lookup_host(0, sin, proto, version, | ||
185 | hostname, hostname_len); | ||
186 | } | ||
187 | |||
188 | /* | ||
189 | * Find an NLM client handle in the cache. If there is none, create it. | ||
190 | */ | ||
191 | struct nlm_host * | ||
192 | nlmsvc_lookup_host(struct svc_rqst *rqstp, | ||
193 | const char *hostname, int hostname_len) | ||
194 | { | ||
195 | return nlm_lookup_host(1, &rqstp->rq_addr, | ||
196 | rqstp->rq_prot, rqstp->rq_vers, | ||
197 | hostname, hostname_len); | ||
198 | } | ||
199 | |||
200 | /* | ||
198 | * Create the NLM RPC client for an NLM peer | 201 | * Create the NLM RPC client for an NLM peer |
199 | */ | 202 | */ |
200 | struct rpc_clnt * | 203 | struct rpc_clnt * |
@@ -495,7 +498,7 @@ out: | |||
495 | return nsm; | 498 | return nsm; |
496 | } | 499 | } |
497 | 500 | ||
498 | struct nsm_handle * | 501 | static struct nsm_handle * |
499 | nsm_find(const struct sockaddr_in *sin, const char *hostname, int hostname_len) | 502 | nsm_find(const struct sockaddr_in *sin, const char *hostname, int hostname_len) |
500 | { | 503 | { |
501 | return __nsm_find(sin, hostname, hostname_len, 1); | 504 | return __nsm_find(sin, hostname, hostname_len, 1); |