From b9f4b66a81420b0832ce4ef6965b1cdc9615772c Mon Sep 17 00:00:00 2001 From: Chuck Lever Date: Mon, 8 Oct 2007 11:53:51 -0400 Subject: text-based mount.nfs: combine nfsmount_s() and nfs4mount_s() paths The top-level logic that handles text-based mount options is mostly the same for NFS and NFSv4 mounts. To improve maintainability, let's combine the nfsmount_s() and nfs4mount_s() functions. Signed-off-by: Chuck Lever Signed-off-by: Neil Brown --- utils/mount/mount.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'utils/mount/mount.c') diff --git a/utils/mount/mount.c b/utils/mount/mount.c index e622231..21946f7 100644 --- a/utils/mount/mount.c +++ b/utils/mount/mount.c @@ -376,14 +376,10 @@ static int try_mount(char *spec, char *mount_point, int flags, { int ret; - if (string) { - if (strcmp(fs_type, "nfs4") == 0) - ret = nfs4mount_s(spec, mount_point, flags, - extra_opts, fake, bg); - else - ret = nfsmount_s(spec, mount_point, flags, - extra_opts, fake, bg); - } else { + if (string) + ret = nfsmount_string(spec, mount_point, fs_type, flags, + extra_opts, fake, bg); + else { if (strcmp(fs_type, "nfs4") == 0) ret = nfs4mount(spec, mount_point, flags, extra_opts, fake, bg); -- cgit