Make use of ZFS_DEBUG consistent within kmod sources

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Signed-off-by: Matt Macy <mmacy@FreeBSD.org>
Closes #10623
This commit is contained in:
Matthew Macy
2020-07-25 20:07:44 -07:00
committed by GitHub
parent f5b189f937
commit 6d8da84106
19 changed files with 39 additions and 34 deletions
+2 -2
View File
@@ -1989,7 +1989,7 @@ dbuf_dirty(dmu_buf_impl_t *db, dmu_tx_t *tx)
* objects may be dirtied in syncing context, but only if they
* were already pre-dirtied in open context.
*/
#ifdef DEBUG
#ifdef ZFS_DEBUG
if (dn->dn_objset->os_dsl_dataset != NULL) {
rrw_enter(&dn->dn_objset->os_dsl_dataset->ds_bp_rwlock,
RW_READER, FTAG);
@@ -2062,7 +2062,7 @@ dbuf_dirty(dmu_buf_impl_t *db, dmu_tx_t *tx)
*/
os = dn->dn_objset;
VERIFY3U(tx->tx_txg, <=, spa_final_dirty_txg(os->os_spa));
#ifdef DEBUG
#ifdef ZFS_DEBUG
if (dn->dn_objset->os_dsl_dataset != NULL)
rrw_enter(&os->os_dsl_dataset->ds_bp_rwlock, RW_READER, FTAG);
ASSERT(!dmu_tx_is_syncing(tx) || DMU_OBJECT_IS_SPECIAL(dn->dn_object) ||
+2 -2
View File
@@ -91,7 +91,7 @@ dnode_increase_indirection(dnode_t *dn, dmu_tx_t *tx)
if (child == NULL)
continue;
#ifdef DEBUG
#ifdef ZFS_DEBUG
DB_DNODE_ENTER(child);
ASSERT3P(DB_DNODE(child), ==, dn);
DB_DNODE_EXIT(child);
@@ -462,7 +462,7 @@ dnode_evict_dbufs(dnode_t *dn)
mutex_enter(&dn->dn_dbufs_mtx);
for (db = avl_first(&dn->dn_dbufs); db != NULL; db = db_next) {
#ifdef DEBUG
#ifdef ZFS_DEBUG
DB_DNODE_ENTER(db);
ASSERT3P(DB_DNODE(db), ==, dn);
DB_DNODE_EXIT(db);
+1 -1
View File
@@ -1553,7 +1553,7 @@ dsl_dir_diduse_space(dsl_dir_t *dd, dd_used_t type,
ASSERT(used > 0 ||
dsl_dir_phys(dd)->dd_used_breakdown[type] >= -used);
dsl_dir_phys(dd)->dd_used_breakdown[type] += used;
#ifdef DEBUG
#ifdef ZFS_DEBUG
{
dd_used_t t;
uint64_t u = 0;
+1 -1
View File
@@ -4401,7 +4401,7 @@ metaslab_trace_add(zio_alloc_list_t *zal, metaslab_group_t *mg,
*/
if (zal->zal_size == metaslab_trace_max_entries) {
metaslab_alloc_trace_t *mat_next;
#ifdef DEBUG
#ifdef ZFS_DEBUG
panic("too many entries in allocation list");
#endif
METASLABSTAT_BUMP(metaslabstat_trace_over_limit);
+1 -1
View File
@@ -33,7 +33,7 @@ int zfs_multilist_num_sublists = 0;
* Given the object contained on the list, return a pointer to the
* object's multilist_node_t structure it contains.
*/
#ifdef DEBUG
#ifdef ZFS_DEBUG
static multilist_node_t *
multilist_d2l(multilist_t *ml, void *obj)
{
+2 -2
View File
@@ -164,7 +164,7 @@ static void
rrw_enter_read_impl(rrwlock_t *rrl, boolean_t prio, void *tag)
{
mutex_enter(&rrl->rr_lock);
#if !defined(DEBUG) && defined(_KERNEL)
#if !defined(ZFS_DEBUG) && defined(_KERNEL)
if (rrl->rr_writer == NULL && !rrl->rr_writer_wanted &&
!rrl->rr_track_all) {
rrl->rr_anon_rcount.rc_count++;
@@ -241,7 +241,7 @@ void
rrw_exit(rrwlock_t *rrl, void *tag)
{
mutex_enter(&rrl->rr_lock);
#if !defined(DEBUG) && defined(_KERNEL)
#if !defined(ZFS_DEBUG) && defined(_KERNEL)
if (!rrl->rr_writer && rrl->rr_linked_rcount.rc_count == 0) {
rrl->rr_anon_rcount.rc_count--;
if (rrl->rr_anon_rcount.rc_count == 0)
+2 -2
View File
@@ -675,7 +675,7 @@ space_map_write_impl(space_map_t *sm, range_tree_t *rt, maptype_t maptype,
space_map_write_intro_debug(sm, maptype, tx);
#ifdef DEBUG
#ifdef ZFS_DEBUG
/*
* We do this right after we write the intro debug entry
* because the estimate does not take it into account.
@@ -736,7 +736,7 @@ space_map_write_impl(space_map_t *sm, range_tree_t *rt, maptype_t maptype,
dmu_buf_rele(db, FTAG);
#ifdef DEBUG
#ifdef ZFS_DEBUG
/*
* We expect our estimation to be based on the worst case
* scenario [see comment in space_map_estimate_optimal_size()].
+2 -2
View File
@@ -4806,7 +4806,7 @@ zfs_allow_log_destroy(void *arg)
kmem_strfree(poolname);
}
#ifdef DEBUG
#ifdef ZFS_DEBUG
static boolean_t zfs_ioc_recv_inject_err;
#endif
@@ -5019,7 +5019,7 @@ zfs_ioc_recv_impl(char *tofs, char *tosnap, char *origin, nvlist_t *recvprops,
}
*read_bytes = off - noff;
#ifdef DEBUG
#ifdef ZFS_DEBUG
if (zfs_ioc_recv_inject_err) {
zfs_ioc_recv_inject_err = B_FALSE;
error = 1;