aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs
diff options
context:
space:
mode:
Diffstat (limited to 'fs/nfs')
-rw-r--r--fs/nfs/client.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/fs/nfs/client.c b/fs/nfs/client.c
index 0b3ce86f6fc9..7a15832369e9 100644
--- a/fs/nfs/client.c
+++ b/fs/nfs/client.c
@@ -468,18 +468,21 @@ static int nfs_start_lockd(struct nfs_server *server)
468{ 468{
469 struct nlm_host *host; 469 struct nlm_host *host;
470 struct nfs_client *clp = server->nfs_client; 470 struct nfs_client *clp = server->nfs_client;
471 u32 nfs_version = clp->rpc_ops->version; 471 struct nlmclnt_initdata nlm_init = {
472 unsigned short protocol = server->flags & NFS_MOUNT_TCP ? 472 .hostname = clp->cl_hostname,
473 IPPROTO_TCP : IPPROTO_UDP; 473 .address = (struct sockaddr *)&clp->cl_addr,
474 .addrlen = clp->cl_addrlen,
475 .protocol = server->flags & NFS_MOUNT_TCP ?
476 IPPROTO_TCP : IPPROTO_UDP,
477 .nfs_version = clp->rpc_ops->version,
478 };
474 479
475 if (nfs_version > 3) 480 if (nlm_init.nfs_version > 3)
476 return 0; 481 return 0;
477 if (server->flags & NFS_MOUNT_NONLM) 482 if (server->flags & NFS_MOUNT_NONLM)
478 return 0; 483 return 0;
479 484
480 host = nlmclnt_init(clp->cl_hostname, 485 host = nlmclnt_init(&nlm_init);
481 (struct sockaddr *)&clp->cl_addr,
482 clp->cl_addrlen, protocol, nfs_version);
483 if (IS_ERR(host)) 486 if (IS_ERR(host))
484 return PTR_ERR(host); 487 return PTR_ERR(host);
485 488