aboutsummaryrefslogtreecommitdiff
path: root/sbin
diff options
context:
space:
mode:
Diffstat (limited to 'sbin')
-rw-r--r--sbin/dump/traverse.c37
-rw-r--r--sbin/ffsinfo/ffsinfo.c4
-rw-r--r--sbin/fsck_ffs/dir.c25
-rw-r--r--sbin/fsck_ffs/fsutil.c6
-rw-r--r--sbin/fsck_ffs/gjournal.c4
-rw-r--r--sbin/fsck_ffs/inode.c44
-rw-r--r--sbin/fsck_ffs/main.c2
-rw-r--r--sbin/fsck_ffs/pass1.c24
-rw-r--r--sbin/fsck_ffs/pass1b.c2
-rw-r--r--sbin/fsck_ffs/pass2.c39
-rw-r--r--sbin/fsck_ffs/pass3.c4
-rw-r--r--sbin/fsck_ffs/pass4.c2
-rw-r--r--sbin/fsck_ffs/pass5.c6
-rw-r--r--sbin/fsck_ffs/suj.c35
-rw-r--r--sbin/fsdb/fsdb.c24
-rw-r--r--sbin/fsdb/fsdbutil.c8
-rw-r--r--sbin/fsirand/fsirand.c2
-rw-r--r--sbin/growfs/debug.c10
-rw-r--r--sbin/growfs/growfs.c2
-rw-r--r--sbin/newfs/mkfs.c31
-rw-r--r--sbin/newfs_nandfs/newfs_nandfs.c4
-rw-r--r--sbin/quotacheck/quotacheck.c3
-rw-r--r--sbin/restore/dirs.c6
-rw-r--r--sbin/restore/interactive.c10
-rw-r--r--sbin/restore/main.c6
-rw-r--r--sbin/restore/restore.c18
-rw-r--r--sbin/restore/symtab.c20
-rw-r--r--sbin/restore/tape.c2
-rw-r--r--sbin/restore/utilities.c2
-rw-r--r--sbin/tunefs/tunefs.c26
30 files changed, 207 insertions, 201 deletions
diff --git a/sbin/dump/traverse.c b/sbin/dump/traverse.c
index 2aa0305a6867..864d9e528ca3 100644
--- a/sbin/dump/traverse.c
+++ b/sbin/dump/traverse.c
@@ -118,11 +118,10 @@ blockest(union dinode *dp)
sizeest = howmany(DIP(dp, di_size), TP_BSIZE);
if (blkest > sizeest)
blkest = sizeest;
- if (DIP(dp, di_size) > sblock->fs_bsize * NDADDR) {
+ if (DIP(dp, di_size) > sblock->fs_bsize * UFS_NDADDR) {
/* calculate the number of indirect blocks on the dump tape */
- blkest +=
- howmany(sizeest - NDADDR * sblock->fs_bsize / TP_BSIZE,
- TP_NINDIR);
+ blkest += howmany(sizeest -
+ UFS_NDADDR * sblock->fs_bsize / TP_BSIZE, TP_NINDIR);
}
return (blkest + 1);
}
@@ -192,7 +191,7 @@ mapfiles(ino_t maxino, long *tapesize)
continue;
}
for (i = 0; i < inosused; i++, ino++) {
- if (ino < ROOTINO ||
+ if (ino < UFS_ROOTINO ||
(dp = getino(ino, &mode)) == NULL ||
(mode & IFMT) == 0)
continue;
@@ -232,7 +231,7 @@ mapfiles(ino_t maxino, long *tapesize)
* Restore gets very upset if the root is not dumped,
* so ensure that it always is dumped.
*/
- SETINO(ROOTINO, dumpinomap);
+ SETINO(UFS_ROOTINO, dumpinomap);
return (anydirskipped);
}
@@ -284,7 +283,7 @@ mapdirs(ino_t maxino, long *tapesize)
else
di.dp2 = dp->dp2;
filesize = DIP(&di, di_size);
- for (ret = 0, i = 0; filesize > 0 && i < NDADDR; i++) {
+ for (ret = 0, i = 0; filesize > 0 && i < UFS_NDADDR; i++) {
if (DIP(&di, di_db[i]) != 0)
ret |= searchdir(ino, DIP(&di, di_db[i]),
(long)sblksize(sblock, DIP(&di, di_size),
@@ -294,7 +293,7 @@ mapdirs(ino_t maxino, long *tapesize)
else
filesize -= sblock->fs_bsize;
}
- for (i = 0; filesize > 0 && i < NIADDR; i++) {
+ for (i = 0; filesize > 0 && i < UFS_NIADDR; i++) {
if (DIP(&di, di_ib[i]) == 0)
continue;
ret |= dirindir(ino, DIP(&di, di_ib[i]), i, &filesize,
@@ -556,8 +555,8 @@ dumpino(union dinode *dp, ino_t ino)
DIP(dp, di_mode) & IFMT);
return;
}
- if (DIP(dp, di_size) > NDADDR * sblock->fs_bsize) {
- cnt = NDADDR * sblock->fs_frag;
+ if (DIP(dp, di_size) > UFS_NDADDR * sblock->fs_bsize) {
+ cnt = UFS_NDADDR * sblock->fs_frag;
last = 0;
} else {
cnt = howmany(DIP(dp, di_size), sblock->fs_fsize);
@@ -567,9 +566,9 @@ dumpino(union dinode *dp, ino_t ino)
ufs1_blksout(&dp->dp1.di_db[0], cnt, ino);
else
ufs2_blksout(dp, &dp->dp2.di_db[0], cnt, ino, last);
- if ((size = DIP(dp, di_size) - NDADDR * sblock->fs_bsize) <= 0)
+ if ((size = DIP(dp, di_size) - UFS_NDADDR * sblock->fs_bsize) <= 0)
return;
- for (ind_level = 0; ind_level < NIADDR; ind_level++) {
+ for (ind_level = 0; ind_level < UFS_NIADDR; ind_level++) {
dmpindir(dp, ino, DIP(dp, di_ib[ind_level]), ind_level, &size);
if (size <= 0)
return;
@@ -740,8 +739,8 @@ appendextdata(union dinode *dp)
* part of them here, we simply push them entirely into a
* new block rather than putting some here and some later.
*/
- if (spcl.c_extsize > NXADDR * sblock->fs_bsize)
- blks = howmany(NXADDR * sblock->fs_bsize, TP_BSIZE);
+ if (spcl.c_extsize > UFS_NXADDR * sblock->fs_bsize)
+ blks = howmany(UFS_NXADDR * sblock->fs_bsize, TP_BSIZE);
else
blks = howmany(spcl.c_extsize, TP_BSIZE);
if (spcl.c_count + blks > TP_NINDIR)
@@ -784,8 +783,8 @@ writeextdata(union dinode *dp, ino_t ino, int added)
* dump them out in a new block, otherwise just dump the data.
*/
if (added == 0) {
- if (spcl.c_extsize > NXADDR * sblock->fs_bsize) {
- frags = NXADDR * sblock->fs_frag;
+ if (spcl.c_extsize > UFS_NXADDR * sblock->fs_bsize) {
+ frags = UFS_NXADDR * sblock->fs_frag;
last = 0;
} else {
frags = howmany(spcl.c_extsize, sblock->fs_fsize);
@@ -793,8 +792,8 @@ writeextdata(union dinode *dp, ino_t ino, int added)
}
ufs2_blksout(dp, &dp->dp2.di_extb[0], frags, ino, last);
} else {
- if (spcl.c_extsize > NXADDR * sblock->fs_bsize)
- blks = howmany(NXADDR * sblock->fs_bsize, TP_BSIZE);
+ if (spcl.c_extsize > UFS_NXADDR * sblock->fs_bsize)
+ blks = howmany(UFS_NXADDR * sblock->fs_bsize, TP_BSIZE);
else
blks = howmany(spcl.c_extsize, TP_BSIZE);
tbperdb = sblock->fs_bsize >> tp_bshift;
@@ -820,7 +819,7 @@ writeextdata(union dinode *dp, ino_t ino, int added)
* If the extended attributes fall into an indirect block,
* dump it as well.
*/
- if ((size = spcl.c_extsize - NXADDR * sblock->fs_bsize) > 0)
+ if ((size = spcl.c_extsize - UFS_NXADDR * sblock->fs_bsize) > 0)
dmpindir(dp, ino, dp->dp2.di_exti, 0, &size);
}
diff --git a/sbin/ffsinfo/ffsinfo.c b/sbin/ffsinfo/ffsinfo.c
index c1e7c87c1b47..1c082aba8fb0 100644
--- a/sbin/ffsinfo/ffsinfo.c
+++ b/sbin/ffsinfo/ffsinfo.c
@@ -377,7 +377,7 @@ dump_whole_ufs1_inode(ino_t inode, int level)
/*
* Ok, now prepare for dumping all direct and indirect pointers.
*/
- rb=howmany(ino->di_size, sblock.fs_bsize)-NDADDR;
+ rb = howmany(ino->di_size, sblock.fs_bsize) - UFS_NDADDR;
if(rb>0) {
/*
* Dump single indirect block.
@@ -529,7 +529,7 @@ dump_whole_ufs2_inode(ino_t inode, int level)
/*
* Ok, now prepare for dumping all direct and indirect pointers.
*/
- rb = howmany(ino->di_size, sblock.fs_bsize) - NDADDR;
+ rb = howmany(ino->di_size, sblock.fs_bsize) - UFS_NDADDR;
if (rb > 0) {
/*
* Dump single indirect block.
diff --git a/sbin/fsck_ffs/dir.c b/sbin/fsck_ffs/dir.c
index 604349779c4e..53dceb2d2b28 100644
--- a/sbin/fsck_ffs/dir.c
+++ b/sbin/fsck_ffs/dir.c
@@ -255,7 +255,7 @@ fileerror(ino_t cwd, ino_t ino, const char *errmesg)
pinode(ino);
printf("\n");
getpathname(pathbuf, cwd, ino);
- if (ino < ROOTINO || ino > maxino) {
+ if (ino < UFS_ROOTINO || ino > maxino) {
pfatal("NAME=%s\n", pathbuf);
return;
}
@@ -401,24 +401,25 @@ linkup(ino_t orphan, ino_t parentdir, char *name)
if (reply("RECONNECT") == 0)
return (0);
if (lfdir == 0) {
- dp = ginode(ROOTINO);
+ dp = ginode(UFS_ROOTINO);
idesc.id_name = strdup(lfname);
idesc.id_type = DATA;
idesc.id_func = findino;
- idesc.id_number = ROOTINO;
+ idesc.id_number = UFS_ROOTINO;
if ((ckinode(dp, &idesc) & FOUND) != 0) {
lfdir = idesc.id_parent;
} else {
pwarn("NO lost+found DIRECTORY");
if (preen || reply("CREATE")) {
- lfdir = allocdir(ROOTINO, (ino_t)0, lfmode);
+ lfdir = allocdir(UFS_ROOTINO, (ino_t)0, lfmode);
if (lfdir != 0) {
- if (makeentry(ROOTINO, lfdir, lfname) != 0) {
+ if (makeentry(UFS_ROOTINO, lfdir,
+ lfname) != 0) {
numdirs++;
if (preen)
printf(" (CREATED)\n");
} else {
- freedir(lfdir, ROOTINO);
+ freedir(lfdir, UFS_ROOTINO);
lfdir = 0;
if (preen)
printf("\n");
@@ -438,11 +439,11 @@ linkup(ino_t orphan, ino_t parentdir, char *name)
if (reply("REALLOCATE") == 0)
return (0);
oldlfdir = lfdir;
- if ((lfdir = allocdir(ROOTINO, (ino_t)0, lfmode)) == 0) {
+ if ((lfdir = allocdir(UFS_ROOTINO, (ino_t)0, lfmode)) == 0) {
pfatal("SORRY. CANNOT CREATE lost+found DIRECTORY\n\n");
return (0);
}
- if ((changeino(ROOTINO, lfname, lfdir) & ALTERED) == 0) {
+ if ((changeino(UFS_ROOTINO, lfname, lfdir) & ALTERED) == 0) {
pfatal("SORRY. CANNOT CREATE lost+found DIRECTORY\n\n");
return (0);
}
@@ -519,8 +520,8 @@ makeentry(ino_t parent, ino_t ino, const char *name)
struct inodesc idesc;
char pathbuf[MAXPATHLEN + 1];
- if (parent < ROOTINO || parent >= maxino ||
- ino < ROOTINO || ino >= maxino)
+ if (parent < UFS_ROOTINO || parent >= maxino ||
+ ino < UFS_ROOTINO || ino >= maxino)
return (0);
memset(&idesc, 0, sizeof(struct inodesc));
idesc.id_type = DATA;
@@ -554,7 +555,7 @@ expanddir(union dinode *dp, char *name)
char *cp, firstblk[DIRBLKSIZ];
lastbn = lblkno(&sblock, DIP(dp, di_size));
- if (lastbn >= NDADDR - 1 || DIP(dp, di_db[lastbn]) == 0 ||
+ if (lastbn >= UFS_NDADDR - 1 || DIP(dp, di_db[lastbn]) == 0 ||
DIP(dp, di_size) == 0)
return (0);
if ((newblk = allocblk(sblock.fs_frag)) == 0)
@@ -630,7 +631,7 @@ allocdir(ino_t parent, ino_t request, int mode)
dirty(bp);
DIP_SET(dp, di_nlink, 2);
inodirty();
- if (ino == ROOTINO) {
+ if (ino == UFS_ROOTINO) {
inoinfo(ino)->ino_linkcnt = DIP(dp, di_nlink);
cacheino(dp, ino);
return(ino);
diff --git a/sbin/fsck_ffs/fsutil.c b/sbin/fsck_ffs/fsutil.c
index 7a26db6071b8..7af304d016b4 100644
--- a/sbin/fsck_ffs/fsutil.c
+++ b/sbin/fsck_ffs/fsutil.c
@@ -854,7 +854,7 @@ getpathname(char *namebuf, ino_t curdir, ino_t ino)
struct inodesc idesc;
static int busy = 0;
- if (curdir == ino && ino == ROOTINO) {
+ if (curdir == ino && ino == UFS_ROOTINO) {
(void)strcpy(namebuf, "/");
return;
}
@@ -872,7 +872,7 @@ getpathname(char *namebuf, ino_t curdir, ino_t ino)
idesc.id_parent = curdir;
goto namelookup;
}
- while (ino != ROOTINO) {
+ while (ino != UFS_ROOTINO) {
idesc.id_number = ino;
idesc.id_func = findino;
idesc.id_name = strdup("..");
@@ -894,7 +894,7 @@ getpathname(char *namebuf, ino_t curdir, ino_t ino)
ino = idesc.id_number;
}
busy = 0;
- if (ino != ROOTINO)
+ if (ino != UFS_ROOTINO)
*--cp = '?';
memmove(namebuf, cp, (size_t)(&namebuf[MAXPATHLEN] - cp));
}
diff --git a/sbin/fsck_ffs/gjournal.c b/sbin/fsck_ffs/gjournal.c
index ba8dc3416a96..f04b7ad9aa53 100644
--- a/sbin/fsck_ffs/gjournal.c
+++ b/sbin/fsck_ffs/gjournal.c
@@ -367,7 +367,7 @@ clear_inode(struct ufs2_dinode *dino)
osize = dino->di_extsize;
dino->di_blocks -= extblocks;
dino->di_extsize = 0;
- for (i = 0; i < NXADDR; i++) {
+ for (i = 0; i < UFS_NXADDR; i++) {
if (dino->di_extb[i] == 0)
continue;
blkfree(dino->di_extb[i], sblksize(fs, osize, i));
@@ -383,7 +383,7 @@ clear_inode(struct ufs2_dinode *dino)
freeindir(dino->di_ib[level], level);
}
/* deallocate direct blocks and fragments */
- for (i = 0; i < NDADDR; i++) {
+ for (i = 0; i < UFS_NDADDR; i++) {
bn = dino->di_db[i];
if (bn == 0)
continue;
diff --git a/sbin/fsck_ffs/inode.c b/sbin/fsck_ffs/inode.c
index 0d78814eac68..a5f74c17a907 100644
--- a/sbin/fsck_ffs/inode.c
+++ b/sbin/fsck_ffs/inode.c
@@ -78,7 +78,7 @@ ckinode(union dinode *dp, struct inodesc *idesc)
else
dino.dp2 = dp->dp2;
ndb = howmany(DIP(&dino, di_size), sblock.fs_bsize);
- for (i = 0; i < NDADDR; i++) {
+ for (i = 0; i < UFS_NDADDR; i++) {
idesc->id_lbn++;
if (--ndb == 0 &&
(offset = blkoff(&sblock, DIP(&dino, di_size))) != 0)
@@ -115,9 +115,9 @@ ckinode(union dinode *dp, struct inodesc *idesc)
return (ret);
}
idesc->id_numfrags = sblock.fs_frag;
- remsize = DIP(&dino, di_size) - sblock.fs_bsize * NDADDR;
+ remsize = DIP(&dino, di_size) - sblock.fs_bsize * UFS_NDADDR;
sizepb = sblock.fs_bsize;
- for (i = 0; i < NIADDR; i++) {
+ for (i = 0; i < UFS_NIADDR; i++) {
sizepb *= NINDIR(&sblock);
if (DIP(&dino, di_ib[i])) {
idesc->id_blkno = DIP(&dino, di_ib[i]);
@@ -284,7 +284,7 @@ ginode(ino_t inumber)
{
ufs2_daddr_t iblk;
- if (inumber < ROOTINO || inumber > maxino)
+ if (inumber < UFS_ROOTINO || inumber > maxino)
errx(EEXIT, "bad inode number %ju to ginode",
(uintmax_t)inumber);
if (startinum == 0 ||
@@ -348,9 +348,9 @@ getnextinode(ino_t inumber, int rebuildcg)
mode = DIP(dp, di_mode) & IFMT;
if (mode == 0) {
if (memcmp(dp->dp2.di_db, ufs2_zino.di_db,
- NDADDR * sizeof(ufs2_daddr_t)) ||
+ UFS_NDADDR * sizeof(ufs2_daddr_t)) ||
memcmp(dp->dp2.di_ib, ufs2_zino.di_ib,
- NIADDR * sizeof(ufs2_daddr_t)) ||
+ UFS_NIADDR * sizeof(ufs2_daddr_t)) ||
dp->dp2.di_mode || dp->dp2.di_size)
return (NULL);
goto inodegood;
@@ -370,20 +370,20 @@ getnextinode(ino_t inumber, int rebuildcg)
if (DIP(dp, di_size) < (off_t)sblock.fs_maxsymlinklen) {
ndb = howmany(DIP(dp, di_size),
sizeof(ufs2_daddr_t));
- if (ndb > NDADDR) {
- j = ndb - NDADDR;
+ if (ndb > UFS_NDADDR) {
+ j = ndb - UFS_NDADDR;
for (ndb = 1; j > 1; j--)
ndb *= NINDIR(&sblock);
- ndb += NDADDR;
+ ndb += UFS_NDADDR;
}
}
}
- for (j = ndb; ndb < NDADDR && j < NDADDR; j++)
+ for (j = ndb; ndb < UFS_NDADDR && j < UFS_NDADDR; j++)
if (DIP(dp, di_db[j]) != 0)
return (NULL);
- for (j = 0, ndb -= NDADDR; ndb > 0; j++)
+ for (j = 0, ndb -= UFS_NDADDR; ndb > 0; j++)
ndb /= NINDIR(&sblock);
- for (; j < NIADDR; j++)
+ for (; j < UFS_NIADDR; j++)
if (DIP(dp, di_ib[j]) != 0)
return (NULL);
}
@@ -449,8 +449,8 @@ cacheino(union dinode *dp, ino_t inumber)
struct inoinfo *inp, **inpp;
int i, blks;
- if (howmany(DIP(dp, di_size), sblock.fs_bsize) > NDADDR)
- blks = NDADDR + NIADDR;
+ if (howmany(DIP(dp, di_size), sblock.fs_bsize) > UFS_NDADDR)
+ blks = UFS_NDADDR + UFS_NIADDR;
else
blks = howmany(DIP(dp, di_size), sblock.fs_bsize);
inp = (struct inoinfo *)
@@ -460,16 +460,16 @@ cacheino(union dinode *dp, ino_t inumber)
inpp = &inphead[inumber % dirhash];
inp->i_nexthash = *inpp;
*inpp = inp;
- inp->i_parent = inumber == ROOTINO ? ROOTINO : (ino_t)0;
+ inp->i_parent = inumber == UFS_ROOTINO ? UFS_ROOTINO : (ino_t)0;
inp->i_dotdot = (ino_t)0;
inp->i_number = inumber;
inp->i_isize = DIP(dp, di_size);
inp->i_numblks = blks;
- for (i = 0; i < MIN(blks, NDADDR); i++)
+ for (i = 0; i < MIN(blks, UFS_NDADDR); i++)
inp->i_blks[i] = DIP(dp, di_db[i]);
- if (blks > NDADDR)
- for (i = 0; i < NIADDR; i++)
- inp->i_blks[NDADDR + i] = DIP(dp, di_ib[i]);
+ if (blks > UFS_NDADDR)
+ for (i = 0; i < UFS_NIADDR; i++)
+ inp->i_blks[UFS_NDADDR + i] = DIP(dp, di_ib[i]);
if (inplast == listmax) {
listmax += 100;
inpsort = (struct inoinfo **)realloc((char *)inpsort,
@@ -575,7 +575,7 @@ findino(struct inodesc *idesc)
if (dirp->d_ino == 0)
return (KEEPON);
if (strcmp(dirp->d_name, idesc->id_name) == 0 &&
- dirp->d_ino >= ROOTINO && dirp->d_ino <= maxino) {
+ dirp->d_ino >= UFS_ROOTINO && dirp->d_ino <= maxino) {
idesc->id_parent = dirp->d_ino;
return (STOP|FOUND);
}
@@ -604,7 +604,7 @@ pinode(ino_t ino)
time_t t;
printf(" I=%lu ", (u_long)ino);
- if (ino < ROOTINO || ino > maxino)
+ if (ino < UFS_ROOTINO || ino > maxino)
return;
dp = ginode(ino);
printf(" OWNER=");
@@ -662,7 +662,7 @@ allocino(ino_t request, int type)
int cg;
if (request == 0)
- request = ROOTINO;
+ request = UFS_ROOTINO;
else if (inoinfo(request)->ino_state != USTATE)
return (0);
for (ino = request; ino < maxino; ino++)
diff --git a/sbin/fsck_ffs/main.c b/sbin/fsck_ffs/main.c
index 8f0e1db57dbc..af60741973e3 100644
--- a/sbin/fsck_ffs/main.c
+++ b/sbin/fsck_ffs/main.c
@@ -500,7 +500,7 @@ checkfilesys(char *filesys)
*/
n_ffree = sblock.fs_cstotal.cs_nffree;
n_bfree = sblock.fs_cstotal.cs_nbfree;
- files = maxino - ROOTINO - sblock.fs_cstotal.cs_nifree - n_files;
+ files = maxino - UFS_ROOTINO - sblock.fs_cstotal.cs_nifree - n_files;
blks = n_blks +
sblock.fs_ncg * (cgdmin(&sblock, 0) - cgsblock(&sblock, 0));
blks += cgsblock(&sblock, 0) - cgbase(&sblock, 0);
diff --git a/sbin/fsck_ffs/pass1.c b/sbin/fsck_ffs/pass1.c
index 98d2a0552708..7b7910eaeef9 100644
--- a/sbin/fsck_ffs/pass1.c
+++ b/sbin/fsck_ffs/pass1.c
@@ -163,7 +163,7 @@ pass1(void)
* Scan the allocated inodes.
*/
for (i = 0; i < inosused; i++, inumber++) {
- if (inumber < ROOTINO) {
+ if (inumber < UFS_ROOTINO) {
(void)getnextinode(inumber, rebuildcg);
continue;
}
@@ -250,15 +250,15 @@ checkinode(ino_t inumber, struct inodesc *idesc, int rebuildcg)
if (mode == 0) {
if ((sblock.fs_magic == FS_UFS1_MAGIC &&
(memcmp(dp->dp1.di_db, ufs1_zino.di_db,
- NDADDR * sizeof(ufs1_daddr_t)) ||
+ UFS_NDADDR * sizeof(ufs1_daddr_t)) ||
memcmp(dp->dp1.di_ib, ufs1_zino.di_ib,
- NIADDR * sizeof(ufs1_daddr_t)) ||
+ UFS_NIADDR * sizeof(ufs1_daddr_t)) ||
dp->dp1.di_mode || dp->dp1.di_size)) ||
(sblock.fs_magic == FS_UFS2_MAGIC &&
(memcmp(dp->dp2.di_db, ufs2_zino.di_db,
- NDADDR * sizeof(ufs2_daddr_t)) ||
+ UFS_NDADDR * sizeof(ufs2_daddr_t)) ||
memcmp(dp->dp2.di_ib, ufs2_zino.di_ib,
- NIADDR * sizeof(ufs2_daddr_t)) ||
+ UFS_NIADDR * sizeof(ufs2_daddr_t)) ||
dp->dp2.di_mode || dp->dp2.di_size))) {
pfatal("PARTIALLY ALLOCATED INODE I=%lu",
(u_long)inumber);
@@ -324,24 +324,24 @@ checkinode(ino_t inumber, struct inodesc *idesc, int rebuildcg)
else
ndb = howmany(DIP(dp, di_size),
sizeof(ufs2_daddr_t));
- if (ndb > NDADDR) {
- j = ndb - NDADDR;
+ if (ndb > UFS_NDADDR) {
+ j = ndb - UFS_NDADDR;
for (ndb = 1; j > 1; j--)
ndb *= NINDIR(&sblock);
- ndb += NDADDR;
+ ndb += UFS_NDADDR;
}
}
}
- for (j = ndb; ndb < NDADDR && j < NDADDR; j++)
+ for (j = ndb; ndb < UFS_NDADDR && j < UFS_NDADDR; j++)
if (DIP(dp, di_db[j]) != 0) {
if (debug)
printf("bad direct addr[%d]: %ju\n", j,
(uintmax_t)DIP(dp, di_db[j]));
goto unknown;
}
- for (j = 0, ndb -= NDADDR; ndb > 0; j++)
+ for (j = 0, ndb -= UFS_NDADDR; ndb > 0; j++)
ndb /= NINDIR(&sblock);
- for (; j < NIADDR; j++)
+ for (; j < UFS_NIADDR; j++)
if (DIP(dp, di_ib[j]) != 0) {
if (debug)
printf("bad indirect addr: %ju\n",
@@ -376,7 +376,7 @@ checkinode(ino_t inumber, struct inodesc *idesc, int rebuildcg)
if (sblock.fs_magic == FS_UFS2_MAGIC && dp->dp2.di_extsize > 0) {
idesc->id_type = ADDR;
ndb = howmany(dp->dp2.di_extsize, sblock.fs_bsize);
- for (j = 0; j < NXADDR; j++) {
+ for (j = 0; j < UFS_NXADDR; j++) {
if (--ndb == 0 &&
(offset = blkoff(&sblock, dp->dp2.di_extsize)) != 0)
idesc->id_numfrags = numfrags(&sblock,
diff --git a/sbin/fsck_ffs/pass1b.c b/sbin/fsck_ffs/pass1b.c
index 52f74792c049..c81df176f15d 100644
--- a/sbin/fsck_ffs/pass1b.c
+++ b/sbin/fsck_ffs/pass1b.c
@@ -73,7 +73,7 @@ pass1b(void)
got_sigalarm = 0;
}
for (i = 0; i < sblock.fs_ipg; i++, inumber++) {
- if (inumber < ROOTINO)
+ if (inumber < UFS_ROOTINO)
continue;
dp = ginode(inumber);
if (dp == NULL)
diff --git a/sbin/fsck_ffs/pass2.c b/sbin/fsck_ffs/pass2.c
index 36a41ac960cc..b32a046f395a 100644
--- a/sbin/fsck_ffs/pass2.c
+++ b/sbin/fsck_ffs/pass2.c
@@ -67,7 +67,7 @@ pass2(void)
int i;
char pathbuf[MAXPATHLEN + 1];
- switch (inoinfo(ROOTINO)->ino_state) {
+ switch (inoinfo(UFS_ROOTINO)->ino_state) {
case USTATE:
pfatal("ROOT INODE UNALLOCATED");
@@ -75,15 +75,16 @@ pass2(void)
ckfini(0);
exit(EEXIT);
}
- if (allocdir(ROOTINO, ROOTINO, 0755) != ROOTINO)
+ if (allocdir(UFS_ROOTINO, UFS_ROOTINO, 0755) != UFS_ROOTINO)
errx(EEXIT, "CANNOT ALLOCATE ROOT INODE");
break;
case DCLEAR:
pfatal("DUPS/BAD IN ROOT INODE");
if (reply("REALLOCATE")) {
- freeino(ROOTINO);
- if (allocdir(ROOTINO, ROOTINO, 0755) != ROOTINO)
+ freeino(UFS_ROOTINO);
+ if (allocdir(UFS_ROOTINO, UFS_ROOTINO, 0755) !=
+ UFS_ROOTINO)
errx(EEXIT, "CANNOT ALLOCATE ROOT INODE");
break;
}
@@ -98,8 +99,9 @@ pass2(void)
case FZLINK:
pfatal("ROOT INODE NOT DIRECTORY");
if (reply("REALLOCATE")) {
- freeino(ROOTINO);
- if (allocdir(ROOTINO, ROOTINO, 0755) != ROOTINO)
+ freeino(UFS_ROOTINO);
+ if (allocdir(UFS_ROOTINO, UFS_ROOTINO, 0755) !=
+ UFS_ROOTINO)
errx(EEXIT, "CANNOT ALLOCATE ROOT INODE");
break;
}
@@ -107,7 +109,7 @@ pass2(void)
ckfini(0);
exit(EEXIT);
}
- dp = ginode(ROOTINO);
+ dp = ginode(UFS_ROOTINO);
DIP_SET(dp, di_mode, DIP(dp, di_mode) & ~IFMT);
DIP_SET(dp, di_mode, DIP(dp, di_mode) | IFDIR);
inodirty();
@@ -119,11 +121,11 @@ pass2(void)
default:
errx(EEXIT, "BAD STATE %d FOR ROOT INODE",
- inoinfo(ROOTINO)->ino_state);
+ inoinfo(UFS_ROOTINO)->ino_state);
}
- inoinfo(ROOTINO)->ino_state = DFOUND;
- inoinfo(WINO)->ino_state = FSTATE;
- inoinfo(WINO)->ino_type = DT_WHT;
+ inoinfo(UFS_ROOTINO)->ino_state = DFOUND;
+ inoinfo(UFS_WINO)->ino_state = FSTATE;
+ inoinfo(UFS_WINO)->ino_type = DT_WHT;
/*
* Sort the directory list into disk block order.
*/
@@ -182,11 +184,12 @@ pass2(void)
memset(dp, 0, sizeof(struct ufs2_dinode));
DIP_SET(dp, di_mode, IFDIR);
DIP_SET(dp, di_size, inp->i_isize);
- for (i = 0; i < MIN(inp->i_numblks, NDADDR); i++)
+ for (i = 0; i < MIN(inp->i_numblks, UFS_NDADDR); i++)
DIP_SET(dp, di_db[i], inp->i_blks[i]);
- if (inp->i_numblks > NDADDR)
- for (i = 0; i < NIADDR; i++)
- DIP_SET(dp, di_ib[i], inp->i_blks[NDADDR + i]);
+ if (inp->i_numblks > UFS_NDADDR)
+ for (i = 0; i < UFS_NIADDR; i++)
+ DIP_SET(dp, di_ib[i],
+ inp->i_blks[UFS_NDADDR + i]);
curino.id_number = inp->i_number;
curino.id_parent = inp->i_parent;
(void)ckinode(dp, &curino);
@@ -411,10 +414,10 @@ chk2:
if (dirp->d_ino > maxino) {
fileerror(idesc->id_number, dirp->d_ino, "I OUT OF RANGE");
n = reply("REMOVE");
- } else if (((dirp->d_ino == WINO && dirp->d_type != DT_WHT) ||
- (dirp->d_ino != WINO && dirp->d_type == DT_WHT))) {
+ } else if (((dirp->d_ino == UFS_WINO && dirp->d_type != DT_WHT) ||
+ (dirp->d_ino != UFS_WINO && dirp->d_type == DT_WHT))) {
fileerror(idesc->id_number, dirp->d_ino, "BAD WHITEOUT ENTRY");
- dirp->d_ino = WINO;
+ dirp->d_ino = UFS_WINO;
dirp->d_type = DT_WHT;
if (reply("FIX") == 1)
ret |= ALTERED;
diff --git a/sbin/fsck_ffs/pass3.c b/sbin/fsck_ffs/pass3.c
index ec4813c344a3..6a5a43cf4cfc 100644
--- a/sbin/fsck_ffs/pass3.c
+++ b/sbin/fsck_ffs/pass3.c
@@ -68,7 +68,7 @@ pass3(void)
}
inp = inpsort[inpindex];
state = inoinfo(inp->i_number)->ino_state;
- if (inp->i_number == ROOTINO ||
+ if (inp->i_number == UFS_ROOTINO ||
(inp->i_parent != 0 && !S_IS_DUNFOUND(state)))
continue;
if (state == DCLEAR)
@@ -81,7 +81,7 @@ pass3(void)
*/
if ((preen || bkgrdflag) &&
resolved && usedsoftdep && S_IS_DUNFOUND(state)) {
- if (inp->i_dotdot >= ROOTINO)
+ if (inp->i_dotdot >= UFS_ROOTINO)
inoinfo(inp->i_dotdot)->ino_linkcnt++;
continue;
}
diff --git a/sbin/fsck_ffs/pass4.c b/sbin/fsck_ffs/pass4.c
index 3b64dfbaf537..600e3eb8b94e 100644
--- a/sbin/fsck_ffs/pass4.c
+++ b/sbin/fsck_ffs/pass4.c
@@ -71,7 +71,7 @@ pass4(void)
}
inumber = cg * sblock.fs_ipg;
for (i = 0; i < inostathead[cg].il_numalloced; i++, inumber++) {
- if (inumber < ROOTINO)
+ if (inumber < UFS_ROOTINO)
continue;
idesc.id_number = inumber;
switch (inoinfo(inumber)->ino_state) {
diff --git a/sbin/fsck_ffs/pass5.c b/sbin/fsck_ffs/pass5.c
index 67ad68a71ef0..12ebb38f43b6 100644
--- a/sbin/fsck_ffs/pass5.c
+++ b/sbin/fsck_ffs/pass5.c
@@ -68,7 +68,7 @@ pass5(void)
struct cg *cg, *newcg = (struct cg *)buf;
struct bufarea *cgbp;
- inoinfo(WINO)->ino_state = USTATE;
+ inoinfo(UFS_WINO)->ino_state = USTATE;
memset(newcg, 0, (size_t)fs->fs_cgsize);
newcg->cg_niblk = fs->fs_ipg;
if (cvtlevel >= 3) {
@@ -234,14 +234,14 @@ pass5(void)
break;
default:
- if (j < (int)ROOTINO)
+ if (j < (int)UFS_ROOTINO)
break;
errx(EEXIT, "BAD STATE %d FOR INODE I=%d",
inoinfo(j)->ino_state, j);
}
}
if (c == 0)
- for (i = 0; i < (int)ROOTINO; i++) {
+ for (i = 0; i < (int)UFS_ROOTINO; i++) {
setbit(cg_inosused(newcg), i);
newcg->cg_cs.cs_nifree--;
}
diff --git a/sbin/fsck_ffs/suj.c b/sbin/fsck_ffs/suj.c
index 3ab14d178a1c..f0c6524e3ff1 100644
--- a/sbin/fsck_ffs/suj.c
+++ b/sbin/fsck_ffs/suj.c
@@ -758,7 +758,7 @@ ino_blkatoff(union dinode *ip, ino_t ino, ufs_lbn_t lbn, int *frags)
/*
* Handle extattr blocks first.
*/
- if (lbn < 0 && lbn >= -NXADDR) {
+ if (lbn < 0 && lbn >= -UFS_NXADDR) {
lbn = -1 - lbn;
if (lbn > lblkno(fs, ip->dp2.di_extsize - 1))
return (0);
@@ -771,13 +771,13 @@ ino_blkatoff(union dinode *ip, ino_t ino, ufs_lbn_t lbn, int *frags)
if (DIP(ip, di_mode) == IFLNK &&
DIP(ip, di_size) < fs->fs_maxsymlinklen)
return (0);
- if (lbn >= 0 && lbn < NDADDR) {
+ if (lbn >= 0 && lbn < UFS_NDADDR) {
*frags = numfrags(fs, sblksize(fs, DIP(ip, di_size), lbn));
return (DIP(ip, di_db[lbn]));
}
*frags = fs->fs_frag;
- for (i = 0, tmpval = NINDIR(fs), cur = NDADDR; i < NIADDR; i++,
+ for (i = 0, tmpval = NINDIR(fs), cur = UFS_NDADDR; i < UFS_NIADDR; i++,
tmpval *= NINDIR(fs), cur = next) {
next = cur + tmpval;
if (lbn == -cur - i)
@@ -1037,7 +1037,7 @@ ino_visit(union dinode *ip, ino_t ino, ino_visitor visitor, int flags)
fragcnt = 0;
if ((flags & VISIT_EXT) &&
fs->fs_magic == FS_UFS2_MAGIC && ip->dp2.di_extsize) {
- for (i = 0; i < NXADDR; i++) {
+ for (i = 0; i < UFS_NXADDR; i++) {
if (ip->dp2.di_extb[i] == 0)
continue;
frags = sblksize(fs, ip->dp2.di_extsize, i);
@@ -1050,7 +1050,7 @@ ino_visit(union dinode *ip, ino_t ino, ino_visitor visitor, int flags)
if (mode == IFBLK || mode == IFCHR ||
(mode == IFLNK && size < fs->fs_maxsymlinklen))
return (fragcnt);
- for (i = 0; i < NDADDR; i++) {
+ for (i = 0; i < UFS_NDADDR; i++) {
if (DIP(ip, di_db[i]) == 0)
continue;
frags = sblksize(fs, size, i);
@@ -1063,7 +1063,7 @@ ino_visit(union dinode *ip, ino_t ino, ino_visitor visitor, int flags)
* real pointers to them.
*/
flags |= VISIT_ROOT;
- for (i = 0, tmpval = NINDIR(fs), lbn = NDADDR; i < NIADDR; i++,
+ for (i = 0, tmpval = NINDIR(fs), lbn = UFS_NDADDR; i < UFS_NIADDR; i++,
lbn = nextlbn) {
nextlbn = lbn + tmpval;
tmpval *= NINDIR(fs);
@@ -1123,7 +1123,7 @@ ino_adjblks(struct suj_ino *sino)
* to the size in the inode or the maximum size permitted by
* populated indirects.
*/
- if (visitlbn >= NDADDR) {
+ if (visitlbn >= UFS_NDADDR) {
isize = DIP(ip, di_size);
size = lblktosize(fs, visitlbn + 1);
if (isize > size)
@@ -1161,7 +1161,7 @@ blk_free_lbn(ufs2_daddr_t blk, ino_t ino, ufs_lbn_t lbn, int frags, int follow)
mask = blk_freemask(blk, ino, lbn, frags);
resid = 0;
- if (lbn <= -NDADDR && follow && mask == 0)
+ if (lbn <= -UFS_NDADDR && follow && mask == 0)
indir_visit(ino, lbn, blk, &resid, blk_free_visit, VISIT_INDIR);
else
blk_free(blk, mask, frags);
@@ -1253,7 +1253,7 @@ ino_free_children(ino_t ino, ufs_lbn_t lbn, ufs2_daddr_t blk, int frags)
dp = (struct direct *)&block[0];
for (dpoff = 0; dpoff < size && dp->d_reclen; dpoff += dp->d_reclen) {
dp = (struct direct *)&block[dpoff];
- if (dp->d_ino == 0 || dp->d_ino == WINO)
+ if (dp->d_ino == 0 || dp->d_ino == UFS_WINO)
continue;
if (dp->d_namlen == 1 && dp->d_name[0] == '.')
continue;
@@ -1278,8 +1278,8 @@ ino_reclaim(union dinode *ip, ino_t ino, int mode)
{
uint32_t gen;
- if (ino == ROOTINO)
- err_suj("Attempting to free ROOTINO\n");
+ if (ino == UFS_ROOTINO)
+ err_suj("Attempting to free UFS_ROOTINO\n");
if (debug)
printf("Truncating and freeing ino %ju, nlink %d, mode %o\n",
(uintmax_t)ino, DIP(ip, di_nlink), DIP(ip, di_mode));
@@ -1540,7 +1540,7 @@ ino_trunc(ino_t ino, off_t size)
if (size > cursize)
size = cursize;
lastlbn = lblkno(fs, blkroundup(fs, size));
- for (i = lastlbn; i < NDADDR; i++) {
+ for (i = lastlbn; i < UFS_NDADDR; i++) {
if (DIP(ip, di_db[i]) == 0)
continue;
frags = sblksize(fs, cursize, i);
@@ -1551,7 +1551,7 @@ ino_trunc(ino_t ino, off_t size)
/*
* Follow indirect blocks, freeing anything required.
*/
- for (i = 0, tmpval = NINDIR(fs), lbn = NDADDR; i < NIADDR; i++,
+ for (i = 0, tmpval = NINDIR(fs), lbn = UFS_NDADDR; i < UFS_NIADDR; i++,
lbn = nextlbn) {
nextlbn = lbn + tmpval;
tmpval *= NINDIR(fs);
@@ -1583,7 +1583,7 @@ ino_trunc(ino_t ino, off_t size)
* If we're truncating direct blocks we have to adjust frags
* accordingly.
*/
- if (visitlbn < NDADDR && totalfrags) {
+ if (visitlbn < UFS_NDADDR && totalfrags) {
long oldspace, newspace;
bn = DIP(ip, di_db[visitlbn]);
@@ -2655,7 +2655,8 @@ suj_find(ino_t ino, ufs_lbn_t lbn, ufs2_daddr_t blk, int frags)
return;
bytes = lfragtosize(fs, frags);
if (bread(disk, fsbtodb(fs, blk), block, bytes) <= 0)
- err_suj("Failed to read ROOTINO directory block %jd\n", blk);
+ err_suj("Failed to read UFS_ROOTINO directory block %jd\n",
+ blk);
for (off = 0; off < bytes; off += dp->d_reclen) {
dp = (struct direct *)&block[off];
if (dp->d_reclen == 0)
@@ -2708,9 +2709,9 @@ suj_check(const char *filesys)
/*
* Find the journal inode.
*/
- ip = ino_read(ROOTINO);
+ ip = ino_read(UFS_ROOTINO);
sujino = 0;
- ino_visit(ip, ROOTINO, suj_find, 0);
+ ino_visit(ip, UFS_ROOTINO, suj_find, 0);
if (sujino == 0) {
printf("Journal inode removed. Use tunefs to re-create.\n");
sblock.fs_flags &= ~FS_SUJ;
diff --git a/sbin/fsdb/fsdb.c b/sbin/fsdb/fsdb.c
index b35a06775452..4a612ec7cd2e 100644
--- a/sbin/fsdb/fsdb.c
+++ b/sbin/fsdb/fsdb.c
@@ -231,8 +231,8 @@ cmdloop(void)
EditLine *elptr;
HistEvent he;
- curinode = ginode(ROOTINO);
- curinum = ROOTINO;
+ curinode = ginode(UFS_ROOTINO);
+ curinum = UFS_ROOTINO;
printactive(0);
hist = history_init();
@@ -299,11 +299,11 @@ union dinode *curinode;
ino_t curinum, ocurrent;
#define GETINUM(ac,inum) inum = strtoul(argv[ac], &cp, 0); \
- if (inum < ROOTINO || inum > maxino || cp == argv[ac] || *cp != '\0' ) { \
+if (inum < UFS_ROOTINO || inum > maxino || cp == argv[ac] || *cp != '\0' ) { \
printf("inode %ju out of range; range is [%ju,%ju]\n", \
- (uintmax_t)inum, (uintmax_t)ROOTINO, (uintmax_t)maxino); \
+ (uintmax_t)inum, (uintmax_t)UFS_ROOTINO, (uintmax_t)maxino);\
return 1; \
- }
+}
/*
* Focus on given inode number
@@ -486,8 +486,8 @@ CMDFUNCSTART(findblk)
inosused = sblock.fs_ipg;
for (; inosused > 0; inum++, inosused--) {
- /* Skip magic inodes: 0, WINO, ROOTINO. */
- if (inum < ROOTINO)
+ /* Skip magic inodes: 0, UFS_WINO, UFS_ROOTINO. */
+ if (inum < UFS_ROOTINO)
continue;
/*
* Check if the block we are looking for is just an inode block.
@@ -531,10 +531,10 @@ CMDFUNCSTART(findblk)
}
/* Look through direct data blocks. */
if (is_ufs2 ?
- find_blks64(curinode->dp2.di_db, NDADDR, wantedblk64) :
- find_blks32(curinode->dp1.di_db, NDADDR, wantedblk32))
+ find_blks64(curinode->dp2.di_db, UFS_NDADDR, wantedblk64) :
+ find_blks32(curinode->dp1.di_db, UFS_NDADDR, wantedblk32))
goto end;
- for (i = 0; i < NIADDR; i++) {
+ for (i = 0; i < UFS_NIADDR; i++) {
/*
* Does the block we are looking for belongs to the
* indirect blocks?
@@ -726,8 +726,8 @@ CMDFUNCSTART(focusname)
ocurrent = curinum;
if (argv[1][0] == '/') {
- curinum = ROOTINO;
- curinode = ginode(ROOTINO);
+ curinum = UFS_ROOTINO;
+ curinode = ginode(UFS_ROOTINO);
} else {
if (!checkactivedir())
return 1;
diff --git a/sbin/fsdb/fsdbutil.c b/sbin/fsdb/fsdbutil.c
index 265a0965cbcf..b3f3f7c0e3c8 100644
--- a/sbin/fsdb/fsdbutil.c
+++ b/sbin/fsdb/fsdbutil.c
@@ -292,13 +292,13 @@ printblocks(ino_t inum, union dinode *dp)
printf("Blocks for inode %ju:\n", (uintmax_t)inum);
printf("Direct blocks:\n");
ndb = howmany(DIP(dp, di_size), sblock.fs_bsize);
- for (i = 0; i < NDADDR && i < ndb; i++) {
+ for (i = 0; i < UFS_NDADDR && i < ndb; i++) {
if (i > 0)
printf(", ");
blkno = DIP(dp, di_db[i]);
printf("%jd", (intmax_t)blkno);
}
- if (ndb <= NDADDR) {
+ if (ndb <= UFS_NDADDR) {
offset = blkoff(&sblock, DIP(dp, di_size));
if (offset != 0) {
nfrags = numfrags(&sblock, fragroundup(&sblock, offset));
@@ -306,14 +306,14 @@ printblocks(ino_t inum, union dinode *dp)
}
}
putchar('\n');
- if (ndb <= NDADDR)
+ if (ndb <= UFS_NDADDR)
return;
bufp = malloc((unsigned int)sblock.fs_bsize);
if (bufp == NULL)
errx(EEXIT, "cannot allocate indirect block buffer");
printf("Indirect blocks:\n");
- for (i = 0; i < NIADDR; i++)
+ for (i = 0; i < UFS_NIADDR; i++)
printindir(DIP(dp, di_ib[i]), i, bufp);
free(bufp);
}
diff --git a/sbin/fsirand/fsirand.c b/sbin/fsirand/fsirand.c
index 0fea239c893f..dc9f03a8a727 100644
--- a/sbin/fsirand/fsirand.c
+++ b/sbin/fsirand/fsirand.c
@@ -261,7 +261,7 @@ fsirand(char *device)
dp1 = &((struct ufs1_dinode *)inodebuf)[n];
else
dp2 = &((struct ufs2_dinode *)inodebuf)[n];
- if (inumber >= ROOTINO) {
+ if (inumber >= UFS_ROOTINO) {
if (printonly)
(void)printf("ino %ju gen %08x\n",
(uintmax_t)inumber,
diff --git a/sbin/growfs/debug.c b/sbin/growfs/debug.c
index d3710133c013..9a320ecd89ee 100644
--- a/sbin/growfs/debug.c
+++ b/sbin/growfs/debug.c
@@ -694,11 +694,11 @@ dbg_dump_ufs1_ino(struct fs *sb, const char *comment, struct ufs1_dinode *ino)
ino->di_ctimensec);
remaining_blocks = howmany(ino->di_size, sb->fs_bsize); /* XXX ts - +1? */
- for (ictr = 0; ictr < MIN(NDADDR, remaining_blocks); ictr++) {
+ for (ictr = 0; ictr < MIN(UFS_NDADDR, remaining_blocks); ictr++) {
fprintf(dbg_log, "db ufs_daddr_t[%x] 0x%08x\n", ictr,
ino->di_db[ictr]);
}
- remaining_blocks -= NDADDR;
+ remaining_blocks -= UFS_NDADDR;
if (remaining_blocks > 0) {
fprintf(dbg_log, "ib ufs_daddr_t[0] 0x%08x\n",
ino->di_ib[0]);
@@ -768,14 +768,14 @@ dbg_dump_ufs2_ino(struct fs *sb, const char *comment, struct ufs2_dinode *ino)
fprintf(dbg_log, "flags u_int32_t 0x%08x\n", ino->di_flags);
fprintf(dbg_log, "extsize u_int32_t 0x%08x\n", ino->di_extsize);
- /* XXX: What do we do with di_extb[NXADDR]? */
+ /* XXX: What do we do with di_extb[UFS_NXADDR]? */
remaining_blocks = howmany(ino->di_size, sb->fs_bsize); /* XXX ts - +1? */
- for (ictr = 0; ictr < MIN(NDADDR, remaining_blocks); ictr++) {
+ for (ictr = 0; ictr < MIN(UFS_NDADDR, remaining_blocks); ictr++) {
fprintf(dbg_log, "db ufs2_daddr_t[%x] 0x%16jx\n", ictr,
ino->di_db[ictr]);
}
- remaining_blocks -= NDADDR;
+ remaining_blocks -= UFS_NDADDR;
if (remaining_blocks > 0) {
fprintf(dbg_log, "ib ufs2_daddr_t[0] 0x%16jx\n",
ino->di_ib[0]);
diff --git a/sbin/growfs/growfs.c b/sbin/growfs/growfs.c
index a212d13d3521..0aa4d4586e6f 100644
--- a/sbin/growfs/growfs.c
+++ b/sbin/growfs/growfs.c
@@ -388,7 +388,7 @@ initcg(int cylno, time_t modtime, int fso, unsigned int Nflag)
}
acg.cg_cs.cs_nifree += sblock.fs_ipg;
if (cylno == 0)
- for (ino = 0; ino < ROOTINO; ino++) {
+ for (ino = 0; ino < UFS_ROOTINO; ino++) {
setbit(cg_inosused(&acg), ino);
acg.cg_cs.cs_nifree--;
}
diff --git a/sbin/newfs/mkfs.c b/sbin/newfs/mkfs.c
index b73697849935..fb58a57d0aa8 100644
--- a/sbin/newfs/mkfs.c
+++ b/sbin/newfs/mkfs.c
@@ -273,7 +273,7 @@ restart:
sblock.fs_sblockloc = SBLOCK_UFS1;
sblock.fs_nindir = sblock.fs_bsize / sizeof(ufs1_daddr_t);
sblock.fs_inopb = sblock.fs_bsize / sizeof(struct ufs1_dinode);
- sblock.fs_maxsymlinklen = ((NDADDR + NIADDR) *
+ sblock.fs_maxsymlinklen = ((UFS_NDADDR + UFS_NIADDR) *
sizeof(ufs1_daddr_t));
sblock.fs_old_inodefmt = FS_44INODEFMT;
sblock.fs_old_cgoffset = 0;
@@ -292,7 +292,7 @@ restart:
sblock.fs_sblockloc = SBLOCK_UFS2;
sblock.fs_nindir = sblock.fs_bsize / sizeof(ufs2_daddr_t);
sblock.fs_inopb = sblock.fs_bsize / sizeof(struct ufs2_dinode);
- sblock.fs_maxsymlinklen = ((NDADDR + NIADDR) *
+ sblock.fs_maxsymlinklen = ((UFS_NDADDR + UFS_NIADDR) *
sizeof(ufs2_daddr_t));
}
sblock.fs_sblkno =
@@ -301,8 +301,8 @@ restart:
sblock.fs_cblkno = sblock.fs_sblkno +
roundup(howmany(SBLOCKSIZE, sblock.fs_fsize), sblock.fs_frag);
sblock.fs_iblkno = sblock.fs_cblkno + sblock.fs_frag;
- sblock.fs_maxfilesize = sblock.fs_bsize * NDADDR - 1;
- for (sizepb = sblock.fs_bsize, i = 0; i < NIADDR; i++) {
+ sblock.fs_maxfilesize = sblock.fs_bsize * UFS_NDADDR - 1;
+ for (sizepb = sblock.fs_bsize, i = 0; i < UFS_NIADDR; i++) {
sizepb *= NINDIR(&sblock);
sblock.fs_maxfilesize += sizepb;
}
@@ -473,7 +473,8 @@ restart:
fragnum(&sblock, sblock.fs_size) +
(fragnum(&sblock, csfrags) > 0 ?
sblock.fs_frag - fragnum(&sblock, csfrags) : 0);
- sblock.fs_cstotal.cs_nifree = sblock.fs_ncg * sblock.fs_ipg - ROOTINO;
+ sblock.fs_cstotal.cs_nifree =
+ sblock.fs_ncg * sblock.fs_ipg - UFS_ROOTINO;
sblock.fs_cstotal.cs_ndir = 0;
sblock.fs_dsize -= csfrags;
sblock.fs_time = utime;
@@ -696,7 +697,7 @@ initcg(int cylno, time_t utime)
}
acg.cg_cs.cs_nifree += sblock.fs_ipg;
if (cylno == 0)
- for (i = 0; i < (long)ROOTINO; i++) {
+ for (i = 0; i < (long)UFS_ROOTINO; i++) {
setbit(cg_inosused(&acg), i);
acg.cg_cs.cs_nifree--;
}
@@ -808,16 +809,16 @@ initcg(int cylno, time_t utime)
#define ROOTLINKCNT 3
static struct direct root_dir[] = {
- { ROOTINO, sizeof(struct direct), DT_DIR, 1, "." },
- { ROOTINO, sizeof(struct direct), DT_DIR, 2, ".." },
- { ROOTINO + 1, sizeof(struct direct), DT_DIR, 5, ".snap" },
+ { UFS_ROOTINO, sizeof(struct direct), DT_DIR, 1, "." },
+ { UFS_ROOTINO, sizeof(struct direct), DT_DIR, 2, ".." },
+ { UFS_ROOTINO + 1, sizeof(struct direct), DT_DIR, 5, ".snap" },
};
#define SNAPLINKCNT 2
static struct direct snap_dir[] = {
- { ROOTINO + 1, sizeof(struct direct), DT_DIR, 1, "." },
- { ROOTINO, sizeof(struct direct), DT_DIR, 2, ".." },
+ { UFS_ROOTINO + 1, sizeof(struct direct), DT_DIR, 1, "." },
+ { UFS_ROOTINO, sizeof(struct direct), DT_DIR, 2, ".." },
};
void
@@ -854,7 +855,7 @@ fsinit(time_t utime)
btodb(fragroundup(&sblock, node.dp1.di_size));
wtfs(fsbtodb(&sblock, node.dp1.di_db[0]), sblock.fs_fsize,
iobuf);
- iput(&node, ROOTINO);
+ iput(&node, UFS_ROOTINO);
if (!nflag) {
/*
* create the .snap directory
@@ -869,7 +870,7 @@ fsinit(time_t utime)
btodb(fragroundup(&sblock, node.dp1.di_size));
wtfs(fsbtodb(&sblock, node.dp1.di_db[0]),
sblock.fs_fsize, iobuf);
- iput(&node, ROOTINO + 1);
+ iput(&node, UFS_ROOTINO + 1);
}
} else {
/*
@@ -890,7 +891,7 @@ fsinit(time_t utime)
btodb(fragroundup(&sblock, node.dp2.di_size));
wtfs(fsbtodb(&sblock, node.dp2.di_db[0]), sblock.fs_fsize,
iobuf);
- iput(&node, ROOTINO);
+ iput(&node, UFS_ROOTINO);
if (!nflag) {
/*
* create the .snap directory
@@ -905,7 +906,7 @@ fsinit(time_t utime)
btodb(fragroundup(&sblock, node.dp2.di_size));
wtfs(fsbtodb(&sblock, node.dp2.di_db[0]),
sblock.fs_fsize, iobuf);
- iput(&node, ROOTINO + 1);
+ iput(&node, UFS_ROOTINO + 1);
}
}
}
diff --git a/sbin/newfs_nandfs/newfs_nandfs.c b/sbin/newfs_nandfs/newfs_nandfs.c
index c9e092744d55..2464fcdb9384 100644
--- a/sbin/newfs_nandfs/newfs_nandfs.c
+++ b/sbin/newfs_nandfs/newfs_nandfs.c
@@ -314,8 +314,8 @@ count_su_blocks(void)
}
debug("bad segment needs %#jx", blk);
- if (blk >= NDADDR) {
- printf("nandfs: file too big (%jd > %d)\n", blk, NDADDR);
+ if (blk >= NANDFS_NDADDR) {
+ printf("nandfs: file too big (%jd > %d)\n", blk, NANDFS_NDADDR);
exit(2);
}
diff --git a/sbin/quotacheck/quotacheck.c b/sbin/quotacheck/quotacheck.c
index 0ee5b092887e..bceeca15e241 100644
--- a/sbin/quotacheck/quotacheck.c
+++ b/sbin/quotacheck/quotacheck.c
@@ -371,7 +371,8 @@ chkquota(char *specname, struct quotafile *qfu, struct quotafile *qfg)
continue;
}
for (i = 0; i < inosused; i++, ino++) {
- if ((dp = getnextinode(ino)) == NULL || ino < ROOTINO ||
+ if ((dp = getnextinode(ino)) == NULL ||
+ ino < UFS_ROOTINO ||
(mode = DIP(dp, di_mode) & IFMT) == 0)
continue;
/*
diff --git a/sbin/restore/dirs.c b/sbin/restore/dirs.c
index 0c6f38c972b6..35191fa614fc 100644
--- a/sbin/restore/dirs.c
+++ b/sbin/restore/dirs.c
@@ -272,7 +272,7 @@ treescan(char *pname, ino_t ino, long (*todo)(char *, ino_t, int))
}
/*
- * Lookup a pathname which is always assumed to start from the ROOTINO.
+ * Lookup a pathname which is always assumed to start from the UFS_ROOTINO.
*/
struct direct *
pathsearch(const char *pathname)
@@ -283,7 +283,7 @@ pathsearch(const char *pathname)
strcpy(buffer, pathname);
path = buffer;
- ino = ROOTINO;
+ ino = UFS_ROOTINO;
while (*path == '/')
path++;
dp = NULL;
@@ -632,7 +632,7 @@ setdirmodes(int flags)
ep->e_flags &= ~NEW;
continue;
}
- if (node.ino == ROOTINO &&
+ if (node.ino == UFS_ROOTINO &&
reply("set owner/mode for '.'") == FAIL)
continue;
}
diff --git a/sbin/restore/interactive.c b/sbin/restore/interactive.c
index 6f4c02e403a0..2305e1f3bc9a 100644
--- a/sbin/restore/interactive.c
+++ b/sbin/restore/interactive.c
@@ -505,7 +505,7 @@ printlist(char *name, char *basename)
dp = pathsearch(name);
if (dp == NULL || (!dflag && TSTINO(dp->d_ino, dumpmap) == 0) ||
- (!vflag && dp->d_ino == WINO))
+ (!vflag && dp->d_ino == UFS_WINO))
return;
if ((dirp = rst_opendir(name)) == NULL) {
entries = 1;
@@ -540,7 +540,7 @@ printlist(char *name, char *basename)
break;
if (!dflag && TSTINO(dp->d_ino, dumpmap) == 0)
continue;
- if (!vflag && (dp->d_ino == WINO ||
+ if (!vflag && (dp->d_ino == UFS_WINO ||
strcmp(dp->d_name, ".") == 0 ||
strcmp(dp->d_name, "..") == 0))
continue;
@@ -644,7 +644,7 @@ formatf(struct afile *list, int nentry)
width = 0;
haveprefix = 0;
havepostfix = 0;
- bigino = ROOTINO;
+ bigino = UFS_ROOTINO;
endlist = &list[nentry];
for (fp = &list[0]; fp < endlist; fp++) {
if (bigino < fp->fnum)
@@ -713,7 +713,7 @@ glob_readdir(void *dirp)
static struct dirent adirent;
while ((dp = rst_readdir(dirp)) != NULL) {
- if (!vflag && dp->d_ino == WINO)
+ if (!vflag && dp->d_ino == UFS_WINO)
continue;
if (dflag || TSTINO(dp->d_ino, dumpmap))
break;
@@ -736,7 +736,7 @@ glob_stat(const char *name, struct stat *stp)
dp = pathsearch(name);
if (dp == NULL || (!dflag && TSTINO(dp->d_ino, dumpmap) == 0) ||
- (!vflag && dp->d_ino == WINO))
+ (!vflag && dp->d_ino == UFS_WINO))
return (-1);
if (inodetype(dp->d_ino) == NODE)
stp->st_mode = IFDIR;
diff --git a/sbin/restore/main.c b/sbin/restore/main.c
index d74e59ebeef1..ec6ad0ba9a5f 100644
--- a/sbin/restore/main.c
+++ b/sbin/restore/main.c
@@ -212,7 +212,7 @@ main(int argc, char *argv[])
extractdirs(1);
removeoldleaves();
vprintf(stdout, "Calculate node updates.\n");
- treescan(".", ROOTINO, nodeupdates);
+ treescan(".", UFS_ROOTINO, nodeupdates);
findunreflinks();
removeoldnodes();
} else {
@@ -223,7 +223,7 @@ main(int argc, char *argv[])
initsymtable((char *)0);
extractdirs(1);
vprintf(stdout, "Calculate extraction list.\n");
- treescan(".", ROOTINO, nodeupdates);
+ treescan(".", UFS_ROOTINO, nodeupdates);
}
createleaves(symtbl);
createlinks();
@@ -231,7 +231,7 @@ main(int argc, char *argv[])
checkrestore();
if (dflag) {
vprintf(stdout, "Verify the directory structure\n");
- treescan(".", ROOTINO, verifyfile);
+ treescan(".", UFS_ROOTINO, verifyfile);
}
dumpsymtable(symtbl, (long)1);
break;
diff --git a/sbin/restore/restore.c b/sbin/restore/restore.c
index fbc24ece7c49..107fe28f5694 100644
--- a/sbin/restore/restore.c
+++ b/sbin/restore/restore.c
@@ -81,7 +81,7 @@ addfile(char *name, ino_t ino, int type)
dprintf(stdout, "%s: not on the tape\n", name);
return (descend);
}
- if (ino == WINO && command == 'i' && !vflag)
+ if (ino == UFS_WINO && command == 'i' && !vflag)
return (descend);
if (!mflag) {
(void) sprintf(buf, "./%ju", (uintmax_t)ino);
@@ -156,7 +156,7 @@ removeoldleaves(void)
ino_t i, mydirino;
vprintf(stdout, "Mark entries to be removed.\n");
- if ((ep = lookupino(WINO))) {
+ if ((ep = lookupino(UFS_WINO))) {
vprintf(stdout, "Delete whiteouts\n");
for ( ; ep != NULL; ep = nextep) {
nextep = ep->e_links;
@@ -172,7 +172,7 @@ removeoldleaves(void)
freeentry(ep);
}
}
- for (i = ROOTINO + 1; i < maxino; i++) {
+ for (i = UFS_ROOTINO + 1; i < maxino; i++) {
ep = lookupino(i);
if (ep == NULL)
continue;
@@ -516,7 +516,7 @@ findunreflinks(void)
ino_t i;
vprintf(stdout, "Find unreferenced names.\n");
- for (i = ROOTINO; i < maxino; i++) {
+ for (i = UFS_ROOTINO; i < maxino; i++) {
ep = lookupino(i);
if (ep == NULL || ep->e_type == LEAF || TSTINO(i, dumpmap) == 0)
continue;
@@ -599,7 +599,7 @@ createleaves(char *symtabfile)
vprintf(stdout, "Extract new leaves.\n");
dumpsymtable(symtabfile, volno);
}
- first = lowerbnd(ROOTINO);
+ first = lowerbnd(UFS_ROOTINO);
curvol = volno;
while (curfile.ino < maxino) {
first = lowerbnd(first);
@@ -677,7 +677,7 @@ createfiles(void)
getvol((long)1);
skipmaps();
skipdirs();
- first = lowerbnd(ROOTINO);
+ first = lowerbnd(UFS_ROOTINO);
last = upperbnd(maxino - 1);
for (;;) {
curvol = volno;
@@ -780,7 +780,7 @@ createlinks(void)
ino_t i;
char name[BUFSIZ];
- if ((ep = lookupino(WINO))) {
+ if ((ep = lookupino(UFS_WINO))) {
vprintf(stdout, "Add whiteouts\n");
for ( ; ep != NULL; ep = ep->e_links) {
if ((ep->e_flags & NEW) == 0)
@@ -790,7 +790,7 @@ createlinks(void)
}
}
vprintf(stdout, "Add links\n");
- for (i = ROOTINO; i < maxino; i++) {
+ for (i = UFS_ROOTINO; i < maxino; i++) {
ep = lookupino(i);
if (ep == NULL)
continue;
@@ -820,7 +820,7 @@ checkrestore(void)
ino_t i;
vprintf(stdout, "Check the symbol table.\n");
- for (i = WINO; i < maxino; i++) {
+ for (i = UFS_WINO; i < maxino; i++) {
for (ep = lookupino(i); ep != NULL; ep = ep->e_links) {
ep->e_flags &= ~KEEP;
if (ep->e_type == NODE)
diff --git a/sbin/restore/symtab.c b/sbin/restore/symtab.c
index 0713ff040eb6..b40272f8ecf2 100644
--- a/sbin/restore/symtab.c
+++ b/sbin/restore/symtab.c
@@ -84,7 +84,7 @@ lookupino(ino_t inum)
{
struct entry *ep;
- if (inum < WINO || inum >= maxino)
+ if (inum < UFS_WINO || inum >= maxino)
return (NULL);
for (ep = entry[inum % entrytblsize]; ep != NULL; ep = ep->e_next)
if (ep->e_ino == inum)
@@ -100,7 +100,7 @@ addino(ino_t inum, struct entry *np)
{
struct entry **epp;
- if (inum < WINO || inum >= maxino)
+ if (inum < UFS_WINO || inum >= maxino)
panic("addino: out of range %ju\n", (uintmax_t)inum);
epp = &entry[inum % entrytblsize];
np->e_ino = inum;
@@ -121,7 +121,7 @@ deleteino(ino_t inum)
struct entry *next;
struct entry **prev;
- if (inum < WINO || inum >= maxino)
+ if (inum < UFS_WINO || inum >= maxino)
panic("deleteino: out of range %ju\n", (uintmax_t)inum);
prev = &entry[inum % entrytblsize];
for (next = *prev; next != NULL; next = next->e_next) {
@@ -146,7 +146,7 @@ lookupname(char *name)
char buf[MAXPATHLEN];
cp = name;
- for (ep = lookupino(ROOTINO); ep != NULL; ep = ep->e_entries) {
+ for (ep = lookupino(UFS_ROOTINO); ep != NULL; ep = ep->e_entries) {
for (np = buf; *cp != '/' && *cp != '\0' &&
np < &buf[sizeof(buf)]; )
*np++ = *cp++;
@@ -198,7 +198,7 @@ myname(struct entry *ep)
for (cp = &namebuf[MAXPATHLEN - 2]; cp > &namebuf[ep->e_namlen]; ) {
cp -= ep->e_namlen;
memmove(cp, ep->e_name, (long)ep->e_namlen);
- if (ep == lookupino(ROOTINO))
+ if (ep == lookupino(UFS_ROOTINO))
return (cp);
*(--cp) = '/';
ep = ep->e_parent;
@@ -233,12 +233,12 @@ addentry(char *name, ino_t inum, int type)
np->e_type = type & ~LINK;
ep = lookupparent(name);
if (ep == NULL) {
- if (inum != ROOTINO || lookupino(ROOTINO) != NULL)
+ if (inum != UFS_ROOTINO || lookupino(UFS_ROOTINO) != NULL)
panic("bad name to addentry %s\n", name);
np->e_name = savename(name);
np->e_namlen = strlen(name);
np->e_parent = np;
- addino(ROOTINO, np);
+ addino(UFS_ROOTINO, np);
return (np);
}
np->e_name = savename(strrchr(name, '/') + 1);
@@ -458,7 +458,7 @@ dumpsymtable(char *filename, long checkpt)
* Assign indices to each entry
* Write out the string entries
*/
- for (i = WINO; i <= maxino; i++) {
+ for (i = UFS_WINO; i <= maxino; i++) {
for (ep = lookupino(i); ep != NULL; ep = ep->e_links) {
ep->e_index = mynum++;
(void) fwrite(ep->e_name, sizeof(char),
@@ -470,7 +470,7 @@ dumpsymtable(char *filename, long checkpt)
*/
tep = &temp;
stroff = 0;
- for (i = WINO; i <= maxino; i++) {
+ for (i = UFS_WINO; i <= maxino; i++) {
for (ep = lookupino(i); ep != NULL; ep = ep->e_links) {
memmove(tep, ep, (long)sizeof(struct entry));
tep->e_name = (char *)stroff;
@@ -538,7 +538,7 @@ initsymtable(char *filename)
entry = calloc((unsigned)entrytblsize, sizeof(struct entry *));
if (entry == NULL)
panic("no memory for entry table\n");
- ep = addentry(".", ROOTINO, NODE);
+ ep = addentry(".", UFS_ROOTINO, NODE);
ep->e_flags |= NEW;
return;
}
diff --git a/sbin/restore/tape.c b/sbin/restore/tape.c
index 67f770ab63b2..c36382e57809 100644
--- a/sbin/restore/tape.c
+++ b/sbin/restore/tape.c
@@ -301,7 +301,7 @@ setup(void)
* whiteout inode exists, so that the whiteout entries can be
* extracted.
*/
- SETINO(WINO, dumpmap);
+ SETINO(UFS_WINO, dumpmap);
/* 'r' restores don't call getvol() for tape 1, so mark it as read. */
if (command == 'r')
tapesread = 1;
diff --git a/sbin/restore/utilities.c b/sbin/restore/utilities.c
index 90bde98ce0d3..7ff524d9f213 100644
--- a/sbin/restore/utilities.c
+++ b/sbin/restore/utilities.c
@@ -303,7 +303,7 @@ upperbnd(ino_t start)
{
struct entry *ep;
- for ( ; start > ROOTINO; start--) {
+ for ( ; start > UFS_ROOTINO; start--) {
ep = lookupino(start);
if (ep == NULL || ep->e_type == NODE)
continue;
diff --git a/sbin/tunefs/tunefs.c b/sbin/tunefs/tunefs.c
index 93ce2c1f7aa3..90d7faca9542 100644
--- a/sbin/tunefs/tunefs.c
+++ b/sbin/tunefs/tunefs.c
@@ -671,7 +671,7 @@ dir_search(ufs2_daddr_t blk, int bytes)
}
/*
- * Search in the ROOTINO for the SUJ_FILE. If it exists we can not enable
+ * Search in the UFS_ROOTINO for the SUJ_FILE. If it exists we can not enable
* journaling.
*/
static ino_t
@@ -684,18 +684,18 @@ journal_findfile(void)
void *ip;
int i;
- if (getino(&disk, &ip, ROOTINO, &mode) != 0) {
+ if (getino(&disk, &ip, UFS_ROOTINO, &mode) != 0) {
warn("Failed to get root inode");
return (-1);
}
dp2 = ip;
dp1 = ip;
if (sblock.fs_magic == FS_UFS1_MAGIC) {
- if ((off_t)dp1->di_size >= lblktosize(&sblock, NDADDR)) {
- warnx("ROOTINO extends beyond direct blocks.");
+ if ((off_t)dp1->di_size >= lblktosize(&sblock, UFS_NDADDR)) {
+ warnx("UFS_ROOTINO extends beyond direct blocks.");
return (-1);
}
- for (i = 0; i < NDADDR; i++) {
+ for (i = 0; i < UFS_NDADDR; i++) {
if (dp1->di_db[i] == 0)
break;
if ((ino = dir_search(dp1->di_db[i],
@@ -703,11 +703,11 @@ journal_findfile(void)
return (ino);
}
} else {
- if ((off_t)dp2->di_size >= lblktosize(&sblock, NDADDR)) {
- warnx("ROOTINO extends beyond direct blocks.");
+ if ((off_t)dp2->di_size >= lblktosize(&sblock, UFS_NDADDR)) {
+ warnx("UFS_ROOTINO extends beyond direct blocks.");
return (-1);
}
- for (i = 0; i < NDADDR; i++) {
+ for (i = 0; i < UFS_NDADDR; i++) {
if (dp2->di_db[i] == 0)
break;
if ((ino = dir_search(dp2->di_db[i],
@@ -787,7 +787,7 @@ dir_extend(ufs2_daddr_t blk, ufs2_daddr_t nblk, off_t size, ino_t ino)
}
/*
- * Insert the journal file into the ROOTINO directory. We always extend the
+ * Insert the journal file into the UFS_ROOTINO directory. We always extend the
* last frag
*/
static int
@@ -803,7 +803,7 @@ journal_insertfile(ino_t ino)
int mode;
int off;
- if (getino(&disk, &ip, ROOTINO, &mode) != 0) {
+ if (getino(&disk, &ip, UFS_ROOTINO, &mode) != 0) {
warn("Failed to get root inode");
sbdirty();
return (-1);
@@ -816,7 +816,7 @@ journal_insertfile(ino_t ino)
if (nblk <= 0)
return (-1);
/*
- * For simplicity sake we aways extend the ROOTINO into a new
+ * For simplicity sake we aways extend the UFS_ROOTINO into a new
* directory block rather than searching for space and inserting
* into an existing block. However, if the rootino has frags
* have to free them and extend the block.
@@ -1036,7 +1036,7 @@ journal_alloc(int64_t size)
dp2->di_ctime = utime;
dp2->di_birthtime = utime;
}
- for (i = 0; i < NDADDR && resid; i++, resid--) {
+ for (i = 0; i < UFS_NDADDR && resid; i++, resid--) {
blk = journal_balloc();
if (blk <= 0)
goto out;
@@ -1048,7 +1048,7 @@ journal_alloc(int64_t size)
dp2->di_blocks++;
}
}
- for (i = 0; i < NIADDR && resid; i++) {
+ for (i = 0; i < UFS_NIADDR && resid; i++) {
blk = journal_balloc();
if (blk <= 0)
goto out;