summaryrefslogtreecommitdiff
path: root/sbin/fsck_ffs/pass1.c
diff options
context:
space:
mode:
authorOtto Moerbeek <otto@cvs.openbsd.org>2008-06-10 23:10:30 +0000
committerOtto Moerbeek <otto@cvs.openbsd.org>2008-06-10 23:10:30 +0000
commit7ee50b3f90920f1b1e1d9ad8cd2898f249ba4f71 (patch)
treef55a5f123e32c765618921e5e1bf73eb119a5e27 /sbin/fsck_ffs/pass1.c
parent00999f3dca30c91ccbd4f51b23ead58bf9b61b92 (diff)
reduce mem usage by about 20% by packing state and type of an inode in a single
byte. Original diff by drahn@; twists by me; ok millert@ thib@
Diffstat (limited to 'sbin/fsck_ffs/pass1.c')
-rw-r--r--sbin/fsck_ffs/pass1.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/sbin/fsck_ffs/pass1.c b/sbin/fsck_ffs/pass1.c
index 8485704056e..0e0f3bd5e5c 100644
--- a/sbin/fsck_ffs/pass1.c
+++ b/sbin/fsck_ffs/pass1.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pass1.c,v 1.26 2007/06/25 19:59:55 otto Exp $ */
+/* $OpenBSD: pass1.c,v 1.27 2008/06/10 23:10:29 otto Exp $ */
/* $NetBSD: pass1.c,v 1.16 1996/09/27 22:45:15 christos Exp $ */
/*
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)pass1.c 8.1 (Berkeley) 6/5/93";
#else
-static const char rcsid[] = "$OpenBSD: pass1.c,v 1.26 2007/06/25 19:59:55 otto Exp $";
+static const char rcsid[] = "$OpenBSD: pass1.c,v 1.27 2008/06/10 23:10:29 otto Exp $";
#endif
#endif /* not lint */
@@ -149,7 +149,7 @@ checkinode(ino_t inumber, struct inodesc *idesc)
inodirty();
}
}
- statemap[inumber] = USTATE;
+ SET_ISTATE(inumber, USTATE);
return;
}
lastino = inumber;
@@ -261,13 +261,13 @@ checkinode(ino_t inumber, struct inodesc *idesc)
}
if (mode == IFDIR) {
if (DIP(dp, di_size) == 0)
- statemap[inumber] = DCLEAR;
+ SET_ISTATE(inumber, DCLEAR);
else
- statemap[inumber] = DSTATE;
+ SET_ISTATE(inumber, DSTATE);
cacheino(dp, inumber);
} else
- statemap[inumber] = FSTATE;
- typemap[inumber] = IFTODT(mode);
+ SET_ISTATE(inumber, FSTATE);
+ SET_ITYPE(inumber, IFTODT(mode));
if (sblock.fs_magic == FS_UFS1_MAGIC && doinglevel2 &&
(dp->dp1.di_ouid != (u_short)-1 ||
dp->dp1.di_ogid != (u_short)-1)) {
@@ -296,9 +296,9 @@ checkinode(ino_t inumber, struct inodesc *idesc)
return;
unknown:
pfatal("UNKNOWN FILE TYPE I=%u", inumber);
- statemap[inumber] = FCLEAR;
+ SET_ISTATE(inumber, FCLEAR);
if (reply("CLEAR") == 1) {
- statemap[inumber] = USTATE;
+ SET_ISTATE(inumber, USTATE);
dp = ginode(inumber);
clearinode(dp);
inodirty();