aboutsummaryrefslogtreecommitdiffstats
path: root/fs/lockd/clntproc.c
diff options
context:
space:
mode:
authorChuck Lever <chuck.lever@oracle.com>2006-08-22 20:06:17 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2006-09-22 23:24:46 -0400
commit44c31be261540acf66ddd730631ead8009cc361d (patch)
tree157a92c24d50f8c82be464a4b326e07a37b2de2a /fs/lockd/clntproc.c
parented39440a2573abc926f230267000f21fa5a87822 (diff)
LOCKD: Teach lockd to use the new rpc_peeraddr() API
Hide the details of how the RPC client stores remote peer addresses from the Network Lock Manager. Test plan: Destructive testing (unplugging the network temporarily). Connectathon with UDP and TCP. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/lockd/clntproc.c')
-rw-r--r--fs/lockd/clntproc.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/fs/lockd/clntproc.c b/fs/lockd/clntproc.c
index 89ba0df14c22..50dbb67ae0c4 100644
--- a/fs/lockd/clntproc.c
+++ b/fs/lockd/clntproc.c
@@ -151,11 +151,13 @@ static void nlmclnt_release_lockargs(struct nlm_rqst *req)
151int 151int
152nlmclnt_proc(struct inode *inode, int cmd, struct file_lock *fl) 152nlmclnt_proc(struct inode *inode, int cmd, struct file_lock *fl)
153{ 153{
154 struct rpc_clnt *client = NFS_CLIENT(inode);
155 struct sockaddr_in addr;
154 struct nlm_host *host; 156 struct nlm_host *host;
155 struct nlm_rqst *call; 157 struct nlm_rqst *call;
156 sigset_t oldset; 158 sigset_t oldset;
157 unsigned long flags; 159 unsigned long flags;
158 int status, proto, vers; 160 int status, vers;
159 161
160 vers = (NFS_PROTO(inode)->version == 3) ? 4 : 1; 162 vers = (NFS_PROTO(inode)->version == 3) ? 4 : 1;
161 if (NFS_PROTO(inode)->version > 3) { 163 if (NFS_PROTO(inode)->version > 3) {
@@ -163,10 +165,8 @@ nlmclnt_proc(struct inode *inode, int cmd, struct file_lock *fl)
163 return -ENOLCK; 165 return -ENOLCK;
164 } 166 }
165 167
166 /* Retrieve transport protocol from NFS client */ 168 rpc_peeraddr(client, (struct sockaddr *) &addr, sizeof(addr));
167 proto = NFS_CLIENT(inode)->cl_xprt->prot; 169 host = nlmclnt_lookup_host(&addr, client->cl_xprt->prot, vers);
168
169 host = nlmclnt_lookup_host(NFS_ADDR(inode), proto, vers);
170 if (host == NULL) 170 if (host == NULL)
171 return -ENOLCK; 171 return -ENOLCK;
172 172