Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src Rename ambiguous macros:
details: https://anonhg.NetBSD.org/src/rev/5aed7a1e9218
branches: trunk
changeset: 787466:5aed7a1e9218
user: dholland <dholland%NetBSD.org@localhost>
date: Wed Jun 19 17:51:25 2013 +0000
description:
Rename ambiguous macros:
MAXDIRSIZE -> UFS_MAXDIRSIZE or LFS_MAXDIRSIZE
NINDIR -> FFS_NINDIR, EXT2_NINDIR, LFS_NINDIR, or MFS_NINDIR
INOPB -> FFS_INOPB, LFS_INOPB
INOPF -> FFS_INOPF, LFS_INOPF
blksize -> ffs_blksize, ext2_blksize, or lfs_blksize
sblksize -> ffs_blksize
These are not the only ambiguously defined filesystem macros, of
course, there's a pile more. I may not have found all the ambiguous
definitions of blksize(), too, as there are a lot of other things
called 'blksize' in the system.
diffstat:
sbin/dump/ffs_inode.c | 8 ++--
sbin/fsck_ext2fs/inode.c | 16 ++++----
sbin/fsck_ext2fs/pass1.c | 8 ++--
sbin/fsck_ext2fs/setup.c | 6 +-
sbin/fsck_ffs/dir.c | 8 ++--
sbin/fsck_ffs/inode.c | 26 +++++++-------
sbin/fsck_ffs/pass1.c | 10 +++---
sbin/fsck_ffs/setup.c | 6 +-
sbin/fsdb/fsdb.c | 8 ++--
sbin/fsirand/fsirand.c | 6 +-
sbin/newfs/mkfs.c | 32 +++++++++---------
sbin/newfs_ext2fs/mke2fs.c | 26 +++++++-------
sbin/resize_ffs/resize_ffs.c | 24 +++++++-------
sbin/scan_ffs/scan_ffs.c | 14 +-------
sys/arch/mvme68k/stand/installboot/installboot.c | 4 +-
sys/lib/libsa/ext2fs.c | 18 +++++-----
sys/lib/libsa/lfsv1.c | 10 +++---
sys/lib/libsa/lfsv2.c | 10 +++---
sys/lib/libsa/minixfs3.c | 10 +++---
sys/lib/libsa/minixfs3.h | 4 +-
sys/lib/libsa/ufs.c | 27 ++++++++++------
sys/ufs/ext2fs/ext2fs.h | 6 +-
sys/ufs/ext2fs/ext2fs_inode.c | 20 ++++++------
sys/ufs/ext2fs/ext2fs_readwrite.c | 10 +++---
sys/ufs/ext2fs/ext2fs_subr.c | 6 +-
sys/ufs/ext2fs/ext2fs_vfsops.c | 8 ++--
sys/ufs/ffs/ffs_alloc.c | 24 +++++++-------
sys/ufs/ffs/ffs_balloc.c | 20 ++++++------
sys/ufs/ffs/ffs_inode.c | 28 ++++++++--------
sys/ufs/ffs/ffs_snapshot.c | 40 ++++++++++++------------
sys/ufs/ffs/fs.h | 30 +++++++++---------
sys/ufs/lfs/lfs.h | 6 +-
sys/ufs/lfs/ulfs_rename.c | 8 ++--
sys/ufs/ufs/dir.h | 4 +-
sys/ufs/ufs/ufs_readwrite.c | 26 +++++++++------
sys/ufs/ufs/ufs_rename.c | 8 ++--
usr.sbin/installboot/ext2fs.c | 8 ++--
usr.sbin/installboot/ffs.c | 16 ++++----
usr.sbin/makefs/ffs.c | 10 +++---
usr.sbin/makefs/ffs/ffs_alloc.c | 12 +++---
usr.sbin/makefs/ffs/ffs_balloc.c | 16 ++++----
usr.sbin/makefs/ffs/mkfs.c | 36 ++++++++++----------
usr.sbin/makefs/ffs/ufs_bmap.c | 8 ++--
usr.sbin/quot/quot.c | 10 +++---
44 files changed, 321 insertions(+), 320 deletions(-)
diffs (truncated from 2434 to 300 lines):
diff -r 78a3cd7a4501 -r 5aed7a1e9218 sbin/dump/ffs_inode.c
--- a/sbin/dump/ffs_inode.c Wed Jun 19 15:30:25 2013 +0000
+++ b/sbin/dump/ffs_inode.c Wed Jun 19 17:51:25 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ffs_inode.c,v 1.20 2013/01/22 09:39:11 dholland Exp $ */
+/* $NetBSD: ffs_inode.c,v 1.21 2013/06/19 17:51:25 dholland Exp $ */
/*-
* Copyright (c) 1980, 1991, 1993, 1994
@@ -36,7 +36,7 @@
#endif /* not lint */
#ifndef lint
-__RCSID("$NetBSD: ffs_inode.c,v 1.20 2013/01/22 09:39:11 dholland Exp $");
+__RCSID("$NetBSD: ffs_inode.c,v 1.21 2013/06/19 17:51:25 dholland Exp $");
#endif /* not lint */
#include <sys/param.h>
@@ -231,8 +231,8 @@
goto gotit;
bread(fsatoda(ufsib, ino_to_fsba(sblock, inum)), (char *)inoblock,
(int)ufsib->ufs_bsize);
- minino = inum - (inum % INOPB(sblock));
- maxino = minino + INOPB(sblock);
+ minino = inum - (inum % FFS_INOPB(sblock));
+ maxino = minino + FFS_INOPB(sblock);
if (needswap) {
if (is_ufs2) {
dp2 = (struct ufs2_dinode *)inoblock;
diff -r 78a3cd7a4501 -r 5aed7a1e9218 sbin/fsck_ext2fs/inode.c
--- a/sbin/fsck_ext2fs/inode.c Wed Jun 19 15:30:25 2013 +0000
+++ b/sbin/fsck_ext2fs/inode.c Wed Jun 19 17:51:25 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: inode.c,v 1.33 2013/01/22 09:39:11 dholland Exp $ */
+/* $NetBSD: inode.c,v 1.34 2013/06/19 17:51:25 dholland Exp $ */
/*
* Copyright (c) 1980, 1986, 1993
@@ -58,7 +58,7 @@
#if 0
static char sccsid[] = "@(#)inode.c 8.5 (Berkeley) 2/8/95";
#else
-__RCSID("$NetBSD: inode.c,v 1.33 2013/01/22 09:39:11 dholland Exp $");
+__RCSID("$NetBSD: inode.c,v 1.34 2013/06/19 17:51:25 dholland Exp $");
#endif
#endif /* not lint */
@@ -242,7 +242,7 @@
}
}
}
- sizepb *= NINDIR(&sblock);
+ sizepb *= EXT2_NINDIR(&sblock);
remsize -= sizepb;
}
return (KEEPON);
@@ -273,14 +273,14 @@
bp = getdatablk(idesc->id_blkno, sblock.e2fs_bsize);
ilevel--;
for (sizepb = sblock.e2fs_bsize, i = 0; i < ilevel; i++)
- sizepb *= NINDIR(&sblock);
- if (isize > sizepb * NINDIR(&sblock))
- nif = NINDIR(&sblock);
+ sizepb *= EXT2_NINDIR(&sblock);
+ if (isize > sizepb * EXT2_NINDIR(&sblock))
+ nif = EXT2_NINDIR(&sblock);
else
nif = howmany(isize, sizepb);
if (idesc->id_func == pass1check &&
- nif < NINDIR(&sblock)) {
- aplim = &bp->b_un.b_indir[NINDIR(&sblock)];
+ nif < EXT2_NINDIR(&sblock)) {
+ aplim = &bp->b_un.b_indir[EXT2_NINDIR(&sblock)];
for (ap = &bp->b_un.b_indir[nif]; ap < aplim; ap++) {
if (*ap == 0)
continue;
diff -r 78a3cd7a4501 -r 5aed7a1e9218 sbin/fsck_ext2fs/pass1.c
--- a/sbin/fsck_ext2fs/pass1.c Wed Jun 19 15:30:25 2013 +0000
+++ b/sbin/fsck_ext2fs/pass1.c Wed Jun 19 17:51:25 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pass1.c,v 1.23 2013/01/22 09:39:11 dholland Exp $ */
+/* $NetBSD: pass1.c,v 1.24 2013/06/19 17:51:25 dholland Exp $ */
/*
* Copyright (c) 1980, 1986, 1993
@@ -58,7 +58,7 @@
#if 0
static char sccsid[] = "@(#)pass1.c 8.1 (Berkeley) 6/5/93";
#else
-__RCSID("$NetBSD: pass1.c,v 1.23 2013/01/22 09:39:11 dholland Exp $");
+__RCSID("$NetBSD: pass1.c,v 1.24 2013/06/19 17:51:25 dholland Exp $");
#endif
#endif /* not lint */
@@ -244,7 +244,7 @@
if (ndb > EXT2FS_NDADDR) {
j = ndb - EXT2FS_NDADDR;
for (ndb = 1; j > 1; j--)
- ndb *= NINDIR(&sblock);
+ ndb *= EXT2_NINDIR(&sblock);
ndb += EXT2FS_NDADDR;
}
}
@@ -259,7 +259,7 @@
goto unknown;
}
for (j = 0, ndb -= EXT2FS_NDADDR; ndb > 0; j++)
- ndb /= NINDIR(&sblock);
+ ndb /= EXT2_NINDIR(&sblock);
for (; j < EXT2FS_NIADDR; j++) {
if (dp->e2di_blocks[j+EXT2FS_NDADDR] != 0) {
if (debug)
diff -r 78a3cd7a4501 -r 5aed7a1e9218 sbin/fsck_ext2fs/setup.c
--- a/sbin/fsck_ext2fs/setup.c Wed Jun 19 15:30:25 2013 +0000
+++ b/sbin/fsck_ext2fs/setup.c Wed Jun 19 17:51:25 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: setup.c,v 1.29 2013/01/22 09:39:11 dholland Exp $ */
+/* $NetBSD: setup.c,v 1.30 2013/06/19 17:51:25 dholland Exp $ */
/*
* Copyright (c) 1980, 1986, 1993
@@ -58,7 +58,7 @@
#if 0
static char sccsid[] = "@(#)setup.c 8.5 (Berkeley) 11/23/94";
#else
-__RCSID("$NetBSD: setup.c,v 1.29 2013/01/22 09:39:11 dholland Exp $");
+__RCSID("$NetBSD: setup.c,v 1.30 2013/06/19 17:51:25 dholland Exp $");
#endif
#endif /* not lint */
@@ -182,7 +182,7 @@
sizepb = sblock.e2fs_bsize;
maxfilesize = sblock.e2fs_bsize * EXT2FS_NDADDR - 1;
for (i = 0; i < EXT2FS_NIADDR; i++) {
- sizepb *= NINDIR(&sblock);
+ sizepb *= EXT2_NINDIR(&sblock);
maxfilesize += sizepb;
}
/*
diff -r 78a3cd7a4501 -r 5aed7a1e9218 sbin/fsck_ffs/dir.c
--- a/sbin/fsck_ffs/dir.c Wed Jun 19 15:30:25 2013 +0000
+++ b/sbin/fsck_ffs/dir.c Wed Jun 19 17:51:25 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: dir.c,v 1.55 2013/06/09 17:57:09 dholland Exp $ */
+/* $NetBSD: dir.c,v 1.56 2013/06/19 17:51:25 dholland Exp $ */
/*
* Copyright (c) 1980, 1986, 1993
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)dir.c 8.8 (Berkeley) 4/28/95";
#else
-__RCSID("$NetBSD: dir.c,v 1.55 2013/06/09 17:57:09 dholland Exp $");
+__RCSID("$NetBSD: dir.c,v 1.56 2013/06/19 17:51:25 dholland Exp $");
#endif
#endif /* not lint */
@@ -737,7 +737,7 @@
btodb(sblock->fs_bsize));
dirblk = iswap32(dp1->di_db[lastbn + 1]);
}
- bp = getdirblk(dirblk, sblksize(sblock, (daddr_t)DIP(dp, size), lastbn + 1));
+ bp = getdirblk(dirblk, ffs_sblksize(sblock, (daddr_t)DIP(dp, size), lastbn + 1));
if (bp->b_errs)
goto bad;
memmove(firstblk, bp->b_un.b_buf, dirblksiz);
@@ -751,7 +751,7 @@
cp += dirblksiz)
memmove(cp, &emptydir, sizeof emptydir);
dirty(bp);
- bp = getdirblk(dirblk, sblksize(sblock, (daddr_t)DIP(dp, size), lastbn + 1));
+ bp = getdirblk(dirblk, ffs_sblksize(sblock, (daddr_t)DIP(dp, size), lastbn + 1));
if (bp->b_errs)
goto bad;
memmove(bp->b_un.b_buf, &emptydir, sizeof emptydir);
diff -r 78a3cd7a4501 -r 5aed7a1e9218 sbin/fsck_ffs/inode.c
--- a/sbin/fsck_ffs/inode.c Wed Jun 19 15:30:25 2013 +0000
+++ b/sbin/fsck_ffs/inode.c Wed Jun 19 17:51:25 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: inode.c,v 1.65 2013/01/22 09:39:11 dholland Exp $ */
+/* $NetBSD: inode.c,v 1.66 2013/06/19 17:51:25 dholland Exp $ */
/*
* Copyright (c) 1980, 1986, 1993
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)inode.c 8.8 (Berkeley) 4/28/95";
#else
-__RCSID("$NetBSD: inode.c,v 1.65 2013/01/22 09:39:11 dholland Exp $");
+__RCSID("$NetBSD: inode.c,v 1.66 2013/06/19 17:51:25 dholland Exp $");
#endif
#endif /* not lint */
@@ -95,7 +95,7 @@
ndb = howmany(iswap64(DIP(&dino, size)), sblock->fs_bsize);
for (i = 0; i < UFS_NDADDR; i++) {
if (--ndb == 0 &&
- (offset = blkoff(sblock, iswap64(DIP(&dino, size)))) != 0)
+ (offset = ffs_blkoff(sblock, iswap64(DIP(&dino, size)))) != 0)
idesc->id_numfrags =
numfrags(sblock, fragroundup(sblock, offset));
else
@@ -165,7 +165,7 @@
}
}
}
- sizepb *= NINDIR(sblock);
+ sizepb *= FFS_NINDIR(sblock);
remsize -= sizepb;
}
return (KEEPON);
@@ -192,9 +192,9 @@
bp = getdatablk(idesc->id_blkno, sblock->fs_bsize);
ilevel--;
for (sizepb = sblock->fs_bsize, i = 0; i < ilevel; i++)
- sizepb *= NINDIR(sblock);
- if (howmany(isize, sizepb) > (size_t)NINDIR(sblock))
- nif = NINDIR(sblock);
+ sizepb *= FFS_NINDIR(sblock);
+ if (howmany(isize, sizepb) > (size_t)FFS_NINDIR(sblock))
+ nif = FFS_NINDIR(sblock);
else
nif = howmany(isize, sizepb);
if (do_blkswap) { /* swap byte order of the whole blk */
@@ -210,8 +210,8 @@
dirty(bp);
flush(fswritefd, bp);
}
- if (idesc->id_func == pass1check && nif < NINDIR(sblock)) {
- for (i = nif; i < NINDIR(sblock); i++) {
+ if (idesc->id_func == pass1check && nif < FFS_NINDIR(sblock)) {
+ for (i = nif; i < FFS_NINDIR(sblock); i++) {
if (IBLK(bp, i) == 0)
continue;
(void)snprintf(buf, sizeof(buf),
@@ -327,18 +327,18 @@
errexit("bad inode number %llu to ginode",
(unsigned long long)inumber);
if (startinum == 0 ||
- inumber < startinum || inumber >= startinum + INOPB(sblock)) {
+ inumber < startinum || inumber >= startinum + FFS_INOPB(sblock)) {
iblk = ino_to_fsba(sblock, inumber);
if (pbp != 0)
pbp->b_flags &= ~B_INUSE;
pbp = getdatablk(iblk, sblock->fs_bsize);
- startinum = (inumber / INOPB(sblock)) * INOPB(sblock);
+ startinum = (inumber / FFS_INOPB(sblock)) * FFS_INOPB(sblock);
}
if (is_ufs2) {
- blkoff = (inumber % INOPB(sblock)) * DINODE2_SIZE;
+ blkoff = (inumber % FFS_INOPB(sblock)) * DINODE2_SIZE;
return ((union dinode *)((caddr_t)pbp->b_un.b_buf + blkoff));
}
- blkoff = (inumber % INOPB(sblock)) * DINODE1_SIZE;
+ blkoff = (inumber % FFS_INOPB(sblock)) * DINODE1_SIZE;
return ((union dinode *)((caddr_t)pbp->b_un.b_buf + blkoff));
}
diff -r 78a3cd7a4501 -r 5aed7a1e9218 sbin/fsck_ffs/pass1.c
--- a/sbin/fsck_ffs/pass1.c Wed Jun 19 15:30:25 2013 +0000
+++ b/sbin/fsck_ffs/pass1.c Wed Jun 19 17:51:25 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pass1.c,v 1.51 2013/01/22 09:39:11 dholland Exp $ */
+/* $NetBSD: pass1.c,v 1.52 2013/06/19 17:51:25 dholland Exp $ */
/*
* Copyright (c) 1980, 1986, 1993
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)pass1.c 8.6 (Berkeley) 4/28/95";
#else
-__RCSID("$NetBSD: pass1.c,v 1.51 2013/01/22 09:39:11 dholland Exp $");
+__RCSID("$NetBSD: pass1.c,v 1.52 2013/06/19 17:51:25 dholland Exp $");
#endif
#endif /* not lint */
@@ -276,7 +276,7 @@
else
kernmaxfilesize = (u_int64_t)0x80000000 * sblock->fs_bsize - 1;
if (size > kernmaxfilesize || size + sblock->fs_bsize - 1 < size ||
- (mode == IFDIR && size > MAXDIRSIZE)) {
+ (mode == IFDIR && size > UFS_MAXDIRSIZE)) {
if (debug)
printf("bad size %llu:",(unsigned long long)size);
goto unknown;
@@ -339,7 +339,7 @@
if (ndb > UFS_NDADDR) {
j = ndb - UFS_NDADDR;
for (ndb = 1; j > 1; j--)
- ndb *= NINDIR(sblock);
+ ndb *= FFS_NINDIR(sblock);
ndb += UFS_NDADDR;
}
}
@@ -362,7 +362,7 @@
}
for (j = 0, ndb -= UFS_NDADDR; ndb > 0; j++)
- ndb /= NINDIR(sblock);
+ ndb /= FFS_NINDIR(sblock);
Home |
Main Index |
Thread Index |
Old Index