diff options
author | Chuck Lever <chuck.lever@oracle.com> | 2007-07-16 16:29:01 -0400 |
---|---|---|
committer | Neil Brown <neilb@suse.de> | 2007-07-20 16:10:55 +1000 |
commit | 14f4a50b4b51bc4bdf56cfd43d8ae598579c4e6d (patch) | |
tree | b664579f2051c2f7bb3d141e91ccbf7c4fb53546 /utils/mount/mount.c | |
parent | c0f7366f3ae8de8a62e3cc6824080e02e780f3b2 (diff) | |
download | nfs-utils-14f4a50b4b51bc4bdf56cfd43d8ae598579c4e6d.tar.gz nfs-utils-14f4a50b4b51bc4bdf56cfd43d8ae598579c4e6d.tar.xz nfs-utils-14f4a50b4b51bc4bdf56cfd43d8ae598579c4e6d.zip |
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 <chuck.lever@oracle.com>
Signed-off-by: Neil Brown <neilb@suse.de>
Diffstat (limited to 'utils/mount/mount.c')
-rw-r--r-- | utils/mount/mount.c | 22 |
1 files changed, 2 insertions, 20 deletions
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 */ ); |