Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 19 Jun 2013 20:56:44 +0000 (UTC)
From:      "Pedro F. Giffuni" <pfg@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject:   svn commit: r252008 - stable/9/sys/fs/ext2fs
Message-ID:  <201306192056.r5JKuid4073966@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: pfg
Date: Wed Jun 19 20:56:44 2013
New Revision: 252008
URL: http://svnweb.freebsd.org/changeset/base/252008

Log:
  MFC	r251658, 251823:
  
  Turn DIAGNOSTICs to INVARIANTS in ext2fs. following other filesystems.

Modified:
  stable/9/sys/fs/ext2fs/ext2_alloc.c
  stable/9/sys/fs/ext2fs/ext2_balloc.c
  stable/9/sys/fs/ext2fs/ext2_bmap.c
  stable/9/sys/fs/ext2fs/ext2_inode.c
  stable/9/sys/fs/ext2fs/ext2_lookup.c
  stable/9/sys/fs/ext2fs/ext2_vnops.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/fs/   (props changed)

Modified: stable/9/sys/fs/ext2fs/ext2_alloc.c
==============================================================================
--- stable/9/sys/fs/ext2fs/ext2_alloc.c	Wed Jun 19 20:48:34 2013	(r252007)
+++ stable/9/sys/fs/ext2fs/ext2_alloc.c	Wed Jun 19 20:56:44 2013	(r252008)
@@ -91,7 +91,7 @@ ext2_alloc(struct inode *ip, int32_t lbn
 	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
 	}
 	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_
 	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_
 	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_
 			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);

Modified: stable/9/sys/fs/ext2fs/ext2_balloc.c
==============================================================================
--- stable/9/sys/fs/ext2fs/ext2_balloc.c	Wed Jun 19 20:48:34 2013	(r252007)
+++ stable/9/sys/fs/ext2fs/ext2_balloc.c	Wed Jun 19 20:56:44 2013	(r252008)
@@ -152,7 +152,7 @@ ext2_balloc(struct inode *ip, int32_t lb
 	pref = 0;
 	if ((error = ext2_getlbns(vp, lbn, indirs, &num)) != 0)
 		return (error);
-#ifdef DIAGNOSTIC
+#ifdef INVARIANTS
 	if (num < 1)
 		panic ("ext2_balloc: ext2_getlbns returned indirect block");
 #endif

Modified: stable/9/sys/fs/ext2fs/ext2_bmap.c
==============================================================================
--- stable/9/sys/fs/ext2fs/ext2_bmap.c	Wed Jun 19 20:48:34 2013	(r252007)
+++ stable/9/sys/fs/ext2fs/ext2_bmap.c	Wed Jun 19 20:56:44 2013	(r252008)
@@ -172,7 +172,7 @@ ext2_bmaparray(struct vnode *vp, int32_t
 
 		bp = getblk(vp, metalbn, bsize, 0, 0, 0);
 		if ((bp->b_flags & B_CACHE) == 0) {
-#ifdef DIAGNOSTIC
+#ifdef INVARIANTS
 			if (!daddr)
 				panic("ext2_bmaparray: indirect block not in cache");
 #endif

Modified: stable/9/sys/fs/ext2fs/ext2_inode.c
==============================================================================
--- stable/9/sys/fs/ext2fs/ext2_inode.c	Wed Jun 19 20:48:34 2013	(r252007)
+++ stable/9/sys/fs/ext2fs/ext2_inode.c	Wed Jun 19 20:56:44 2013	(r252008)
@@ -132,7 +132,7 @@ ext2_truncate(struct vnode *vp, off_t le
 
 	if (ovp->v_type == VLNK &&
 	    oip->i_size < ovp->v_mount->mnt_maxsymlinklen) {
-#ifdef DIAGNOSTIC
+#ifdef INVARIANTS
 		if (length != 0)
 			panic("ext2_truncate: partial truncate of symlink");
 #endif
@@ -318,7 +318,7 @@ ext2_truncate(struct vnode *vp, off_t le
 		}
 	}
 done:
-#ifdef DIAGNOSTIC
+#ifdef INVARIANTS
 	for (level = SINGLE; level <= TRIPLE; level++)
 		if (newblks[NDADDR + level] != oip->i_ib[level])
 			panic("itrunc1");
@@ -330,7 +330,7 @@ done:
 	    bo->bo_clean.bv_cnt != 0))
 		panic("itrunc3");
 	BO_UNLOCK(bo);
-#endif /* DIAGNOSTIC */
+#endif /* INVARIANTS */
 	/*
 	 * Put back the real size.
 	 */

Modified: stable/9/sys/fs/ext2fs/ext2_lookup.c
==============================================================================
--- stable/9/sys/fs/ext2fs/ext2_lookup.c	Wed Jun 19 20:48:34 2013	(r252007)
+++ stable/9/sys/fs/ext2fs/ext2_lookup.c	Wed Jun 19 20:56:44 2013	(r252008)
@@ -62,7 +62,7 @@
 #include <fs/ext2fs/ext2_dir.h>
 #include <fs/ext2fs/ext2_extern.h>
 
-#ifdef DIAGNOSTIC
+#ifdef INVARIANTS
 static int dirchk = 1;
 #else
 static int dirchk = 0;
@@ -790,7 +790,7 @@ ext2_direnter(struct inode *ip, struct v
 	int     DIRBLKSIZ = ip->i_e2fs->e2fs_bsize;
 
 
-#ifdef DIAGNOSTIC
+#ifdef INVARIANTS
 	if ((cnp->cn_flags & SAVENAME) == 0)
 		panic("ext2_direnter: missing name");
 #endif

Modified: stable/9/sys/fs/ext2fs/ext2_vnops.c
==============================================================================
--- stable/9/sys/fs/ext2fs/ext2_vnops.c	Wed Jun 19 20:48:34 2013	(r252007)
+++ stable/9/sys/fs/ext2fs/ext2_vnops.c	Wed Jun 19 20:56:44 2013	(r252008)
@@ -663,7 +663,7 @@ ext2_link(struct vop_link_args *ap)
 	struct inode *ip;
 	int error;
 
-#ifdef DIAGNOSTIC
+#ifdef INVARIANTS
 	if ((cnp->cn_flags & HASBUF) == 0)
 		panic("ext2_link: no name");
 #endif
@@ -732,7 +732,7 @@ ext2_rename(struct vop_rename_args *ap)
 	int error = 0;
 	u_char namlen;
 
-#ifdef DIAGNOSTIC
+#ifdef INVARIANTS
 	if ((tcnp->cn_flags & HASBUF) == 0 ||
 	    (fcnp->cn_flags & HASBUF) == 0)
 		panic("ext2_rename: no name");
@@ -1083,7 +1083,7 @@ ext2_mkdir(struct vop_mkdir_args *ap)
 	struct dirtemplate dirtemplate, *dtp;
 	int error, dmode;
 
-#ifdef DIAGNOSTIC
+#ifdef INVARIANTS
 	if ((cnp->cn_flags & HASBUF) == 0)
 		panic("ext2_mkdir: no name");
 #endif
@@ -1492,7 +1492,7 @@ ext2_makeinode(int mode, struct vnode *d
 	int error;
 
 	pdir = VTOI(dvp);
-#ifdef DIAGNOSTIC
+#ifdef INVARIANTS
 	if ((cnp->cn_flags & HASBUF) == 0)
 		panic("ext2_makeinode: no name");
 #endif



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201306192056.r5JKuid4073966>