X-Git-Url: https://git.decadent.org.uk/gitweb/?p=nfs-utils.git;a=blobdiff_plain;f=utils%2Fmount%2Fmount.c;h=dde4562b045d9f60e4e571ea8a35cf1e914a7ac7;hp=e3f84a0edb98ad40652ae048160e00545702f4b8;hb=8d85f209d0343cf8fef35ea0c94ba9c93af6ffa6;hpb=66ab98cbd17f7f54edda78a470579d3ab01f35c0 diff --git a/utils/mount/mount.c b/utils/mount/mount.c index e3f84a0..dde4562 100644 --- a/utils/mount/mount.c +++ b/utils/mount/mount.c @@ -72,11 +72,6 @@ struct opt_map { int mask; /* flag mask value */ }; -/* Custom mount options for our own purposes. */ -#define MS_DUMMY 0x00000000 -#define MS_USERS 0x40000000 -#define MS_USER 0x80000000 - static const struct opt_map opt_map[] = { { "defaults", 0, 0, 0 }, /* default options */ { "ro", 1, 0, MS_RDONLY }, /* read-only */ @@ -176,6 +171,18 @@ static void discover_nfs_mount_data_version(void) nfs_mount_data_version = NFS_MOUNT_VERSION; } +static void print_one(char *spec, char *node, char *type, char *opts) +{ + if (verbose) { + printf("%s on %s type %s", spec, node, type); + + if (opts != NULL) + printf(" (%s)", opts); + + printf("\n"); + } +} + /* Try to build a canonical options string. */ static char * fix_opts_string (int flags, const char *extra_opts) { const struct opt_map *om; @@ -255,11 +262,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", @@ -478,25 +480,15 @@ 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, fake); else - mnt_err = nfsmount(spec, mount_point, &flags, - &extra_opts, &mount_opts, - 0, fake); + mnt_err = nfsmount(spec, mount_point, flags, &extra_opts, 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 (!fake) + print_one(spec, mount_point, fs_type, mount_opts); if (!nomtab) mnt_err = add_mtab(spec, mount_point, fs_type, flags, extra_opts,