Print this page
3006 VERIFY[S,U,P] and ASSERT[S,U,P] frequently check if first argument is zero

@@ -19,12 +19,17 @@
  * CDDL HEADER END
  */
 /*
  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
+ *
  */
 
+/*
+ * Copyright (c) 2012 by Delphix. All rights reserved.
+ */
+
 #include <sys/zfs_context.h>
 #include <sys/spa.h>
 #include <sys/dmu.h>
 #include <sys/zio.h>
 #include <sys/space_map.h>

@@ -71,11 +76,11 @@
 
 void
 space_map_destroy(space_map_t *sm)
 {
         ASSERT(!sm->sm_loaded && !sm->sm_loading);
-        VERIFY3U(sm->sm_space, ==, 0);
+        VERIFY0(sm->sm_space);
         avl_destroy(&sm->sm_root);
         cv_destroy(&sm->sm_load_cv);
 }
 
 void

@@ -284,11 +289,11 @@
         sm->sm_loading = B_TRUE;
         end = smo->smo_objsize;
         space = smo->smo_alloc;
 
         ASSERT(sm->sm_ops == NULL);
-        VERIFY3U(sm->sm_space, ==, 0);
+        VERIFY0(sm->sm_space);
 
         if (maptype == SM_FREE) {
                 space_map_add(sm, sm->sm_start, sm->sm_size);
                 space = sm->sm_size - space;
         }

@@ -473,11 +478,11 @@
                 smo->smo_objsize += size;
         }
 
         zio_buf_free(entry_map, bufsize);
 
-        VERIFY3U(sm->sm_space, ==, 0);
+        VERIFY0(sm->sm_space);
 }
 
 void
 space_map_truncate(space_map_obj_t *smo, objset_t *os, dmu_tx_t *tx)
 {