int
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_rqst *call;
sigset_t oldset;
unsigned long flags;
- int status, proto, vers;
+ int status, vers;
vers = (NFS_PROTO(inode)->version == 3) ? 4 : 1;
if (NFS_PROTO(inode)->version > 3) {
return -ENOLCK;
}
- /* Retrieve transport protocol from NFS client */
- proto = NFS_CLIENT(inode)->cl_xprt->prot;
-
- host = nlmclnt_lookup_host(NFS_ADDR(inode), proto, vers);
+ rpc_peeraddr(client, (struct sockaddr *) &addr, sizeof(addr));
+ host = nlmclnt_lookup_host(&addr, client->cl_xprt->prot, vers);
if (host == NULL)
return -ENOLCK;