diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2009-09-23 14:36:37 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2009-09-23 14:36:37 -0400 |
commit | 8a6e5deb8a8caa810fef2c525f5dbea2cfe04a47 (patch) | |
tree | 92e7e049e87955770eb3cddc495e1e0119402b85 | |
parent | 7043078630bbc9eb908a56e08077c5abe7f2d311 (diff) |
NFS: Get rid of the NFS_MOUNT_VER3 and NFS_MOUNT_TCP flags
Keep it in the case of the legacy binary mount interface, but purge it from
the nfs_server structure.
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
-rw-r--r-- | fs/nfs/client.c | 12 | ||||
-rw-r--r-- | fs/nfs/super.c | 17 |
2 files changed, 19 insertions, 10 deletions
diff --git a/fs/nfs/client.c b/fs/nfs/client.c index 152025358dad..73ddefba7aa3 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 | ||
diff --git a/fs/nfs/super.c b/fs/nfs/super.c index f1cc0587cfef..ca278b3ff64f 100644 --- a/fs/nfs/super.c +++ b/fs/nfs/super.c | |||
@@ -1430,10 +1430,13 @@ static int nfs_try_mount(struct nfs_parsed_mount_data *args, | |||
1430 | int status; | 1430 | int status; |
1431 | 1431 | ||
1432 | if (args->mount_server.version == 0) { | 1432 | if (args->mount_server.version == 0) { |
1433 | if (args->flags & NFS_MOUNT_VER3) | 1433 | switch (args->version) { |
1434 | args->mount_server.version = NFS_MNT3_VERSION; | 1434 | default: |
1435 | else | 1435 | args->mount_server.version = NFS_MNT3_VERSION; |
1436 | args->mount_server.version = NFS_MNT_VERSION; | 1436 | break; |
1437 | case 2: | ||
1438 | args->mount_server.version = NFS_MNT_VERSION; | ||
1439 | } | ||
1437 | } | 1440 | } |
1438 | request.version = args->mount_server.version; | 1441 | request.version = args->mount_server.version; |
1439 | 1442 | ||
@@ -1778,7 +1781,7 @@ static int nfs_validate_mount_data(void *options, | |||
1778 | } | 1781 | } |
1779 | 1782 | ||
1780 | #ifndef CONFIG_NFS_V3 | 1783 | #ifndef CONFIG_NFS_V3 |
1781 | if (args->flags & NFS_MOUNT_VER3) | 1784 | if (args->version == 3) |
1782 | goto out_v3_not_compiled; | 1785 | goto out_v3_not_compiled; |
1783 | #endif /* !CONFIG_NFS_V3 */ | 1786 | #endif /* !CONFIG_NFS_V3 */ |
1784 | 1787 | ||
@@ -1936,7 +1939,7 @@ static void nfs_fill_super(struct super_block *sb, | |||
1936 | if (data->bsize) | 1939 | if (data->bsize) |
1937 | sb->s_blocksize = nfs_block_size(data->bsize, &sb->s_blocksize_bits); | 1940 | sb->s_blocksize = nfs_block_size(data->bsize, &sb->s_blocksize_bits); |
1938 | 1941 | ||
1939 | if (server->flags & NFS_MOUNT_VER3) { | 1942 | if (server->nfs_client->rpc_ops->version == 3) { |
1940 | /* The VFS shouldn't apply the umask to mode bits. We will do | 1943 | /* The VFS shouldn't apply the umask to mode bits. We will do |
1941 | * so ourselves when necessary. | 1944 | * so ourselves when necessary. |
1942 | */ | 1945 | */ |
@@ -1960,7 +1963,7 @@ static void nfs_clone_super(struct super_block *sb, | |||
1960 | sb->s_blocksize = old_sb->s_blocksize; | 1963 | sb->s_blocksize = old_sb->s_blocksize; |
1961 | sb->s_maxbytes = old_sb->s_maxbytes; | 1964 | sb->s_maxbytes = old_sb->s_maxbytes; |
1962 | 1965 | ||
1963 | if (server->flags & NFS_MOUNT_VER3) { | 1966 | if (server->nfs_client->rpc_ops->version == 3) { |
1964 | /* The VFS shouldn't apply the umask to mode bits. We will do | 1967 | /* The VFS shouldn't apply the umask to mode bits. We will do |
1965 | * so ourselves when necessary. | 1968 | * so ourselves when necessary. |
1966 | */ | 1969 | */ |