2008-06-26 21:48:00

by Chuck Lever III

[permalink] [raw]
Subject: [PATCH 2/3] NFS: Move the nfs_set_port() call out of nfs_parse_mount_options()

The remount path does not need to set the port in the server address.
Since it's not really a part of option parsing, move the nfs_set_port()
call to nfs_parse_mount_options()'s callers.

Signed-off-by: Chuck Lever <[email protected]>
---

fs/nfs/super.c | 9 ++++++---
1 files changed, 6 insertions(+), 3 deletions(-)


diff --git a/fs/nfs/super.c b/fs/nfs/super.c
index 396a12e..d3be1fa 100644
--- a/fs/nfs/super.c
+++ b/fs/nfs/super.c
@@ -1215,9 +1215,6 @@ static int nfs_parse_mount_options(char *raw,
}
}

- nfs_set_port((struct sockaddr *)&mnt->nfs_server.address,
- mnt->nfs_server.port);
-
return 1;

out_nomem:
@@ -1568,6 +1565,9 @@ static int nfs_validate_mount_data(void *options,
&args->nfs_server.address))
goto out_no_address;

+ nfs_set_port((struct sockaddr *)&args->nfs_server.address,
+ args->nfs_server.port);
+
nfs_set_transport_defaults(args);

status = nfs_parse_devname(dev_name,
@@ -2196,6 +2196,9 @@ static int nfs4_validate_mount_data(void *options,
&args->nfs_server.address))
return -EINVAL;

+ nfs_set_port((struct sockaddr *)&args->nfs_server.address,
+ args->nfs_server.port);
+
nfs_set_transport_defaults(args);

switch (args->auth_flavor_len) {