summaryrefslogtreecommitdiffstats
path: root/sbin/fsck_ifs
diff options
context:
space:
mode:
authoradrian <adrian@FreeBSD.org>2000-10-14 02:44:56 +0000
committeradrian <adrian@FreeBSD.org>2000-10-14 02:44:56 +0000
commitee143d47ad6c41a3590bdb5ed28c7bd5bf6ffff8 (patch)
tree590596b4f266eeab393a09a10ebc6e3d2dca44d9 /sbin/fsck_ifs
parent3de1cbc0796b0350b63069fc4bf7972a8e05d2ff (diff)
downloadFreeBSD-src-ee143d47ad6c41a3590bdb5ed28c7bd5bf6ffff8.zip
FreeBSD-src-ee143d47ad6c41a3590bdb5ed28c7bd5bf6ffff8.tar.gz
Pre-IFS commit. Commit IFS-aware fsck and mount utilities.
mount_ifs: repocopy of sbin/mount, with most of the intelligence ripped out and "ufs" replaced with "ifs" in the right places. It will only mount a single filesystem, rather than the -t <type> magic that our real mount does. fsck_ifs: repocopy of sbin/fsck_ffs, but the directory structure stuff (pass2 and some refcount checks) has been #ifdef'ed out. src/sbin/Makefile: Build these two utilities There is probably cruft code left in both which can be removed at a later date, especially in mount_ifs, but I trust that people will not try mount_ifs -a .. Note: there are no man pages installed for these two commands as I haven't actually written them yet.
Diffstat (limited to 'sbin/fsck_ifs')
-rw-r--r--sbin/fsck_ifs/Makefile6
-rw-r--r--sbin/fsck_ifs/main.c7
-rw-r--r--sbin/fsck_ifs/pass4.c5
-rw-r--r--sbin/fsck_ifs/setup.c2
4 files changed, 13 insertions, 7 deletions
diff --git a/sbin/fsck_ifs/Makefile b/sbin/fsck_ifs/Makefile
index e1c106f..234b54d 100644
--- a/sbin/fsck_ifs/Makefile
+++ b/sbin/fsck_ifs/Makefile
@@ -1,10 +1,8 @@
# $FreeBSD$
# @(#)Makefile 8.2 (Berkeley) 4/27/95
-PROG= fsck_ffs
-LINKS+= ${BINDIR}/fsck_ffs ${BINDIR}/fsck_ufs
-LINKS+= ${BINDIR}/fsck_ffs ${BINDIR}/fsck_4.2bsd
-MAN8= fsck_ffs.8
+PROG= fsck_ifs
+NOMAN= true
SRCS= dir.c fsutil.c inode.c main.c pass1.c pass1b.c pass2.c pass3.c pass4.c \
pass5.c setup.c utilities.c ffs_subr.c ffs_tables.c
CFLAGS+=-W
diff --git a/sbin/fsck_ifs/main.c b/sbin/fsck_ifs/main.c
index 1e8a5b4..2c263da 100644
--- a/sbin/fsck_ifs/main.c
+++ b/sbin/fsck_ifs/main.c
@@ -241,9 +241,12 @@ checkfilesys(filesys, mntpt, auxdata, child)
/*
* 2: traverse directories from root to mark all connected directories
*/
+#ifdef NOTFORIFS
if (preen == 0)
printf("** Phase 2 - Check Pathnames\n");
pass2();
+#endif
+ printf("** Skipping phase 2 for IFS\n");
/*
* 3: scan inodes looking for disconnected directories
@@ -345,7 +348,7 @@ checkfilesys(filesys, mntpt, auxdata, child)
args.fspec = 0;
args.export.ex_flags = 0;
args.export.ex_root = 0;
- ret = mount("ufs", mntbuf->f_mntonname,
+ ret = mount("ifs", mntbuf->f_mntonname,
mntbuf->f_flags | MNT_UPDATE | MNT_RELOAD, &args);
if (ret == 0)
return (0);
@@ -380,7 +383,7 @@ getmntpt(name)
return (NULL);
mntsize = getmntinfo(&mntbuf, MNT_NOWAIT);
for (i = 0; i < mntsize; i++) {
- if (strcmp(mntbuf[i].f_fstypename, "ufs") != 0)
+ if (strcmp(mntbuf[i].f_fstypename, "ifs") != 0)
continue;
devname = mntbuf[i].f_mntfromname;
if (*devname != '/') {
diff --git a/sbin/fsck_ifs/pass4.c b/sbin/fsck_ifs/pass4.c
index 0012c50..2a8e43b 100644
--- a/sbin/fsck_ifs/pass4.c
+++ b/sbin/fsck_ifs/pass4.c
@@ -73,9 +73,12 @@ pass4()
case DFOUND:
n = inoinfo(inumber)->ino_linkcnt;
if (n) {
+#if NOTFORIFS
adjust(&idesc, (short)n);
+#endif
break;
}
+#if NOTFORIFS
for (zlnp = zlnhead; zlnp; zlnp = zlnp->next) {
if (zlnp->zlncnt == inumber) {
zlnp->zlncnt = zlnhead->zlncnt;
@@ -86,10 +89,10 @@ pass4()
break;
}
}
+#endif
break;
case DSTATE:
- clri(&idesc, "UNREF", 1);
break;
case DCLEAR:
diff --git a/sbin/fsck_ifs/setup.c b/sbin/fsck_ifs/setup.c
index 6c4098c..b9c3148 100644
--- a/sbin/fsck_ifs/setup.c
+++ b/sbin/fsck_ifs/setup.c
@@ -292,10 +292,12 @@ setup(dev)
}
numdirs = sblock.fs_cstotal.cs_ndir;
dirhash = numdirs;
+#if NOTFORIFS
if (numdirs == 0) {
printf("numdirs is zero, try using an alternate superblock\n");
goto badsb;
}
+#endif
inplast = 0;
listmax = numdirs + 10;
inpsort = (struct inoinfo **)calloc((unsigned)listmax,
OpenPOWER on IntegriCloud