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",
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 */ );
#define NFS4_MOUNT_UNSHARED 0x8000 /* 5 */
#define NFS4_MOUNT_FLAGMASK 0xFFFF
-int nfs4mount(const char *, const char *, int *, char **,
- char **, int);
+int nfs4mount(const char *, const char *, int *, char **, int, int);
#endif
#include <netdb.h>
#include <time.h>
#include <sys/stat.h>
+#include <sys/mount.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <rpc/auth.h>
#include "conn.h"
#include "xcommon.h"
+#include "mount_constants.h"
#include "nfs4_mount.h"
#include "nfs_mount.h"
#include "error.h"
}
int nfs4mount(const char *spec, const char *node, int *flags,
- char **extra_opts, char **mount_opts,
- int running_bg)
+ char **extra_opts, int running_bg, int fake)
{
static struct nfs4_mount_data data;
static char hostdir[1024];
continue;
}
- *mount_opts = (char *) &data;
- /* clean up */
+ if (!fake) {
+ if (mount(spec, node, "nfs4",
+ *flags & ~(MS_USER|MS_USERS), &data)) {
+ mount_error(spec, node, errno);
+ goto fail;
+ }
+ }
+
return 0;
fail:
#define AUTH_GSS_SPKMP 390011
#endif
-int nfsmount(const char *, const char *, int *, char **, char **,
- int, int);
+int nfsmount(const char *, const char *, int *, char **, int, int);
#endif /* _NFS_MOUNT_H */
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];
#endif
data.version = nfs_mount_data_version;
- *mount_opts = (char *) &data;
if (*flags & MS_REMOUNT)
goto out_ok;
}
}
+ if (!fake) {
+ if (mount(spec, node, "nfs",
+ *flags & ~(MS_USER|MS_USERS), &data)) {
+ mount_error(spec, node, errno);
+ goto fail;
+ }
+ }
+
return 0;
/* abort */