From owner-svn-src-head@freebsd.org Wed Feb 15 19:50:29 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 60697CE0361; Wed, 15 Feb 2017 19:50:29 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1DCB5B5C; Wed, 15 Feb 2017 19:50:29 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1FJoSGf004117; Wed, 15 Feb 2017 19:50:28 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1FJoQh5004096; Wed, 15 Feb 2017 19:50:26 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201702151950.v1FJoQh5004096@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 15 Feb 2017 19:50:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313780 - in head: lib/libstand sbin/dump sbin/ffsinfo sbin/fsck_ffs sbin/fsdb sbin/fsirand sbin/growfs sbin/newfs sbin/newfs_nandfs sbin/quotacheck sbin/restore sbin/tunefs sys/boot/co... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Feb 2017 19:50:29 -0000 Author: emaste Date: Wed Feb 15 19:50:26 2017 New Revision: 313780 URL: https://svnweb.freebsd.org/changeset/base/313780 Log: prefix UFS symbols with UFS_ to reduce namespace pollution Specifically: ROOTINO -> UFS_ROOTINO WINO -> UFS_WINO NXADDR -> UFS_NXADDR NDADDR -> UFS_NDADDR NIADDR -> UFS_NIADDR MAXSYMLINKLEN_UFS[12] -> UFS[12]_MAXSYMLINKLEN (for consistency) Also prefix ext2's and nandfs's NDADDR and NIADDR with EXT2_ and NANDFS_ Reviewed by: kib, mckusick Obtained from: NetBSD MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D9536 Modified: head/lib/libstand/ext2fs.c head/lib/libstand/nandfs.c head/lib/libstand/ufs.c head/sbin/dump/traverse.c head/sbin/ffsinfo/ffsinfo.c head/sbin/fsck_ffs/dir.c head/sbin/fsck_ffs/fsutil.c head/sbin/fsck_ffs/gjournal.c head/sbin/fsck_ffs/inode.c head/sbin/fsck_ffs/main.c head/sbin/fsck_ffs/pass1.c head/sbin/fsck_ffs/pass1b.c head/sbin/fsck_ffs/pass2.c head/sbin/fsck_ffs/pass3.c head/sbin/fsck_ffs/pass4.c head/sbin/fsck_ffs/pass5.c head/sbin/fsck_ffs/suj.c head/sbin/fsdb/fsdb.c head/sbin/fsdb/fsdbutil.c head/sbin/fsirand/fsirand.c head/sbin/growfs/debug.c head/sbin/growfs/growfs.c head/sbin/newfs/mkfs.c head/sbin/newfs_nandfs/newfs_nandfs.c head/sbin/quotacheck/quotacheck.c head/sbin/restore/dirs.c head/sbin/restore/interactive.c head/sbin/restore/main.c head/sbin/restore/restore.c head/sbin/restore/symtab.c head/sbin/restore/tape.c head/sbin/restore/utilities.c head/sbin/tunefs/tunefs.c head/sys/boot/common/ufsread.c head/sys/fs/ext2fs/ext2_alloc.c head/sys/fs/ext2fs/ext2_balloc.c head/sys/fs/ext2fs/ext2_bmap.c head/sys/fs/ext2fs/ext2_inode.c head/sys/fs/ext2fs/ext2_inode_cnv.c head/sys/fs/ext2fs/inode.h head/sys/fs/nandfs/bmap.c head/sys/fs/nandfs/nandfs_fs.h head/sys/fs/nfsclient/nfs_clvfsops.c head/sys/ufs/ffs/ffs_alloc.c head/sys/ufs/ffs/ffs_balloc.c head/sys/ufs/ffs/ffs_inode.c head/sys/ufs/ffs/ffs_snapshot.c head/sys/ufs/ffs/ffs_softdep.c head/sys/ufs/ffs/ffs_vfsops.c head/sys/ufs/ffs/ffs_vnops.c head/sys/ufs/ffs/fs.h head/sys/ufs/ufs/dinode.h head/sys/ufs/ufs/ufs_bmap.c head/sys/ufs/ufs/ufs_lookup.c head/sys/ufs/ufs/ufs_vfsops.c head/sys/ufs/ufs/ufs_vnops.c head/usr.sbin/makefs/ffs.c head/usr.sbin/makefs/ffs/ffs_alloc.c head/usr.sbin/makefs/ffs/ffs_balloc.c head/usr.sbin/makefs/ffs/mkfs.c head/usr.sbin/makefs/ffs/ufs_bmap.c head/usr.sbin/makefs/makefs.h head/usr.sbin/quot/quot.c Modified: head/lib/libstand/ext2fs.c ============================================================================== --- head/lib/libstand/ext2fs.c Wed Feb 15 19:46:00 2017 (r313779) +++ head/lib/libstand/ext2fs.c Wed Feb 15 19:50:26 2017 (r313780) @@ -130,8 +130,8 @@ struct fs_ops ext2fs_fsops = { #define EXT2_MINBSHIFT 10 /* mininum block shift */ #define EXT2_MINFSHIFT 10 /* mininum frag shift */ -#define NDADDR 12 /* # of direct blocks */ -#define NIADDR 3 /* # of indirect blocks */ +#define EXT2_NDADDR 12 /* # of direct blocks */ +#define EXT2_NIADDR 3 /* # of indirect blocks */ /* * file system block to disk address @@ -162,7 +162,7 @@ struct fs_ops ext2fs_fsops = { #define fragroundup(fs, size) /* roundup(size, fsize) */ \ (((size) + (fs)->fs_fmask) & ~(fs)->fs_fmask) #define dblksize(fs, dip, lbn) \ - (((lbn) >= NDADDR || (dip)->di_size >= smalllblktosize(fs, (lbn) + 1)) \ + (((lbn) >= EXT2_NDADDR || (dip)->di_size >= smalllblktosize(fs, (lbn) + 1)) \ ? (fs)->fs_bsize \ : (fragroundup(fs, blkoff(fs, (dip)->di_size)))) @@ -275,8 +275,8 @@ struct ext2dinode { u_int32_t di_osdep1; /* os dependent stuff */ - u_int32_t di_db[NDADDR]; /* direct blocks */ - u_int32_t di_ib[NIADDR]; /* indirect blocks */ + u_int32_t di_db[EXT2_NDADDR]; /* direct blocks */ + u_int32_t di_ib[EXT2_NIADDR]; /* indirect blocks */ u_int32_t di_version; /* version */ u_int32_t di_facl; /* file acl */ u_int32_t di_dacl; /* dir acl */ @@ -305,12 +305,12 @@ struct file { struct ext2fs *f_fs; /* pointer to super-block */ struct ext2blkgrp *f_bg; /* pointer to blkgrp map */ struct ext2dinode f_di; /* copy of on-disk inode */ - int f_nindir[NIADDR]; /* number of blocks mapped by + int f_nindir[EXT2_NIADDR]; /* number of blocks mapped by indirect block at level i */ - char *f_blk[NIADDR]; /* buffer for indirect block + char *f_blk[EXT2_NIADDR]; /* buffer for indirect block at level i */ - size_t f_blksize[NIADDR]; /* size of buffer */ - daddr_t f_blkno[NIADDR]; /* disk address of block in + size_t f_blksize[EXT2_NIADDR]; /* size of buffer */ + daddr_t f_blkno[EXT2_NIADDR]; /* disk address of block in buffer */ char *f_buf; /* buffer for data block */ size_t f_buf_size; /* size of data block */ @@ -411,7 +411,7 @@ ext2fs_open(const char *upath, struct op * Calculate indirect block levels. */ mult = 1; - for (i = 0; i < NIADDR; i++) { + for (i = 0; i < EXT2_NIADDR; i++) { mult *= nindir(fs); fp->f_nindir[i] = mult; } @@ -582,7 +582,7 @@ read_inode(ino_t inumber, struct open_fi fp->f_di = dp[ino_to_bo(fs, inumber)]; /* clear out old buffers */ - for (level = 0; level < NIADDR; level++) + for (level = 0; level < EXT2_NIADDR; level++) fp->f_blkno[level] = -1; fp->f_buf_blkno = -1; fp->f_seekp = 0; @@ -609,33 +609,33 @@ block_map(struct open_file *f, daddr_t f /* * Index structure of an inode: * - * di_db[0..NDADDR-1] hold block numbers for blocks - * 0..NDADDR-1 + * di_db[0..EXT2_NDADDR-1] hold block numbers for blocks + * 0..EXT2_NDADDR-1 * * di_ib[0] index block 0 is the single indirect block * holds block numbers for blocks - * NDADDR .. NDADDR + NINDIR(fs)-1 + * EXT2_NDADDR .. EXT2_NDADDR + NINDIR(fs)-1 * * di_ib[1] index block 1 is the double indirect block * holds block numbers for INDEX blocks for blocks - * NDADDR + NINDIR(fs) .. - * NDADDR + NINDIR(fs) + NINDIR(fs)**2 - 1 + * EXT2_NDADDR + NINDIR(fs) .. + * EXT2_NDADDR + NINDIR(fs) + NINDIR(fs)**2 - 1 * * di_ib[2] index block 2 is the triple indirect block * holds block numbers for double-indirect * blocks for blocks - * NDADDR + NINDIR(fs) + NINDIR(fs)**2 .. - * NDADDR + NINDIR(fs) + NINDIR(fs)**2 + * EXT2_NDADDR + NINDIR(fs) + NINDIR(fs)**2 .. + * EXT2_NDADDR + NINDIR(fs) + NINDIR(fs)**2 * + NINDIR(fs)**3 - 1 */ - if (file_block < NDADDR) { + if (file_block < EXT2_NDADDR) { /* Direct block. */ *disk_block_p = fp->f_di.di_db[file_block]; return (0); } - file_block -= NDADDR; + file_block -= EXT2_NDADDR; /* * nindir[0] = NINDIR @@ -643,12 +643,12 @@ block_map(struct open_file *f, daddr_t f * nindir[2] = NINDIR**3 * etc */ - for (level = 0; level < NIADDR; level++) { + for (level = 0; level < EXT2_NIADDR; level++) { if (file_block < fp->f_nindir[level]) break; file_block -= fp->f_nindir[level]; } - if (level == NIADDR) { + if (level == EXT2_NIADDR) { /* Block number too high */ return (EFBIG); } @@ -800,7 +800,7 @@ ext2fs_close(struct open_file *f) if (fp == (struct file *)0) return (0); - for (level = 0; level < NIADDR; level++) { + for (level = 0; level < EXT2_NIADDR; level++) { if (fp->f_blk[level]) free(fp->f_blk[level]); } Modified: head/lib/libstand/nandfs.c ============================================================================== --- head/lib/libstand/nandfs.c Wed Feb 15 19:46:00 2017 (r313779) +++ head/lib/libstand/nandfs.c Wed Feb 15 19:50:26 2017 (r313780) @@ -85,7 +85,7 @@ struct nandfs { struct nandfs_mdt nf_datfile_mdt; struct nandfs_mdt nf_ifile_mdt; - int nf_nindir[NIADDR]; + int nf_nindir[NANDFS_NIADDR]; }; static int nandfs_open(const char *, struct open_file *); @@ -313,7 +313,7 @@ nandfs_mount(struct nandfs *fs, struct o nandfs_daddr_t mult; mult = 1; - for (level = 0; level < NIADDR; level++) { + for (level = 0; level < NANDFS_NIADDR; level++) { mult *= NINDIR(fs); fs->nf_nindir[level] = mult; } @@ -392,7 +392,7 @@ nandfs_open(const char *path, struct ope nandfs_daddr_t mult; mult = 1; - for (level = 0; level < NIADDR; level++) { + for (level = 0; level < NANDFS_NIADDR; level++) { mult *= NINDIR(fs); fs->nf_nindir[level] = mult; } @@ -887,12 +887,12 @@ nandfs_bmap_lookup(struct nandfs *fs, st ino = node->inode; - if (lblknr < NDADDR) { + if (lblknr < NANDFS_NDADDR) { *vblknr = ino->i_db[lblknr]; return (0); } - lblknr -= NDADDR; + lblknr -= NANDFS_NDADDR; /* * nindir[0] = NINDIR @@ -900,14 +900,14 @@ nandfs_bmap_lookup(struct nandfs *fs, st * nindir[2] = NINDIR**3 * etc */ - for (level = 0; level < NIADDR; level++) { + for (level = 0; level < NANDFS_NIADDR; level++) { NANDFS_DEBUG("lblknr=%jx fs->nf_nindir[%d]=%d\n", lblknr, level, fs->nf_nindir[level]); if (lblknr < fs->nf_nindir[level]) break; lblknr -= fs->nf_nindir[level]; } - if (level == NIADDR) { + if (level == NANDFS_NIADDR) { /* Block number too high */ NANDFS_DEBUG("lblknr %jx too high\n", lblknr); return (EFBIG); Modified: head/lib/libstand/ufs.c ============================================================================== --- head/lib/libstand/ufs.c Wed Feb 15 19:46:00 2017 (r313779) +++ head/lib/libstand/ufs.c Wed Feb 15 19:50:26 2017 (r313780) @@ -112,14 +112,14 @@ struct file { struct ufs1_dinode di1; struct ufs2_dinode di2; } f_di; /* copy of on-disk inode */ - int f_nindir[NIADDR]; + int f_nindir[UFS_NIADDR]; /* number of blocks mapped by indirect block at level i */ - char *f_blk[NIADDR]; /* buffer for indirect block at + char *f_blk[UFS_NIADDR]; /* buffer for indirect block at level i */ - size_t f_blksize[NIADDR]; + size_t f_blksize[UFS_NIADDR]; /* size of buffer */ - ufs2_daddr_t f_blkno[NIADDR];/* disk address of block in buffer */ + ufs2_daddr_t f_blkno[UFS_NIADDR];/* disk address of block in buffer */ ufs2_daddr_t f_buf_blkno; /* block number of data block */ char *f_buf; /* buffer for data block */ size_t f_buf_size; /* size of data block */ @@ -179,7 +179,7 @@ read_inode(inumber, f) { int level; - for (level = 0; level < NIADDR; level++) + for (level = 0; level < UFS_NIADDR; level++) fp->f_blkno[level] = -1; fp->f_buf_blkno = -1; } @@ -209,33 +209,33 @@ block_map(f, file_block, disk_block_p) /* * Index structure of an inode: * - * di_db[0..NDADDR-1] hold block numbers for blocks - * 0..NDADDR-1 + * di_db[0..UFS_NDADDR-1] hold block numbers for blocks + * 0..UFS_NDADDR-1 * * di_ib[0] index block 0 is the single indirect block * holds block numbers for blocks - * NDADDR .. NDADDR + NINDIR(fs)-1 + * UFS_NDADDR .. UFS_NDADDR + NINDIR(fs)-1 * * di_ib[1] index block 1 is the double indirect block * holds block numbers for INDEX blocks for blocks - * NDADDR + NINDIR(fs) .. - * NDADDR + NINDIR(fs) + NINDIR(fs)**2 - 1 + * UFS_NDADDR + NINDIR(fs) .. + * UFS_NDADDR + NINDIR(fs) + NINDIR(fs)**2 - 1 * * di_ib[2] index block 2 is the triple indirect block * holds block numbers for double-indirect * blocks for blocks - * NDADDR + NINDIR(fs) + NINDIR(fs)**2 .. - * NDADDR + NINDIR(fs) + NINDIR(fs)**2 + * UFS_NDADDR + NINDIR(fs) + NINDIR(fs)**2 .. + * UFS_NDADDR + NINDIR(fs) + NINDIR(fs)**2 * + NINDIR(fs)**3 - 1 */ - if (file_block < NDADDR) { + if (file_block < UFS_NDADDR) { /* Direct block. */ *disk_block_p = DIP(fp, di_db[file_block]); return (0); } - file_block -= NDADDR; + file_block -= UFS_NDADDR; /* * nindir[0] = NINDIR @@ -243,12 +243,12 @@ block_map(f, file_block, disk_block_p) * nindir[2] = NINDIR**3 * etc */ - for (level = 0; level < NIADDR; level++) { + for (level = 0; level < UFS_NIADDR; level++) { if (file_block < fp->f_nindir[level]) break; file_block -= fp->f_nindir[level]; } - if (level == NIADDR) { + if (level == UFS_NIADDR) { /* Block number too high */ return (EFBIG); } @@ -545,13 +545,13 @@ ufs_open(upath, f) int level; mult = 1; - for (level = 0; level < NIADDR; level++) { + for (level = 0; level < UFS_NIADDR; level++) { mult *= NINDIR(fs); fp->f_nindir[level] = mult; } } - inumber = ROOTINO; + inumber = UFS_ROOTINO; if ((rc = read_inode(inumber, f)) != 0) goto out; @@ -667,7 +667,7 @@ ufs_open(upath, f) if (*cp != '/') inumber = parent_inumber; else - inumber = (ino_t)ROOTINO; + inumber = (ino_t)UFS_ROOTINO; if ((rc = read_inode(inumber, f)) != 0) goto out; @@ -704,7 +704,7 @@ ufs_close(f) if (fp == (struct file *)0) return (0); - for (level = 0; level < NIADDR; level++) { + for (level = 0; level < UFS_NIADDR; level++) { if (fp->f_blk[level]) free(fp->f_blk[level]); } Modified: head/sbin/dump/traverse.c ============================================================================== --- head/sbin/dump/traverse.c Wed Feb 15 19:46:00 2017 (r313779) +++ head/sbin/dump/traverse.c Wed Feb 15 19:50:26 2017 (r313780) @@ -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 * 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 } 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 * 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); } Modified: head/sbin/ffsinfo/ffsinfo.c ============================================================================== --- head/sbin/ffsinfo/ffsinfo.c Wed Feb 15 19:46:00 2017 (r313779) +++ head/sbin/ffsinfo/ffsinfo.c Wed Feb 15 19:50:26 2017 (r313780) @@ -377,7 +377,7 @@ dump_whole_ufs1_inode(ino_t inode, int l /* * 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 l /* * 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. Modified: head/sbin/fsck_ffs/dir.c ============================================================================== --- head/sbin/fsck_ffs/dir.c Wed Feb 15 19:46:00 2017 (r313779) +++ head/sbin/fsck_ffs/dir.c Wed Feb 15 19:50:26 2017 (r313780) @@ -255,7 +255,7 @@ fileerror(ino_t cwd, ino_t ino, const ch 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, ch 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, ch 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 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, in 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); Modified: head/sbin/fsck_ffs/fsutil.c ============================================================================== --- head/sbin/fsck_ffs/fsutil.c Wed Feb 15 19:46:00 2017 (r313779) +++ head/sbin/fsck_ffs/fsutil.c Wed Feb 15 19:50:26 2017 (r313780) @@ -854,7 +854,7 @@ getpathname(char *namebuf, ino_t curdir, 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, 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 = idesc.id_number; } busy = 0; - if (ino != ROOTINO) + if (ino != UFS_ROOTINO) *--cp = '?'; memmove(namebuf, cp, (size_t)(&namebuf[MAXPATHLEN] - cp)); } Modified: head/sbin/fsck_ffs/gjournal.c ============================================================================== --- head/sbin/fsck_ffs/gjournal.c Wed Feb 15 19:46:00 2017 (r313779) +++ head/sbin/fsck_ffs/gjournal.c Wed Feb 15 19:50:26 2017 (r313780) @@ -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; Modified: head/sbin/fsck_ffs/inode.c ============================================================================== --- head/sbin/fsck_ffs/inode.c Wed Feb 15 19:46:00 2017 (r313779) +++ head/sbin/fsck_ffs/inode.c Wed Feb 15 19:50:26 2017 (r313780) @@ -78,7 +78,7 @@ ckinode(union dinode *dp, struct inodesc 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 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 rebuildc 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 rebuildc 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++) Modified: head/sbin/fsck_ffs/main.c ============================================================================== --- head/sbin/fsck_ffs/main.c Wed Feb 15 19:46:00 2017 (r313779) +++ head/sbin/fsck_ffs/main.c Wed Feb 15 19:50:26 2017 (r313780) @@ -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); Modified: head/sbin/fsck_ffs/pass1.c ============================================================================== --- head/sbin/fsck_ffs/pass1.c Wed Feb 15 19:46:00 2017 (r313779) +++ head/sbin/fsck_ffs/pass1.c Wed Feb 15 19:50:26 2017 (r313780) @@ -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 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 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 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, Modified: head/sbin/fsck_ffs/pass1b.c ============================================================================== --- head/sbin/fsck_ffs/pass1b.c Wed Feb 15 19:46:00 2017 (r313779) +++ head/sbin/fsck_ffs/pass1b.c Wed Feb 15 19:50:26 2017 (r313780) @@ -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) Modified: head/sbin/fsck_ffs/pass2.c ============================================================================== --- head/sbin/fsck_ffs/pass2.c Wed Feb 15 19:46:00 2017 (r313779) +++ head/sbin/fsck_ffs/pass2.c Wed Feb 15 19:50:26 2017 (r313780) @@ -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; Modified: head/sbin/fsck_ffs/pass3.c ============================================================================== --- head/sbin/fsck_ffs/pass3.c Wed Feb 15 19:46:00 2017 (r313779) +++ head/sbin/fsck_ffs/pass3.c Wed Feb 15 19:50:26 2017 (r313780) @@ -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; } Modified: head/sbin/fsck_ffs/pass4.c ============================================================================== --- head/sbin/fsck_ffs/pass4.c Wed Feb 15 19:46:00 2017 (r313779) +++ head/sbin/fsck_ffs/pass4.c Wed Feb 15 19:50:26 2017 (r313780) @@ -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) { Modified: head/sbin/fsck_ffs/pass5.c ============================================================================== --- head/sbin/fsck_ffs/pass5.c Wed Feb 15 19:46:00 2017 (r313779) +++ head/sbin/fsck_ffs/pass5.c Wed Feb 15 19:50:26 2017 (r313780) @@ -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--; } Modified: head/sbin/fsck_ffs/suj.c ============================================================================== --- head/sbin/fsck_ffs/suj.c Wed Feb 15 19:46:00 2017 (r313779) +++ head/sbin/fsck_ffs/suj.c Wed Feb 15 19:50:26 2017 (r313780) @@ -758,7 +758,7 @@ ino_blkatoff(union dinode *ip, ino_t ino /* * 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 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, i *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***