summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sbin/fsck_ffs/dir.c22
-rw-r--r--sbin/fsck_ffs/fsck.h12
-rw-r--r--sbin/fsck_ffs/inode.c28
-rw-r--r--sbin/fsck_ffs/main.c10
-rw-r--r--sbin/fsck_ffs/pass1.c18
-rw-r--r--sbin/fsck_ffs/pass1b.c6
-rw-r--r--sbin/fsck_ffs/pass2.c27
-rw-r--r--sbin/fsck_ffs/pass3.c12
-rw-r--r--sbin/fsck_ffs/pass4.c8
-rw-r--r--sbin/fsck_ffs/pass5.c8
-rw-r--r--sbin/fsck_ffs/setup.c18
-rw-r--r--sbin/fsck_ffs/utilities.c6
12 files changed, 87 insertions, 88 deletions
diff --git a/sbin/fsck_ffs/dir.c b/sbin/fsck_ffs/dir.c
index c4244041f60..af1e61aa236 100644
--- a/sbin/fsck_ffs/dir.c
+++ b/sbin/fsck_ffs/dir.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dir.c,v 1.22 2007/09/16 17:42:40 otto Exp $ */
+/* $OpenBSD: dir.c,v 1.23 2008/06/10 23:10:29 otto Exp $ */
/* $NetBSD: dir.c,v 1.20 1996/09/27 22:45:11 christos Exp $ */
/*
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)dir.c 8.5 (Berkeley) 12/8/94";
#else
-static const char rcsid[] = "$OpenBSD: dir.c,v 1.22 2007/09/16 17:42:40 otto Exp $";
+static const char rcsid[] = "$OpenBSD: dir.c,v 1.23 2008/06/10 23:10:29 otto Exp $";
#endif
#endif /* not lint */
@@ -82,11 +82,11 @@ propagate(ino_t inumber)
char state;
inp = getinoinfo(inumber);
- state = statemap[inp->i_number];
+ state = GET_ISTATE(inp->i_number);
for (;;) {
- statemap[inp->i_number] = state;
+ SET_ISTATE(inp->i_number, state);
if (inp->i_child &&
- statemap[inp->i_child->i_number] != state)
+ GET_ISTATE(inp->i_child->i_number) != state)
inp = inp->i_child;
else if (inp->i_number == inumber)
break;
@@ -343,7 +343,7 @@ mkentry(struct inodesc *idesc)
dirp->d_ino = idesc->id_parent; /* ino to be entered is in id_parent */
dirp->d_reclen = newent.d_reclen;
if (newinofmt)
- dirp->d_type = typemap[idesc->id_parent];
+ dirp->d_type = GET_ITYPE(idesc->id_parent);
else
dirp->d_type = 0;
dirp->d_namlen = newent.d_namlen;
@@ -375,7 +375,7 @@ chgino(struct inodesc *idesc)
return (KEEPON);
dirp->d_ino = idesc->id_parent;
if (newinofmt)
- dirp->d_type = typemap[idesc->id_parent];
+ dirp->d_type = GET_ITYPE(idesc->id_parent);
else
dirp->d_type = 0;
return (ALTERED|STOP);
@@ -455,7 +455,7 @@ linkup(ino_t orphan, ino_t parentdir)
lncntp[oldlfdir] = 0;
dp = ginode(lfdir);
}
- if (statemap[lfdir] != DFOUND) {
+ if (GET_ISTATE(lfdir) != DFOUND) {
pfatal("SORRY. NO lost+found DIRECTORY\n\n");
return (0);
}
@@ -648,7 +648,7 @@ allocdir(ino_t parent, ino_t request, int mode)
cacheino(dp, ino);
return(ino);
}
- if (statemap[parent] != DSTATE && statemap[parent] != DFOUND) {
+ if (GET_ISTATE(parent) != DSTATE && GET_ISTATE(parent) != DFOUND) {
freeino(ino);
return (0);
}
@@ -656,8 +656,8 @@ allocdir(ino_t parent, ino_t request, int mode)
inp = getinoinfo(ino);
inp->i_parent = parent;
inp->i_dotdot = parent;
- statemap[ino] = statemap[parent];
- if (statemap[ino] == DSTATE) {
+ SET_ISTATE(ino, GET_ISTATE(parent));
+ if (GET_ISTATE(ino) == DSTATE) {
lncntp[ino] = DIP(dp, di_nlink);
lncntp[parent]++;
}
diff --git a/sbin/fsck_ffs/fsck.h b/sbin/fsck_ffs/fsck.h
index 5f7eb42c0d9..b6dad9649a8 100644
--- a/sbin/fsck_ffs/fsck.h
+++ b/sbin/fsck_ffs/fsck.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: fsck.h,v 1.22 2008/05/26 11:51:20 otto Exp $ */
+/* $OpenBSD: fsck.h,v 1.23 2008/06/10 23:10:29 otto Exp $ */
/* $NetBSD: fsck.h,v 1.13 1996/10/11 20:15:46 thorpej Exp $ */
/*
@@ -73,6 +73,13 @@ union dinode {
#define DCLEAR 05 /* directory is to be cleared */
#define FCLEAR 06 /* file is to be cleared */
+#define GET_ISTATE(ino) (stmap[(ino)] & 0xf)
+#define GET_ITYPE(ino) (stmap[(ino)] >> 4)
+#define SET_ISTATE(ino, v) do { stmap[(ino)] = (stmap[(ino)] & 0xf0) | \
+ ((v) & 0xf); } while (0)
+#define SET_ITYPE(ino, v) do { stmap[(ino)] = (stmap[(ino)] & 0x0f) | \
+ ((v) << 4); } while (0)
+
/*
* buffer cache structure.
*/
@@ -226,8 +233,7 @@ daddr64_t maxfsblock; /* number of blocks in the file system */
char *blockmap; /* ptr to primary blk allocation map */
ino_t maxino; /* number of inodes in file system */
ino_t lastino; /* last inode in use */
-char *statemap; /* ptr to inode state table */
-char *typemap; /* ptr to inode type table */
+u_char *stmap; /* ptr to inode state and type table */
int16_t *lncntp; /* ptr to link count table */
ino_t lfdir; /* lost & found directory inode number */
diff --git a/sbin/fsck_ffs/inode.c b/sbin/fsck_ffs/inode.c
index 355b687a097..bdca6524c27 100644
--- a/sbin/fsck_ffs/inode.c
+++ b/sbin/fsck_ffs/inode.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: inode.c,v 1.30 2007/06/25 19:59:55 otto Exp $ */
+/* $OpenBSD: inode.c,v 1.31 2008/06/10 23:10:29 otto Exp $ */
/* $NetBSD: inode.c,v 1.23 1996/10/11 20:15:47 thorpej Exp $ */
/*
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)inode.c 8.5 (Berkeley) 2/8/95";
#else
-static const char rcsid[] = "$OpenBSD: inode.c,v 1.30 2007/06/25 19:59:55 otto Exp $";
+static const char rcsid[] = "$OpenBSD: inode.c,v 1.31 2008/06/10 23:10:29 otto Exp $";
#endif
#endif /* not lint */
@@ -490,7 +490,7 @@ clri(struct inodesc *idesc, char *type, int flag)
n_files--;
(void)ckinode(dp, idesc);
clearinode(dp);
- statemap[idesc->id_number] = USTATE;
+ SET_ISTATE(idesc->id_number, USTATE);
inodirty();
}
}
@@ -555,14 +555,14 @@ blkerror(ino_t ino, char *type, daddr64_t blk)
pfatal("%lld %s I=%u", blk, type, ino);
printf("\n");
- switch (statemap[ino]) {
+ switch (GET_ISTATE(ino)) {
case FSTATE:
- statemap[ino] = FCLEAR;
+ SET_ISTATE(ino, FCLEAR);
return;
case DSTATE:
- statemap[ino] = DCLEAR;
+ SET_ISTATE(ino, DCLEAR);
return;
case FCLEAR:
@@ -570,7 +570,7 @@ blkerror(ino_t ino, char *type, daddr64_t blk)
return;
default:
- errexit("BAD STATE %d TO BLKERR\n", statemap[ino]);
+ errexit("BAD STATE %d TO BLKERR\n", GET_ISTATE(ino));
/* NOTREACHED */
}
}
@@ -589,10 +589,10 @@ allocino(ino_t request, int type)
if (request == 0)
request = ROOTINO;
- else if (statemap[request] != USTATE)
+ else if (GET_ISTATE(request) != USTATE)
return (0);
for (ino = request; ino < maxino; ino++)
- if (statemap[ino] == USTATE)
+ if (GET_ISTATE(ino) == USTATE)
break;
if (ino == maxino)
return (0);
@@ -605,12 +605,12 @@ allocino(ino_t request, int type)
switch (type & IFMT) {
case IFDIR:
- statemap[ino] = DSTATE;
+ SET_ISTATE(ino, DSTATE);
cgp->cg_cs.cs_ndir++;
break;
case IFREG:
case IFLNK:
- statemap[ino] = FSTATE;
+ SET_ISTATE(ino, FSTATE);
break;
default:
return (0);
@@ -619,7 +619,7 @@ allocino(ino_t request, int type)
dp = ginode(ino);
DIP_SET(dp, di_db[0], allocblk(1));
if (DIP(dp, di_db[0]) == 0) {
- statemap[ino] = USTATE;
+ SET_ISTATE(ino, USTATE);
return (0);
}
DIP_SET(dp, di_mode, type);
@@ -638,7 +638,7 @@ allocino(ino_t request, int type)
n_files++;
inodirty();
if (newinofmt)
- typemap[ino] = IFTODT(type);
+ SET_ITYPE(ino, IFTODT(type));
return (ino);
}
@@ -659,6 +659,6 @@ freeino(ino_t ino)
(void)ckinode(dp, &idesc);
clearinode(dp);
inodirty();
- statemap[ino] = USTATE;
+ SET_ISTATE(ino, USTATE);
n_files--;
}
diff --git a/sbin/fsck_ffs/main.c b/sbin/fsck_ffs/main.c
index 65c8ec2be9e..d92f139396d 100644
--- a/sbin/fsck_ffs/main.c
+++ b/sbin/fsck_ffs/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.32 2007/06/25 19:59:55 otto Exp $ */
+/* $OpenBSD: main.c,v 1.33 2008/06/10 23:10:29 otto Exp $ */
/* $NetBSD: main.c,v 1.22 1996/10/11 20:15:48 thorpej Exp $ */
/*
@@ -40,7 +40,7 @@ static const char copyright[] =
#if 0
static char sccsid[] = "@(#)main.c 8.2 (Berkeley) 1/23/94";
#else
-static const char rcsid[] = "$OpenBSD: main.c,v 1.32 2007/06/25 19:59:55 otto Exp $";
+static const char rcsid[] = "$OpenBSD: main.c,v 1.33 2008/06/10 23:10:29 otto Exp $";
#endif
#endif /* not lint */
@@ -316,10 +316,8 @@ checkfilesys(char *filesys, char *mntpt, long auxdata, int child)
ckfini(resolved); /* Don't mark fs clean if fsck needs to be re-run */
free(blockmap);
blockmap = NULL;
- free(statemap);
- statemap = NULL;
- free(typemap);
- typemap = NULL;
+ free(stmap);
+ stmap = NULL;
free(lncntp);
lncntp = NULL;
free(sblock.fs_csp);
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();
diff --git a/sbin/fsck_ffs/pass1b.c b/sbin/fsck_ffs/pass1b.c
index 2b505240156..8f90a2c7497 100644
--- a/sbin/fsck_ffs/pass1b.c
+++ b/sbin/fsck_ffs/pass1b.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pass1b.c,v 1.15 2007/06/25 19:59:55 otto Exp $ */
+/* $OpenBSD: pass1b.c,v 1.16 2008/06/10 23:10:29 otto Exp $ */
/* $NetBSD: pass1b.c,v 1.10 1996/09/23 16:18:37 christos Exp $ */
/*
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)pass1b.c 8.1 (Berkeley) 6/5/93";
#else
-static const char rcsid[] = "$OpenBSD: pass1b.c,v 1.15 2007/06/25 19:59:55 otto Exp $";
+static const char rcsid[] = "$OpenBSD: pass1b.c,v 1.16 2008/06/10 23:10:29 otto Exp $";
#endif
#endif /* not lint */
@@ -83,7 +83,7 @@ pass1b(void)
if (dp == NULL)
continue;
idesc.id_number = inumber;
- if (statemap[inumber] != USTATE &&
+ if (GET_ISTATE(inumber) != USTATE &&
(ckinode(dp, &idesc) & STOP))
return;
}
diff --git a/sbin/fsck_ffs/pass2.c b/sbin/fsck_ffs/pass2.c
index 8c7e3ce184f..2888aec7156 100644
--- a/sbin/fsck_ffs/pass2.c
+++ b/sbin/fsck_ffs/pass2.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pass2.c,v 1.27 2007/06/25 19:59:55 otto Exp $ */
+/* $OpenBSD: pass2.c,v 1.28 2008/06/10 23:10:29 otto Exp $ */
/* $NetBSD: pass2.c,v 1.17 1996/09/27 22:45:15 christos Exp $ */
/*
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)pass2.c 8.6 (Berkeley) 10/27/94";
#else
-static const char rcsid[] = "$OpenBSD: pass2.c,v 1.27 2007/06/25 19:59:55 otto Exp $";
+static const char rcsid[] = "$OpenBSD: pass2.c,v 1.28 2008/06/10 23:10:29 otto Exp $";
#endif
#endif /* not lint */
@@ -87,7 +87,7 @@ pass2(void)
char pathbuf[MAXPATHLEN + 1];
int i;
- switch (statemap[ROOTINO]) {
+ switch (GET_ISTATE(ROOTINO)) {
case USTATE:
pfatal("ROOT INODE UNALLOCATED");
@@ -136,9 +136,9 @@ pass2(void)
break;
default:
- errexit("BAD STATE %d FOR ROOT INODE\n", statemap[ROOTINO]);
+ errexit("BAD STATE %d FOR ROOT INODE\n", GET_ISTATE(ROOTINO));
}
- statemap[ROOTINO] = DFOUND;
+ SET_ISTATE(ROOTINO, DFOUND);
/*
* Sort the directory list into disk block order.
*/
@@ -270,7 +270,7 @@ pass2check(struct inodesc *idesc)
* If converting, set directory entry type.
*/
if (doinglevel2 && dirp->d_ino > 0 && dirp->d_ino < maxino) {
- dirp->d_type = typemap[dirp->d_ino];
+ dirp->d_type = GET_ITYPE(dirp->d_ino);
ret |= ALTERED;
}
/*
@@ -428,7 +428,7 @@ chk2:
n = reply("REMOVE");
} else {
again:
- switch (statemap[dirp->d_ino]) {
+ switch (GET_ISTATE(dirp->d_ino)) {
case USTATE:
if (idesc->id_entryno <= 2)
break;
@@ -440,7 +440,7 @@ again:
case FCLEAR:
if (idesc->id_entryno <= 2)
break;
- if (statemap[dirp->d_ino] == FCLEAR)
+ if (GET_ISTATE(dirp->d_ino) == FCLEAR)
errmsg = "DUP/BAD";
else if (!preen && !usedsoftdep)
errmsg = "ZERO LENGTH DIRECTORY";
@@ -452,8 +452,8 @@ again:
if ((n = reply("REMOVE")) == 1)
break;
dp = ginode(dirp->d_ino);
- statemap[dirp->d_ino] =
- (DIP(dp, di_mode) & IFMT) == IFDIR ? DSTATE : FSTATE;
+ SET_ISTATE(dirp->d_ino, (DIP(dp, di_mode) & IFMT) ==
+ IFDIR ? DSTATE : FSTATE);
lncntp[dirp->d_ino] = DIP(dp, di_nlink);
goto again;
@@ -481,10 +481,11 @@ again:
/* FALLTHROUGH */
case FSTATE:
- if (newinofmt && dirp->d_type != typemap[dirp->d_ino]) {
+ if (newinofmt && dirp->d_type !=
+ GET_ITYPE(dirp->d_ino)) {
fileerror(idesc->id_number, dirp->d_ino,
"BAD TYPE VALUE");
- dirp->d_type = typemap[dirp->d_ino];
+ dirp->d_type = GET_ITYPE(dirp->d_ino);
if (reply("FIX") == 1)
ret |= ALTERED;
}
@@ -493,7 +494,7 @@ again:
default:
errexit("BAD STATE %d FOR INODE I=%d\n",
- statemap[dirp->d_ino], dirp->d_ino);
+ GET_ISTATE(dirp->d_ino), dirp->d_ino);
}
}
if (n == 0)
diff --git a/sbin/fsck_ffs/pass3.c b/sbin/fsck_ffs/pass3.c
index 70cf4cecaa4..8cd8387a115 100644
--- a/sbin/fsck_ffs/pass3.c
+++ b/sbin/fsck_ffs/pass3.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pass3.c,v 1.12 2006/03/22 20:24:32 deraadt Exp $ */
+/* $OpenBSD: pass3.c,v 1.13 2008/06/10 23:10:29 otto Exp $ */
/* $NetBSD: pass3.c,v 1.8 1995/03/18 14:55:54 cgd Exp $ */
/*
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)pass3.c 8.1 (Berkeley) 6/5/93";
#else
-static const char rcsid[] = "$OpenBSD: pass3.c,v 1.12 2006/03/22 20:24:32 deraadt Exp $";
+static const char rcsid[] = "$OpenBSD: pass3.c,v 1.13 2008/06/10 23:10:29 otto Exp $";
#endif
#endif /* not lint */
@@ -67,14 +67,14 @@ pass3(void)
info_pos++;
inp = *inpp;
if (inp->i_number == ROOTINO ||
- (inp->i_parent != 0 && statemap[inp->i_number] != DSTATE))
+ (inp->i_parent != 0 && GET_ISTATE(inp->i_number) != DSTATE))
continue;
- if (statemap[inp->i_number] == DCLEAR)
+ if (GET_ISTATE(inp->i_number) == DCLEAR)
continue;
for (loopcnt = 0; ; loopcnt++) {
orphan = inp->i_number;
if (inp->i_parent == 0 ||
- statemap[inp->i_parent] != DSTATE ||
+ GET_ISTATE(inp->i_parent) != DSTATE ||
loopcnt > numdirs)
break;
inp = getinoinfo(inp->i_parent);
@@ -86,7 +86,7 @@ pass3(void)
inp->i_parentp = pinp;
inp->i_sibling = pinp->i_child;
pinp->i_child = inp;
- statemap[orphan] = statemap[inp->i_parent];
+ SET_ISTATE(orphan, GET_ISTATE(inp->i_parent));
}
propagate(orphan);
}
diff --git a/sbin/fsck_ffs/pass4.c b/sbin/fsck_ffs/pass4.c
index 69b60a48fa3..df5c208ea69 100644
--- a/sbin/fsck_ffs/pass4.c
+++ b/sbin/fsck_ffs/pass4.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pass4.c,v 1.17 2007/06/25 19:59:55 otto Exp $ */
+/* $OpenBSD: pass4.c,v 1.18 2008/06/10 23:10:29 otto Exp $ */
/* $NetBSD: pass4.c,v 1.11 1996/09/27 22:45:17 christos Exp $ */
/*
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)pass4.c 8.1 (Berkeley) 6/5/93";
#else
-static const char rcsid[] = "$OpenBSD: pass4.c,v 1.17 2007/06/25 19:59:55 otto Exp $";
+static const char rcsid[] = "$OpenBSD: pass4.c,v 1.18 2008/06/10 23:10:29 otto Exp $";
#endif
#endif /* not lint */
@@ -78,7 +78,7 @@ pass4(void)
if (inumber < ROOTINO)
continue;
idesc.id_number = inumber;
- switch (statemap[inumber]) {
+ switch (GET_ISTATE(inumber)) {
case FSTATE:
case DFOUND:
@@ -118,7 +118,7 @@ pass4(void)
default:
errexit("BAD STATE %d FOR INODE I=%d\n",
- statemap[inumber], inumber);
+ GET_ISTATE(inumber), inumber);
}
}
}
diff --git a/sbin/fsck_ffs/pass5.c b/sbin/fsck_ffs/pass5.c
index 8d1914d522c..48b3e186d9c 100644
--- a/sbin/fsck_ffs/pass5.c
+++ b/sbin/fsck_ffs/pass5.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pass5.c,v 1.36 2007/07/17 18:54:40 otto Exp $ */
+/* $OpenBSD: pass5.c,v 1.37 2008/06/10 23:10:29 otto Exp $ */
/* $NetBSD: pass5.c,v 1.16 1996/09/27 22:45:18 christos Exp $ */
/*
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)pass5.c 8.6 (Berkeley) 11/30/94";
#else
-static const char rcsid[] = "$OpenBSD: pass5.c,v 1.36 2007/07/17 18:54:40 otto Exp $";
+static const char rcsid[] = "$OpenBSD: pass5.c,v 1.37 2008/06/10 23:10:29 otto Exp $";
#endif
#endif /* not lint */
@@ -239,7 +239,7 @@ pass5(void)
ocg->cg_magic = CG_MAGIC;
j = fs->fs_ipg * c;
for (i = 0; i < cginosused[c]; j++, i++) {
- switch (statemap[j]) {
+ switch (GET_ISTATE(j)) {
case USTATE:
break;
@@ -260,7 +260,7 @@ pass5(void)
if (j < ROOTINO)
break;
errexit("BAD STATE %d FOR INODE I=%ld\n",
- statemap[j], j);
+ GET_ISTATE(j), j);
}
}
if (c == 0)
diff --git a/sbin/fsck_ffs/setup.c b/sbin/fsck_ffs/setup.c
index 0dfbdad697e..e5f00150b46 100644
--- a/sbin/fsck_ffs/setup.c
+++ b/sbin/fsck_ffs/setup.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: setup.c,v 1.39 2008/06/10 13:49:24 otto Exp $ */
+/* $OpenBSD: setup.c,v 1.40 2008/06/10 23:10:29 otto Exp $ */
/* $NetBSD: setup.c,v 1.27 1996/09/27 22:45:19 christos Exp $ */
/*
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)setup.c 8.5 (Berkeley) 11/23/94";
#else
-static const char rcsid[] = "$OpenBSD: setup.c,v 1.39 2008/06/10 13:49:24 otto Exp $";
+static const char rcsid[] = "$OpenBSD: setup.c,v 1.40 2008/06/10 23:10:29 otto Exp $";
#endif
#endif /* not lint */
@@ -419,15 +419,9 @@ found:
(unsigned)bmapsize);
goto badsblabel;
}
- statemap = calloc((unsigned)(maxino + 1), sizeof(char));
- if (statemap == NULL) {
- printf("cannot alloc %u bytes for statemap\n",
- (unsigned)(maxino + 1));
- goto badsblabel;
- }
- typemap = calloc((unsigned)(maxino + 1), sizeof(char));
- if (typemap == NULL) {
- printf("cannot alloc %u bytes for typemap\n",
+ stmap = calloc((unsigned)(maxino + 1), sizeof(char));
+ if (stmap == NULL) {
+ printf("cannot alloc %u bytes for stmap\n",
(unsigned)(maxino + 1));
goto badsblabel;
}
@@ -449,7 +443,7 @@ found:
inpsort = calloc((unsigned)listmax, sizeof(struct inoinfo *));
if (inpsort == NULL) {
printf("cannot alloc %zu bytes for inpsort\n",
- (unsigned)numdirs * sizeof(struct inoinfo *));
+ (unsigned)listmax * sizeof(struct inoinfo *));
goto badsblabel;
}
inphead = calloc((unsigned)numdirs, sizeof(struct inoinfo *));
diff --git a/sbin/fsck_ffs/utilities.c b/sbin/fsck_ffs/utilities.c
index 664d4d13bbd..1ca340ee89e 100644
--- a/sbin/fsck_ffs/utilities.c
+++ b/sbin/fsck_ffs/utilities.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: utilities.c,v 1.34 2007/06/25 19:59:55 otto Exp $ */
+/* $OpenBSD: utilities.c,v 1.35 2008/06/10 23:10:29 otto Exp $ */
/* $NetBSD: utilities.c,v 1.18 1996/09/27 22:45:20 christos Exp $ */
/*
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)utilities.c 8.1 (Berkeley) 6/5/93";
#else
-static const char rcsid[] = "$OpenBSD: utilities.c,v 1.34 2007/06/25 19:59:55 otto Exp $";
+static const char rcsid[] = "$OpenBSD: utilities.c,v 1.35 2008/06/10 23:10:29 otto Exp $";
#endif
#endif /* not lint */
@@ -456,7 +456,7 @@ getpathname(char *namebuf, size_t namebuflen, ino_t curdir, ino_t ino)
return;
}
if (busy ||
- (statemap[curdir] != DSTATE && statemap[curdir] != DFOUND)) {
+ (GET_ISTATE(curdir) != DSTATE && GET_ISTATE(curdir) != DFOUND)) {
(void)strlcpy(namebuf, "?", namebuflen);
return;
}