Commit 44c31be2 authored by Chuck Lever's avatar Chuck Lever Committed by Trond Myklebust

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: default avatarChuck Lever <chuck.lever@oracle.com>
Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
parent ed39440a
...@@ -151,11 +151,13 @@ static void nlmclnt_release_lockargs(struct nlm_rqst *req) ...@@ -151,11 +151,13 @@ static void nlmclnt_release_lockargs(struct nlm_rqst *req)
int int
nlmclnt_proc(struct inode *inode, int cmd, struct file_lock *fl) nlmclnt_proc(struct inode *inode, int cmd, struct file_lock *fl)
{ {
struct rpc_clnt *client = NFS_CLIENT(inode);
struct sockaddr_in addr;
struct nlm_host *host; struct nlm_host *host;
struct nlm_rqst *call; struct nlm_rqst *call;
sigset_t oldset; sigset_t oldset;
unsigned long flags; unsigned long flags;
int status, proto, vers; int status, vers;
vers = (NFS_PROTO(inode)->version == 3) ? 4 : 1; vers = (NFS_PROTO(inode)->version == 3) ? 4 : 1;
if (NFS_PROTO(inode)->version > 3) { if (NFS_PROTO(inode)->version > 3) {
...@@ -163,10 +165,8 @@ nlmclnt_proc(struct inode *inode, int cmd, struct file_lock *fl) ...@@ -163,10 +165,8 @@ nlmclnt_proc(struct inode *inode, int cmd, struct file_lock *fl)
return -ENOLCK; return -ENOLCK;
} }
/* Retrieve transport protocol from NFS client */ rpc_peeraddr(client, (struct sockaddr *) &addr, sizeof(addr));
proto = NFS_CLIENT(inode)->cl_xprt->prot; host = nlmclnt_lookup_host(&addr, client->cl_xprt->prot, vers);
host = nlmclnt_lookup_host(NFS_ADDR(inode), proto, vers);
if (host == NULL) if (host == NULL)
return -ENOLCK; return -ENOLCK;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment