Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src Stick ffs_ in front of the following macros:
details: https://anonhg.NetBSD.org/src/rev/be3336ffd920
branches: trunk
changeset: 787559:be3336ffd920
user: dholland <dholland%NetBSD.org@localhost>
date: Sun Jun 23 22:03:34 2013 +0000
description:
Stick ffs_ in front of the following macros:
fragstoblks()
blkstofrags()
fragnum()
blknum()
to finish the job of distinguishing them from the lfs versions, which
Christos renamed the other day.
I believe this is the last of the overtly ambiguous exported symbols
from ffs... or at least, the last of the ones that conflicted with lfs.
ffs still pollutes the C namespace very broadly (as does ufs) and this
needs quite a bit more cleanup.
XXX: boo on macros with lowercase names. But I'm not tackling that just yet.
diffstat:
sbin/fsck_ffs/inode.c | 8 +++---
sbin/fsck_ffs/pass4.c | 6 ++--
sbin/fsck_ffs/pass5.c | 10 ++++----
sbin/fsck_ffs/utilities.c | 6 ++--
sbin/newfs/mkfs.c | 16 +++++++-------
sbin/resize_ffs/resize_ffs.c | 10 ++++----
sbin/scan_ffs/scan_ffs.c | 19 ++--------------
sys/ufs/ffs/ffs_alloc.c | 44 ++++++++++++++++++++--------------------
sys/ufs/ffs/ffs_snapshot.c | 36 ++++++++++++++++----------------
sys/ufs/ffs/ffs_vfsops.c | 6 ++--
sys/ufs/ffs/ffs_wapbl.c | 10 ++++----
sys/ufs/ffs/fs.h | 16 +++++++-------
usr.sbin/makefs/ffs/ffs_alloc.c | 18 ++++++++--------
usr.sbin/makefs/ffs/mkfs.c | 14 ++++++------
14 files changed, 103 insertions(+), 116 deletions(-)
diffs (truncated from 857 to 300 lines):
diff -r 6eeab5ccdc8b -r be3336ffd920 sbin/fsck_ffs/inode.c
--- a/sbin/fsck_ffs/inode.c Sun Jun 23 20:32:55 2013 +0000
+++ b/sbin/fsck_ffs/inode.c Sun Jun 23 22:03:34 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: inode.c,v 1.68 2013/06/23 07:28:36 dholland Exp $ */
+/* $NetBSD: inode.c,v 1.69 2013/06/23 22:03:34 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.68 2013/06/23 07:28:36 dholland Exp $");
+__RCSID("$NetBSD: inode.c,v 1.69 2013/06/23 22:03:34 dholland Exp $");
#endif
#endif /* not lint */
@@ -281,10 +281,10 @@
cnt - 1 > maxfsblock - blk)
return (1);
if (cnt > sblock->fs_frag ||
- fragnum(sblock, blk) + cnt > sblock->fs_frag) {
+ ffs_fragnum(sblock, blk) + cnt > sblock->fs_frag) {
if (debug)
printf("bad size: blk %lld, offset %d, size %d\n",
- (long long)blk, (int)fragnum(sblock, blk), cnt);
+ (long long)blk, (int)ffs_fragnum(sblock, blk), cnt);
}
c = dtog(sblock, blk);
if (blk < cgdmin(sblock, c)) {
diff -r 6eeab5ccdc8b -r be3336ffd920 sbin/fsck_ffs/pass4.c
--- a/sbin/fsck_ffs/pass4.c Sun Jun 23 20:32:55 2013 +0000
+++ b/sbin/fsck_ffs/pass4.c Sun Jun 23 22:03:34 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pass4.c,v 1.27 2013/01/22 09:39:12 dholland Exp $ */
+/* $NetBSD: pass4.c,v 1.28 2013/06/23 22:03:34 dholland Exp $ */
/*
* Copyright (c) 1980, 1986, 1993
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)pass4.c 8.4 (Berkeley) 4/28/95";
#else
-__RCSID("$NetBSD: pass4.c,v 1.27 2013/01/22 09:39:12 dholland Exp $");
+__RCSID("$NetBSD: pass4.c,v 1.28 2013/06/23 22:03:34 dholland Exp $");
#endif
#endif /* not lint */
@@ -211,7 +211,7 @@
sblock->fs_cstotal.cs_nbfree++;
sblock->fs_cs(fs, cg).cs_nbfree++;
ffs_clusteracct(sblock, cgp,
- fragstoblks(sblock, dtogd(sblock, idesc->id_blkno)), 1);
+ ffs_fragstoblks(sblock, dtogd(sblock, idesc->id_blkno)), 1);
}
sbdirty();
cgdirty();
diff -r 6eeab5ccdc8b -r be3336ffd920 sbin/fsck_ffs/pass5.c
--- a/sbin/fsck_ffs/pass5.c Sun Jun 23 20:32:55 2013 +0000
+++ b/sbin/fsck_ffs/pass5.c Sun Jun 23 22:03:34 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pass5.c,v 1.53 2013/06/23 07:28:36 dholland Exp $ */
+/* $NetBSD: pass5.c,v 1.54 2013/06/23 22:03:34 dholland Exp $ */
/*
* Copyright (c) 1980, 1986, 1993
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)pass5.c 8.9 (Berkeley) 4/28/95";
#else
-__RCSID("$NetBSD: pass5.c,v 1.53 2013/06/23 07:28:36 dholland Exp $");
+__RCSID("$NetBSD: pass5.c,v 1.54 2013/06/23 22:03:34 dholland Exp $");
#endif
#endif /* not lint */
@@ -160,7 +160,7 @@
newcg->cg_clusteroff = newcg->cg_clustersumoff +
(fs->fs_contigsumsize + 1) * sizeof(u_int32_t);
newcg->cg_nextfreeoff = newcg->cg_clusteroff +
- howmany(fragstoblks(fs, fs->fs_fpg), CHAR_BIT);
+ howmany(ffs_fragstoblks(fs, fs->fs_fpg), CHAR_BIT);
}
newcg->cg_magic = CG_MAGIC;
mapsize = newcg->cg_nextfreeoff - newcg->cg_iusedoff;
@@ -195,7 +195,7 @@
idesc[i].id_fix = FIX;
}
memset(&cstotal, 0, sizeof(struct csum_total));
- dmax = blknum(fs, fs->fs_size + fs->fs_frag - 1);
+ dmax = ffs_blknum(fs, fs->fs_size + fs->fs_frag - 1);
for (d = fs->fs_size; d < dmax; d++)
setbmap(d);
for (c = 0; c < fs->fs_ncg; c++) {
@@ -360,7 +360,7 @@
}
if (fs->fs_contigsumsize > 0)
setbit(cg_clustersfree(newcg, 0),
- fragstoblks(fs, i));
+ ffs_fragstoblks(fs, i));
} else if (frags > 0) {
newcg->cg_cs.cs_nffree += frags;
blk = blkmap(fs, cg_blksfree(newcg, 0), i);
diff -r 6eeab5ccdc8b -r be3336ffd920 sbin/fsck_ffs/utilities.c
--- a/sbin/fsck_ffs/utilities.c Sun Jun 23 20:32:55 2013 +0000
+++ b/sbin/fsck_ffs/utilities.c Sun Jun 23 22:03:34 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: utilities.c,v 1.62 2013/06/23 02:06:04 dholland Exp $ */
+/* $NetBSD: utilities.c,v 1.63 2013/06/23 22:03:34 dholland Exp $ */
/*
* Copyright (c) 1980, 1986, 1993
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)utilities.c 8.6 (Berkeley) 5/19/95";
#else
-__RCSID("$NetBSD: utilities.c,v 1.62 2013/06/23 02:06:04 dholland Exp $");
+__RCSID("$NetBSD: utilities.c,v 1.63 2013/06/23 22:03:34 dholland Exp $");
#endif
#endif /* not lint */
@@ -429,7 +429,7 @@
sblock->fs_cstotal.cs_nbfree--;
sblock->fs_cs(fs, cg).cs_nbfree--;
ffs_clusteracct(sblock, cgp,
- fragstoblks(sblock, baseblk), -1);
+ ffs_fragstoblks(sblock, baseblk), -1);
} else {
cgp->cg_cs.cs_nffree -= frags;
sblock->fs_cstotal.cs_nffree -= frags;
diff -r 6eeab5ccdc8b -r be3336ffd920 sbin/newfs/mkfs.c
--- a/sbin/newfs/mkfs.c Sun Jun 23 20:32:55 2013 +0000
+++ b/sbin/newfs/mkfs.c Sun Jun 23 22:03:34 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: mkfs.c,v 1.119 2013/06/23 07:28:36 dholland Exp $ */
+/* $NetBSD: mkfs.c,v 1.120 2013/06/23 22:03:34 dholland Exp $ */
/*
* Copyright (c) 1980, 1989, 1993
@@ -73,7 +73,7 @@
#if 0
static char sccsid[] = "@(#)mkfs.c 8.11 (Berkeley) 5/3/95";
#else
-__RCSID("$NetBSD: mkfs.c,v 1.119 2013/06/23 07:28:36 dholland Exp $");
+__RCSID("$NetBSD: mkfs.c,v 1.120 2013/06/23 22:03:34 dholland Exp $");
#endif
#endif /* not lint */
@@ -508,12 +508,12 @@
sblock.fs_dsize = sblock.fs_size - sblock.fs_sblkno -
sblock.fs_ncg * (sblock.fs_dblkno - sblock.fs_sblkno);
sblock.fs_cstotal.cs_nbfree =
- fragstoblks(&sblock, sblock.fs_dsize) -
+ ffs_fragstoblks(&sblock, sblock.fs_dsize) -
howmany(csfrags, sblock.fs_frag);
sblock.fs_cstotal.cs_nffree =
- fragnum(&sblock, sblock.fs_size) +
- (fragnum(&sblock, csfrags) > 0 ?
- sblock.fs_frag - fragnum(&sblock, csfrags) : 0);
+ ffs_fragnum(&sblock, sblock.fs_size) +
+ (ffs_fragnum(&sblock, csfrags) > 0 ?
+ sblock.fs_frag - ffs_fragnum(&sblock, csfrags) : 0);
sblock.fs_cstotal.cs_nifree = sblock.fs_ncg * sblock.fs_ipg - UFS_ROOTINO;
sblock.fs_cstotal.cs_ndir = 0;
sblock.fs_dsize -= csfrags;
@@ -828,7 +828,7 @@
acg.cg_clusteroff = acg.cg_clustersumoff +
(sblock.fs_contigsumsize + 1) * sizeof(int32_t);
acg.cg_nextfreeoff = acg.cg_clusteroff +
- howmany(fragstoblks(&sblock, sblock.fs_fpg), CHAR_BIT);
+ howmany(ffs_fragstoblks(&sblock, sblock.fs_fpg), CHAR_BIT);
}
if (acg.cg_nextfreeoff > sblock.fs_cgsize) {
printf("Panic: cylinder group too big\n");
@@ -1298,7 +1298,7 @@
printf("internal error: can't find block in cyl 0\n");
return (0);
goth:
- blkno = fragstoblks(&sblock, d);
+ blkno = ffs_fragstoblks(&sblock, d);
clrblock(&sblock, cg_blksfree(&acg, 0), blkno);
if (sblock.fs_contigsumsize > 0)
clrbit(cg_clustersfree(&acg, 0), blkno);
diff -r 6eeab5ccdc8b -r be3336ffd920 sbin/resize_ffs/resize_ffs.c
--- a/sbin/resize_ffs/resize_ffs.c Sun Jun 23 20:32:55 2013 +0000
+++ b/sbin/resize_ffs/resize_ffs.c Sun Jun 23 22:03:34 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: resize_ffs.c,v 1.37 2013/06/23 07:28:36 dholland Exp $ */
+/* $NetBSD: resize_ffs.c,v 1.38 2013/06/23 22:03:34 dholland Exp $ */
/* From sources sent on February 17, 2003 */
/*-
* As its sole author, I explicitly place this code in the public
@@ -36,7 +36,7 @@
*/
#include <sys/cdefs.h>
-__RCSID("$NetBSD: resize_ffs.c,v 1.37 2013/06/23 07:28:36 dholland Exp $");
+__RCSID("$NetBSD: resize_ffs.c,v 1.38 2013/06/23 22:03:34 dholland Exp $");
#include <sys/disk.h>
#include <sys/disklabel.h>
@@ -527,7 +527,7 @@
cg->cg_clusteroff = cg->cg_clustersumoff +
((newsb->fs_contigsumsize + 1) * sizeof(int32_t));
cg->cg_nextfreeoff = cg->cg_clusteroff +
- howmany(fragstoblks(newsb,newsb->fs_fpg), NBBY);
+ howmany(ffs_fragstoblks(newsb,newsb->fs_fpg), NBBY);
n = dlow / newsb->fs_frag;
if (n > 0) {
set_bits(cg_clustersfree(cg, 0), 0, n);
@@ -706,7 +706,7 @@
fwc = dtogd(newsb, hand);
secondpass = (hand == 0);
bits = cg_blksfree(cgs[cgn], 0);
- cgsize = blknum(newsb, cgs[cgn]->cg_ndblk);
+ cgsize = ffs_blknum(newsb, cgs[cgn]->cg_ndblk);
while (1) {
if (blk_is_set(bits, fwc, newsb->fs_frag))
return (hand);
@@ -723,7 +723,7 @@
cgn = 0;
}
bits = cg_blksfree(cgs[cgn], 0);
- cgsize = blknum(newsb, cgs[cgn]->cg_ndblk);
+ cgsize = ffs_blknum(newsb, cgs[cgn]->cg_ndblk);
}
}
}
diff -r 6eeab5ccdc8b -r be3336ffd920 sbin/scan_ffs/scan_ffs.c
--- a/sbin/scan_ffs/scan_ffs.c Sun Jun 23 20:32:55 2013 +0000
+++ b/sbin/scan_ffs/scan_ffs.c Sun Jun 23 22:03:34 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: scan_ffs.c,v 1.24 2013/06/23 07:28:36 dholland Exp $ */
+/* $NetBSD: scan_ffs.c,v 1.25 2013/06/23 22:03:34 dholland Exp $ */
/*
* Copyright (c) 2005-2007 Juan Romero Pardines
@@ -33,7 +33,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: scan_ffs.c,v 1.24 2013/06/23 07:28:36 dholland Exp $");
+__RCSID("$NetBSD: scan_ffs.c,v 1.25 2013/06/23 22:03:34 dholland Exp $");
#endif /* not lint */
#include <sys/types.h>
@@ -44,25 +44,12 @@
#include <sys/fcntl.h>
#include <sys/mount.h>
-#include <ufs/ufs/dinode.h>
#include <ufs/lfs/lfs.h>
#include <ufs/lfs/lfs_extern.h>
-/* Undefine macros defined by both lfs/lfs.h and ffs/fs.h */
-#undef fragstoblks
-#undef blkstofrags
-#undef fragnum
-#undef blknum
-
+#include <ufs/ufs/dinode.h>
#include <ufs/ffs/fs.h>
-/* Undefine macros defined by both lfs/lfs.h and ffs/fs.h */
-/* ...to make sure we don't later depend on their (ambigious) definition */
-#undef fragstoblks
-#undef blkstofrags
-#undef fragnum
-#undef blknum
-
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
diff -r 6eeab5ccdc8b -r be3336ffd920 sys/ufs/ffs/ffs_alloc.c
--- a/sys/ufs/ffs/ffs_alloc.c Sun Jun 23 20:32:55 2013 +0000
+++ b/sys/ufs/ffs/ffs_alloc.c Sun Jun 23 22:03:34 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ffs_alloc.c,v 1.137 2013/06/23 07:28:37 dholland Exp $ */
+/* $NetBSD: ffs_alloc.c,v 1.138 2013/06/23 22:03:34 dholland Exp $ */
/*-
* Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -70,7 +70,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ffs_alloc.c,v 1.137 2013/06/23 07:28:37 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ffs_alloc.c,v 1.138 2013/06/23 22:03:34 dholland Exp $");
#if defined(_KERNEL_OPT)
#include "opt_ffs.h"
@@ -134,7 +134,7 @@
long size, dev_t dev, ino_t inum)
{
if ((u_int)size > fs->fs_bsize || ffs_fragoff(fs, size) != 0 ||
- fragnum(fs, bno) + ffs_numfrags(fs, size) > fs->fs_frag) {
+ ffs_fragnum(fs, bno) + ffs_numfrags(fs, size) > fs->fs_frag) {
printf("dev = 0x%llx, bno = %" PRId64 " bsize = %d, "
"size = %ld, fs = %s\n",
(long long)dev, bno, fs->fs_bsize, size, fs->fs_fsmnt);
Home |
Main Index |
Thread Index |
Old Index