aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/client.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/nfs/client.c')
-rw-r--r--fs/nfs/client.c29
1 files changed, 19 insertions, 10 deletions
diff --git a/fs/nfs/client.c b/fs/nfs/client.c
index e350bd6a2334..99ea196f071f 100644
--- a/fs/nfs/client.c
+++ b/fs/nfs/client.c
@@ -648,8 +648,6 @@ static int nfs_start_lockd(struct nfs_server *server)
648 .hostname = clp->cl_hostname, 648 .hostname = clp->cl_hostname,
649 .address = (struct sockaddr *)&clp->cl_addr, 649 .address = (struct sockaddr *)&clp->cl_addr,
650 .addrlen = clp->cl_addrlen, 650 .addrlen = clp->cl_addrlen,
651 .protocol = server->flags & NFS_MOUNT_TCP ?
652 IPPROTO_TCP : IPPROTO_UDP,
653 .nfs_version = clp->rpc_ops->version, 651 .nfs_version = clp->rpc_ops->version,
654 .noresvport = server->flags & NFS_MOUNT_NORESVPORT ? 652 .noresvport = server->flags & NFS_MOUNT_NORESVPORT ?
655 1 : 0, 653 1 : 0,
@@ -660,6 +658,14 @@ static int nfs_start_lockd(struct nfs_server *server)
660 if (server->flags & NFS_MOUNT_NONLM) 658 if (server->flags & NFS_MOUNT_NONLM)
661 return 0; 659 return 0;
662 660
661 switch (clp->cl_proto) {
662 default:
663 nlm_init.protocol = IPPROTO_TCP;
664 break;
665 case XPRT_TRANSPORT_UDP:
666 nlm_init.protocol = IPPROTO_UDP;
667 }
668
663 host = nlmclnt_init(&nlm_init); 669 host = nlmclnt_init(&nlm_init);
664 if (IS_ERR(host)) 670 if (IS_ERR(host))
665 return PTR_ERR(host); 671 return PTR_ERR(host);
@@ -787,7 +793,7 @@ static int nfs_init_server(struct nfs_server *server,
787 dprintk("--> nfs_init_server()\n"); 793 dprintk("--> nfs_init_server()\n");
788 794
789#ifdef CONFIG_NFS_V3 795#ifdef CONFIG_NFS_V3
790 if (data->flags & NFS_MOUNT_VER3) 796 if (data->version == 3)
791 cl_init.rpc_ops = &nfs_v3_clientops; 797 cl_init.rpc_ops = &nfs_v3_clientops;
792#endif 798#endif
793 799
@@ -933,10 +939,6 @@ static int nfs_probe_fsinfo(struct nfs_server *server, struct nfs_fh *mntfh, str
933 goto out_error; 939 goto out_error;
934 940
935 nfs_server_set_fsinfo(server, &fsinfo); 941 nfs_server_set_fsinfo(server, &fsinfo);
936 error = bdi_init(&server->backing_dev_info);
937 if (error)
938 goto out_error;
939
940 942
941 /* Get some general file system info */ 943 /* Get some general file system info */
942 if (server->namelen == 0) { 944 if (server->namelen == 0) {
@@ -968,6 +970,7 @@ static void nfs_server_copy_userdata(struct nfs_server *target, struct nfs_serve
968 target->acdirmin = source->acdirmin; 970 target->acdirmin = source->acdirmin;
969 target->acdirmax = source->acdirmax; 971 target->acdirmax = source->acdirmax;
970 target->caps = source->caps; 972 target->caps = source->caps;
973 target->options = source->options;
971} 974}
972 975
973/* 976/*
@@ -995,6 +998,12 @@ static struct nfs_server *nfs_alloc_server(void)
995 return NULL; 998 return NULL;
996 } 999 }
997 1000
1001 if (bdi_init(&server->backing_dev_info)) {
1002 nfs_free_iostats(server->io_stats);
1003 kfree(server);
1004 return NULL;
1005 }
1006
998 return server; 1007 return server;
999} 1008}
1000 1009
@@ -1171,7 +1180,7 @@ static int nfs4_init_client(struct nfs_client *clp,
1171 1, flags & NFS_MOUNT_NORESVPORT); 1180 1, flags & NFS_MOUNT_NORESVPORT);
1172 if (error < 0) 1181 if (error < 0)
1173 goto error; 1182 goto error;
1174 memcpy(clp->cl_ipaddr, ip_addr, sizeof(clp->cl_ipaddr)); 1183 strlcpy(clp->cl_ipaddr, ip_addr, sizeof(clp->cl_ipaddr));
1175 1184
1176 error = nfs_idmap_new(clp); 1185 error = nfs_idmap_new(clp);
1177 if (error < 0) { 1186 if (error < 0) {
@@ -1529,7 +1538,7 @@ static void *nfs_server_list_next(struct seq_file *p, void *v, loff_t *pos);
1529static void nfs_server_list_stop(struct seq_file *p, void *v); 1538static void nfs_server_list_stop(struct seq_file *p, void *v);
1530static int nfs_server_list_show(struct seq_file *m, void *v); 1539static int nfs_server_list_show(struct seq_file *m, void *v);
1531 1540
1532static struct seq_operations nfs_server_list_ops = { 1541static const struct seq_operations nfs_server_list_ops = {
1533 .start = nfs_server_list_start, 1542 .start = nfs_server_list_start,
1534 .next = nfs_server_list_next, 1543 .next = nfs_server_list_next,
1535 .stop = nfs_server_list_stop, 1544 .stop = nfs_server_list_stop,
@@ -1550,7 +1559,7 @@ static void *nfs_volume_list_next(struct seq_file *p, void *v, loff_t *pos);
1550static void nfs_volume_list_stop(struct seq_file *p, void *v); 1559static void nfs_volume_list_stop(struct seq_file *p, void *v);
1551static int nfs_volume_list_show(struct seq_file *m, void *v); 1560static int nfs_volume_list_show(struct seq_file *m, void *v);
1552 1561
1553static struct seq_operations nfs_volume_list_ops = { 1562static const struct seq_operations nfs_volume_list_ops = {
1554 .start = nfs_volume_list_start, 1563 .start = nfs_volume_list_start,
1555 .next = nfs_volume_list_next, 1564 .next = nfs_volume_list_next,
1556 .stop = nfs_volume_list_stop, 1565 .stop = nfs_volume_list_stop,