summaryrefslogtreecommitdiffstats
path: root/sbin/mount/mount_ufs.c
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>1997-03-11 12:28:00 +0000
committerpeter <peter@FreeBSD.org>1997-03-11 12:28:00 +0000
commit2feef020b355ece983a669243a95d099367b171c (patch)
tree9839b9610f8f5ce97f93c3d8c197a93fc61d2c61 /sbin/mount/mount_ufs.c
parentd2924d1b179ce176f260d3d1bc75c9cc4ea6262e (diff)
downloadFreeBSD-src-2feef020b355ece983a669243a95d099367b171c.zip
FreeBSD-src-2feef020b355ece983a669243a95d099367b171c.tar.gz
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!
Diffstat (limited to 'sbin/mount/mount_ufs.c')
-rw-r--r--sbin/mount/mount_ufs.c34
1 files changed, 18 insertions, 16 deletions
diff --git a/sbin/mount/mount_ufs.c b/sbin/mount/mount_ufs.c
index fac1417..c12cccf 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 <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:
OpenPOWER on IntegriCloud