aboutsummaryrefslogtreecommitdiff
path: root/sbin/mount_ifs/mount_ufs.c
diff options
context:
space:
mode:
authorPeter Wemm <peter@FreeBSD.org>1997-03-11 12:28:00 +0000
committerPeter Wemm <peter@FreeBSD.org>1997-03-11 12:28:00 +0000
commitc06fe0a05e6348d700e4941d30aadcdacef5d829 (patch)
treef705d4552806debc8fb516ed868872bafc3e0ddd /sbin/mount_ifs/mount_ufs.c
parente7b6972097226a9eea20da0477d0147a9d5d5e3e (diff)
downloadsrc-c06fe0a05e6348d700e4941d30aadcdacef5d829.tar.gz
src-c06fe0a05e6348d700e4941d30aadcdacef5d829.zip
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!
Notes
Notes: svn path=/head/; revision=23678
Diffstat (limited to 'sbin/mount_ifs/mount_ufs.c')
-rw-r--r--sbin/mount_ifs/mount_ufs.c34
1 files changed, 18 insertions, 16 deletions
diff --git a/sbin/mount_ifs/mount_ufs.c b/sbin/mount_ifs/mount_ufs.c
index fac14172ba4a..c12cccf1840d 100644
--- a/sbin/mount_ifs/mount_ufs.c
+++ b/sbin/mount_ifs/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 <sys/param.h>
@@ -51,6 +51,8 @@ static char sccsid[] = "@(#)mount_ufs.c 8.2 (Berkeley) 3/27/94";
#include <string.h>
#include <unistd.h>
+#include <ufs/ufs/ufsmount.h>
+
#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: