Print this page
3006 VERIFY[S,U,P] and ASSERT[S,U,P] frequently check if first argument is zero
*** 19,30 ****
--- 19,35 ----
* 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,81 ****
void
space_map_destroy(space_map_t *sm)
{
ASSERT(!sm->sm_loaded && !sm->sm_loading);
! VERIFY3U(sm->sm_space, ==, 0);
avl_destroy(&sm->sm_root);
cv_destroy(&sm->sm_load_cv);
}
void
--- 76,86 ----
void
space_map_destroy(space_map_t *sm)
{
ASSERT(!sm->sm_loaded && !sm->sm_loading);
! VERIFY0(sm->sm_space);
avl_destroy(&sm->sm_root);
cv_destroy(&sm->sm_load_cv);
}
void
*** 284,294 ****
sm->sm_loading = B_TRUE;
end = smo->smo_objsize;
space = smo->smo_alloc;
ASSERT(sm->sm_ops == NULL);
! VERIFY3U(sm->sm_space, ==, 0);
if (maptype == SM_FREE) {
space_map_add(sm, sm->sm_start, sm->sm_size);
space = sm->sm_size - space;
}
--- 289,299 ----
sm->sm_loading = B_TRUE;
end = smo->smo_objsize;
space = smo->smo_alloc;
ASSERT(sm->sm_ops == NULL);
! VERIFY0(sm->sm_space);
if (maptype == SM_FREE) {
space_map_add(sm, sm->sm_start, sm->sm_size);
space = sm->sm_size - space;
}
*** 473,483 ****
smo->smo_objsize += size;
}
zio_buf_free(entry_map, bufsize);
! VERIFY3U(sm->sm_space, ==, 0);
}
void
space_map_truncate(space_map_obj_t *smo, objset_t *os, dmu_tx_t *tx)
{
--- 478,488 ----
smo->smo_objsize += size;
}
zio_buf_free(entry_map, bufsize);
! VERIFY0(sm->sm_space);
}
void
space_map_truncate(space_map_obj_t *smo, objset_t *os, dmu_tx_t *tx)
{