From 14f4a50b4b51bc4bdf56cfd43d8ae598579c4e6d Mon Sep 17 00:00:00 2001 From: Chuck Lever Date: Mon, 16 Jul 2007 16:29:01 -0400 Subject: mount.nfs: No need to return nfs_mount_data structs Refactor mount processing slightly to remove an output parameter and an unnecessary type cast. The mount syscall is now made from inside nfs_mount or nfs4mount, rather than in common code after those are called. Code review suggests that EX_BG was never returned by mount.nfs because the logic I just replaced was always returning EX_FAIL. The new logic should properly return EX_BG when appropriate. However, it is unclear whether /bin/mount handles backgrounding the mount request, or whether mount.nfs should. Signed-off-by: Chuck Lever Signed-off-by: Neil Brown --- utils/mount/mount.c | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) (limited to 'utils/mount/mount.c') diff --git a/utils/mount/mount.c b/utils/mount/mount.c index de94e66..bd7e25c 100644 --- a/utils/mount/mount.c +++ b/utils/mount/mount.c @@ -250,11 +250,6 @@ fail_unlock: return result; } -int do_mount_syscall(char *spec, char *node, char *type, int flags, void *data) -{ - return mount(spec, node, type, flags, data); -} - void mount_usage() { printf("usage: %s remotetarget dir [-rvVwfnh] [-o nfsoptions]\n", @@ -473,26 +468,13 @@ int main(int argc, char *argv[]) exit(EX_FAIL); if (strcmp(fs_type, "nfs4") == 0) - mnt_err = nfs4mount(spec, mount_point, &flags, &extra_opts, &mount_opts, 0); + mnt_err = nfs4mount(spec, mount_point, &flags, &extra_opts, 0, fake); else - mnt_err = nfsmount(spec, mount_point, &flags, - &extra_opts, &mount_opts, - 0, fake); + mnt_err = nfsmount(spec, mount_point, &flags, &extra_opts, 0, fake); if (mnt_err) exit(EX_FAIL); - if (!fake) { - mnt_err = do_mount_syscall(spec, mount_point, fs_type, - flags & ~(MS_USER|MS_USERS) , - mount_opts); - - if (mnt_err) { - mount_error(spec, mount_point, errno); - exit(EX_FAIL); - } - } - if (!nomtab) mnt_err = add_mtab(spec, mount_point, fs_type, flags, extra_opts, 0, 0 /* these are always zero for NFS */ ); -- cgit