summaryrefslogtreecommitdiffstats
path: root/sys/fs/ext2fs/ext2_alloc.c
diff options
context:
space:
mode:
authorpfg <pfg@FreeBSD.org>2013-06-12 15:24:48 +0000
committerpfg <pfg@FreeBSD.org>2013-06-12 15:24:48 +0000
commite9fce1a99bb1f52b532c647c3040010a94d812b5 (patch)
treed8d8828b3ecb08de96c03f5fd63df613e7247e2b /sys/fs/ext2fs/ext2_alloc.c
parent29fa0ac530bb04c4601ecd54027ea264399741c2 (diff)
downloadFreeBSD-src-e9fce1a99bb1f52b532c647c3040010a94d812b5.zip
FreeBSD-src-e9fce1a99bb1f52b532c647c3040010a94d812b5.tar.gz
Turn DIAGNOSTICs to INVARIANTS in ext2fs.
This is done to be consistent with what other filesystems and particularly ffs already does (see r173464). MFC after: 5 days
Diffstat (limited to 'sys/fs/ext2fs/ext2_alloc.c')
-rw-r--r--sys/fs/ext2fs/ext2_alloc.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/sys/fs/ext2fs/ext2_alloc.c b/sys/fs/ext2fs/ext2_alloc.c
index 633ac28..3bd5f3a 100644
--- a/sys/fs/ext2fs/ext2_alloc.c
+++ b/sys/fs/ext2fs/ext2_alloc.c
@@ -91,7 +91,7 @@ ext2_alloc(struct inode *ip, int32_t lbn, int32_t bpref, int size,
fs = ip->i_e2fs;
ump = ip->i_ump;
mtx_assert(EXT2_MTX(ump), MA_OWNED);
-#ifdef DIAGNOSTIC
+#ifdef INVARIANTS
if ((u_int)size > fs->e2fs_bsize || blkoff(fs, size) != 0) {
vn_printf(ip->i_devvp, "bsize = %lu, size = %d, fs = %s\n",
(long unsigned int)fs->e2fs_bsize, size, fs->e2fs_fsmnt);
@@ -99,7 +99,7 @@ ext2_alloc(struct inode *ip, int32_t lbn, int32_t bpref, int size,
}
if (cred == NOCRED)
panic("ext2_alloc: missing credential");
-#endif /* DIAGNOSTIC */
+#endif /* INVARIANTS */
if (size == fs->e2fs_bsize && fs->e2fs->e2fs_fbcount == 0)
goto nospace;
if (cred->cr_uid != 0 &&
@@ -183,7 +183,7 @@ ext2_reallocblks(struct vop_reallocblks_args *ap)
len = buflist->bs_nchildren;
start_lbn = buflist->bs_children[0]->b_lblkno;
end_lbn = start_lbn + len - 1;
-#ifdef DIAGNOSTIC
+#ifdef INVARIANTS
for (i = 1; i < len; i++)
if (buflist->bs_children[i]->b_lblkno != start_lbn + i)
panic("ext2_reallocblks: non-cluster");
@@ -232,7 +232,7 @@ ext2_reallocblks(struct vop_reallocblks_args *ap)
if (end_lvl == 0 || (idp = &end_ap[end_lvl - 1])->in_off + 1 >= len) {
ssize = len;
} else {
-#ifdef DIAGNOSTIC
+#ifdef INVARIANTS
if (start_ap[start_lvl-1].in_lbn == idp->in_lbn)
panic("ext2_reallocblks: start == end");
#endif
@@ -271,7 +271,7 @@ ext2_reallocblks(struct vop_reallocblks_args *ap)
bap = ebap;
soff = -i;
}
-#ifdef DIAGNOSTIC
+#ifdef INVARIANTS
if (buflist->bs_children[i]->b_blkno != fsbtodb(fs, *bap))
panic("ext2_reallocblks: alloc mismatch");
#endif
@@ -748,7 +748,7 @@ retry:
return (0);
}
gotit:
-#ifdef DIAGNOSTIC
+#ifdef INVARIANTS
if (isset(bbp, bno)) {
printf("ext2fs_alloccgblk: cg=%d bno=%jd fs=%s\n",
cg, (intmax_t)bno, fs->e2fs_fsmnt);
OpenPOWER on IntegriCloud