summaryrefslogtreecommitdiffstats
path: root/utils/mount/nfsmount.c
diff options
context:
space:
mode:
authorChuck Lever <chuck.lever@oracle.com>2007-07-16 16:29:01 -0400
committerNeil Brown <neilb@suse.de>2007-07-20 16:10:55 +1000
commit14f4a50b4b51bc4bdf56cfd43d8ae598579c4e6d (patch)
treeb664579f2051c2f7bb3d141e91ccbf7c4fb53546 /utils/mount/nfsmount.c
parentc0f7366f3ae8de8a62e3cc6824080e02e780f3b2 (diff)
downloadnfs-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/nfsmount.c')
-rw-r--r--utils/mount/nfsmount.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/utils/mount/nfsmount.c b/utils/mount/nfsmount.c
index a3cbbbe..b6a0d60 100644
--- a/utils/mount/nfsmount.c
+++ b/utils/mount/nfsmount.c
@@ -487,8 +487,7 @@ out_bad:
int
nfsmount(const char *spec, const char *node, int *flags,
- char **extra_opts, char **mount_opts,
- int running_bg, int fake)
+ char **extra_opts, int running_bg, int fake)
{
static char *prev_bg_host;
char hostdir[1024];
@@ -618,7 +617,6 @@ nfsmount(const char *spec, const char *node, int *flags,
#endif
data.version = nfs_mount_data_version;
- *mount_opts = (char *) &data;
if (*flags & MS_REMOUNT)
goto out_ok;
@@ -862,6 +860,14 @@ noauth_flavors:
}
}
+ if (!fake) {
+ if (mount(spec, node, "nfs",
+ *flags & ~(MS_USER|MS_USERS), &data)) {
+ mount_error(spec, node, errno);
+ goto fail;
+ }
+ }
+
return 0;
/* abort */