From c06fe0a05e6348d700e4941d30aadcdacef5d829 Mon Sep 17 00:00:00 2001 From: Peter Wemm Date: Tue, 11 Mar 1997 12:28:00 +0000 Subject: Merge from Lite2 - use new getvfsbyname() interface and mount(2) interface **DANGER WILL ROBINSON!!** You must be running a -current kernel from within a week or so in order for this to work! --- sbin/mount/mount_ufs.c | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) (limited to 'sbin/mount/mount_ufs.c') diff --git a/sbin/mount/mount_ufs.c b/sbin/mount/mount_ufs.c index fac14172ba4a..c12cccf1840d 100644 --- a/sbin/mount/mount_ufs.c +++ b/sbin/mount/mount_ufs.c @@ -38,7 +38,7 @@ static char copyright[] = #endif /* not lint */ #ifndef lint -static char sccsid[] = "@(#)mount_ufs.c 8.2 (Berkeley) 3/27/94"; +static char sccsid[] = "@(#)mount_ufs.c 8.4 (Berkeley) 4/26/95"; #endif /* not lint */ #include @@ -51,6 +51,8 @@ static char sccsid[] = "@(#)mount_ufs.c 8.2 (Berkeley) 3/27/94"; #include #include +#include + #include "mntopts.h" void ufs_usage __P((void)); @@ -61,8 +63,7 @@ static struct mntopt mopts[] = { MOPT_SYNC, MOPT_FORCE, MOPT_UPDATE, - MOPT_UQUOTA, - MOPT_GQUOTA, + MOPT_FORCE, { NULL } }; @@ -75,7 +76,8 @@ mount_ufs(argc, argv) struct ufs_args args; int ch, mntflags; char *fs_name; - struct vfsconf *vfc; + struct vfsconf vfc; + int error = 0; mntflags = 0; optind = optreset = 1; /* Reset for parse of new argv. */ @@ -104,21 +106,21 @@ mount_ufs(argc, argv) else args.export.ex_flags = 0; - setvfsent(0); - if(!(vfc = getvfsbyname("ufs"))) { - if(vfsisloadable("ufs")) { - if(vfsload("ufs")) { - warn("vfsload(\"ufs\")"); - return 1; - } - endvfsent(); /* flush old table */ - vfc = getvfsbyname("ufs"); - } else { - /*warnx("ufs: filesystem not found");*/ + error = getvfsbyname("ufs", &vfc); + if (error && vfsisloadable("ufs")) { + if (vfsload("ufs")) { + warn("vfsload(ufs)"); + return (1); } + endvfsent(); /* flush old table */ + error = getvfsbyname("ufs", &vfc); + } + if (error) { + warnx("ufs filesystem is not available"); + return (1); } - if (mount(vfc ? vfc->vfc_index : MOUNT_UFS, fs_name, mntflags, &args) < 0) { + if (mount(vfc.vfc_name, fs_name, mntflags, &args) < 0) { (void)fprintf(stderr, "%s on %s: ", args.fspec, fs_name); switch (errno) { case EMFILE: -- cgit v1.2.3