diff options
author | Maxime Henrion <mux@FreeBSD.org> | 2002-06-15 22:40:13 +0000 |
---|---|---|
committer | Maxime Henrion <mux@FreeBSD.org> | 2002-06-15 22:40:13 +0000 |
commit | c3210a83c03f99f816dcb3851b84652791f1561a (patch) | |
tree | 9118c81ce3b9a4b30f053b88e1a4c2f81eca6db4 /sbin/mount_udf | |
parent | 58f3c42e6d02adc94fc7284dcef188589f0cb77e (diff) |
Convert UDF to nmount.
Reviewed by: scottl
Notes
Notes:
svn path=/head/; revision=98265
Diffstat (limited to 'sbin/mount_udf')
-rw-r--r-- | sbin/mount_udf/mount_udf.c | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/sbin/mount_udf/mount_udf.c b/sbin/mount_udf/mount_udf.c index 32c242872eb1..45a346daea02 100644 --- a/sbin/mount_udf/mount_udf.c +++ b/sbin/mount_udf/mount_udf.c @@ -48,7 +48,6 @@ #include <sys/file.h> #include <sys/param.h> #include <sys/mount.h> -#include <fs/udf/udf_mount.h> #include <err.h> #include <errno.h> @@ -71,15 +70,13 @@ void usage(void); int main(int argc, char **argv) { - struct udf_args args; + struct iovec iov[6]; int ch, mntflags, opts; char *dev, *dir, mntpath[MAXPATHLEN]; struct vfsconf vfc; int error, verbose; mntflags = opts = verbose = 0; - memset(&args, 0, sizeof args); - args.ssector = -1; while ((ch = getopt(argc, argv, "o:v")) != -1) switch (ch) { case 'o': @@ -108,16 +105,10 @@ main(int argc, char **argv) (void)checkpath(dir, mntpath); (void)rmslashes(dev, dev); -#define DEFAULT_ROOTUID -2 /* * UDF filesystems are not writeable. */ mntflags |= MNT_RDONLY; - args.export.ex_flags = MNT_EXRDONLY; - args.fspec = dev; - args.export.ex_root = DEFAULT_ROOTUID; - args.flags = opts; - error = getvfsbyname("udf", &vfc); if (error && vfsisloadable("udf")) { if (vfsload("udf")) @@ -128,8 +119,20 @@ main(int argc, char **argv) if (error) errx(1, "udf filesystem is not available"); - if (mount(vfc.vfc_name, mntpath, mntflags, &args) < 0) - err(1, "%s", args.fspec); + iov[0].iov_base = "fstype"; + iov[0].iov_len = sizeof("fstype"); + iov[1].iov_base = vfc.vfc_name; + iov[1].iov_len = strlen(vfc.vfc_name) + 1; + iov[2].iov_base = "fspath"; + iov[2].iov_len = sizeof("fspath"); + iov[3].iov_base = mntpath; + iov[3].iov_len = strlen(mntpath) + 1; + iov[4].iov_base = "from"; + iov[4].iov_len = sizeof("from"); + iov[5].iov_base = dev; + iov[5].iov_len = strlen(dev) + 1; + if (nmount(iov, 6, mntflags) < 0) + err(1, "%s", dev); exit(0); } |