aboutsummaryrefslogtreecommitdiffstats
path: root/fs/lockd
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2006-12-07 16:35:17 -0500
committerTrond Myklebust <Trond.Myklebust@netapp.com>2006-12-07 16:35:17 -0500
commit21b4e736922f546e0f1aa7b9d6c442f309a2444a (patch)
treee1be8645297f8ebe87445251743ebcc52081a20d /fs/lockd
parent34161db6b14d984fb9b06c735b7b42f8803f6851 (diff)
parent68380b581383c028830f79ec2670f4a193854aa6 (diff)
Merge branch 'master' of /home/trondmy/kernel/linux-2.6/ into merge_linus
Diffstat (limited to 'fs/lockd')
-rw-r--r--fs/lockd/clntproc.c1
-rw-r--r--fs/lockd/host.c53
2 files changed, 29 insertions, 25 deletions
diff --git a/fs/lockd/clntproc.c b/fs/lockd/clntproc.c
index 41c983a05294..497c3cd59d52 100644
--- a/fs/lockd/clntproc.c
+++ b/fs/lockd/clntproc.c
@@ -13,6 +13,7 @@
13#include <linux/nfs_fs.h> 13#include <linux/nfs_fs.h>
14#include <linux/utsname.h> 14#include <linux/utsname.h>
15#include <linux/smp_lock.h> 15#include <linux/smp_lock.h>
16#include <linux/freezer.h>
16#include <linux/sunrpc/clnt.h> 17#include <linux/sunrpc/clnt.h>
17#include <linux/sunrpc/svc.h> 18#include <linux/sunrpc/svc.h>
18#include <linux/lockd/lockd.h> 19#include <linux/lockd/lockd.h>
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);