aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/lockd/host.c53
-rw-r--r--include/linux/lockd/lockd.h2
2 files changed, 28 insertions, 27 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);
36static void nlm_gc_hosts(void); 36static void nlm_gc_hosts(void);
37static struct nsm_handle * __nsm_find(const struct sockaddr_in *, 37static struct nsm_handle * __nsm_find(const struct sockaddr_in *,
38 const char *, int, int); 38 const char *, int, int);
39 39static 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 */
43struct nlm_host *
44nlmclnt_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 */
54struct nlm_host *
55nlmsvc_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 */
66struct nlm_host * 46static struct nlm_host *
67nlm_lookup_host(int server, const struct sockaddr_in *sin, 47nlm_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 */
180struct nlm_host *
181nlmclnt_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 */
191struct nlm_host *
192nlmsvc_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 */
200struct rpc_clnt * 203struct rpc_clnt *
@@ -495,7 +498,7 @@ out:
495 return nsm; 498 return nsm;
496} 499}
497 500
498struct nsm_handle * 501static struct nsm_handle *
499nsm_find(const struct sockaddr_in *sin, const char *hostname, int hostname_len) 502nsm_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);
diff --git a/include/linux/lockd/lockd.h b/include/linux/lockd/lockd.h
index 862d9730a60d..8c39654549d8 100644
--- a/include/linux/lockd/lockd.h
+++ b/include/linux/lockd/lockd.h
@@ -164,14 +164,12 @@ void nlmclnt_next_cookie(struct nlm_cookie *);
164 */ 164 */
165struct nlm_host * nlmclnt_lookup_host(const struct sockaddr_in *, int, int, const char *, int); 165struct nlm_host * nlmclnt_lookup_host(const struct sockaddr_in *, int, int, const char *, int);
166struct nlm_host * nlmsvc_lookup_host(struct svc_rqst *, const char *, int); 166struct nlm_host * nlmsvc_lookup_host(struct svc_rqst *, const char *, int);
167struct nlm_host * nlm_lookup_host(int server, const struct sockaddr_in *, int, int, const char *, int);
168struct rpc_clnt * nlm_bind_host(struct nlm_host *); 167struct rpc_clnt * nlm_bind_host(struct nlm_host *);
169void nlm_rebind_host(struct nlm_host *); 168void nlm_rebind_host(struct nlm_host *);
170struct nlm_host * nlm_get_host(struct nlm_host *); 169struct nlm_host * nlm_get_host(struct nlm_host *);
171void nlm_release_host(struct nlm_host *); 170void nlm_release_host(struct nlm_host *);
172void nlm_shutdown_hosts(void); 171void nlm_shutdown_hosts(void);
173extern void nlm_host_rebooted(const struct sockaddr_in *, const char *, int, u32); 172extern void nlm_host_rebooted(const struct sockaddr_in *, const char *, int, u32);
174struct nsm_handle *nsm_find(const struct sockaddr_in *, const char *, int);
175void nsm_release(struct nsm_handle *); 173void nsm_release(struct nsm_handle *);
176 174
177 175