aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
Diffstat (limited to 'fs')
-rw-r--r--fs/nfs/client.c32
1 files changed, 19 insertions, 13 deletions
diff --git a/fs/nfs/client.c b/fs/nfs/client.c
index 18fcb05a0707..0b3ce86f6fc9 100644
--- a/fs/nfs/client.c
+++ b/fs/nfs/client.c
@@ -458,7 +458,7 @@ static int nfs_create_rpc_client(struct nfs_client *clp,
458static void nfs_destroy_server(struct nfs_server *server) 458static void nfs_destroy_server(struct nfs_server *server)
459{ 459{
460 if (!(server->flags & NFS_MOUNT_NONLM)) 460 if (!(server->flags & NFS_MOUNT_NONLM))
461 lockd_down(); /* release rpc.lockd */ 461 nlmclnt_done(server->nlm_host);
462} 462}
463 463
464/* 464/*
@@ -466,20 +466,26 @@ static void nfs_destroy_server(struct nfs_server *server)
466 */ 466 */
467static int nfs_start_lockd(struct nfs_server *server) 467static int nfs_start_lockd(struct nfs_server *server)
468{ 468{
469 int error = 0; 469 struct nlm_host *host;
470 struct nfs_client *clp = server->nfs_client;
471 u32 nfs_version = clp->rpc_ops->version;
472 unsigned short protocol = server->flags & NFS_MOUNT_TCP ?
473 IPPROTO_TCP : IPPROTO_UDP;
470 474
471 if (server->nfs_client->rpc_ops->version > 3) 475 if (nfs_version > 3)
472 goto out; 476 return 0;
473 if (server->flags & NFS_MOUNT_NONLM) 477 if (server->flags & NFS_MOUNT_NONLM)
474 goto out; 478 return 0;
475 error = lockd_up((server->flags & NFS_MOUNT_TCP) ? 479
476 IPPROTO_TCP : IPPROTO_UDP); 480 host = nlmclnt_init(clp->cl_hostname,
477 if (error < 0) 481 (struct sockaddr *)&clp->cl_addr,
478 server->flags |= NFS_MOUNT_NONLM; 482 clp->cl_addrlen, protocol, nfs_version);
479 else 483 if (IS_ERR(host))
480 server->destroy = nfs_destroy_server; 484 return PTR_ERR(host);
481out: 485
482 return error; 486 server->nlm_host = host;
487 server->destroy = nfs_destroy_server;
488 return 0;
483} 489}
484 490
485/* 491/*