Changeset View
Changeset View
Standalone View
Standalone View
cddl/contrib/opensolaris/cmd/zdb/zdb.c
Show First 20 Lines • Show All 2,275 Lines • ▼ Show 20 Lines | dump_dir(objset_t *os) | ||||
} | } | ||||
object = 0; | object = 0; | ||||
while ((error = dmu_object_next(os, &object, B_FALSE, 0)) == 0) { | while ((error = dmu_object_next(os, &object, B_FALSE, 0)) == 0) { | ||||
dump_object(os, object, verbosity, &print_header); | dump_object(os, object, verbosity, &print_header); | ||||
object_count++; | object_count++; | ||||
} | } | ||||
ASSERT3U(object_count, ==, usedobjs); | |||||
(void) printf("\n"); | (void) printf("\n"); | ||||
if (error != ESRCH) { | if (error != ESRCH) { | ||||
(void) fprintf(stderr, "dmu_object_next() = %d\n", error); | (void) fprintf(stderr, "dmu_object_next() = %d\n", error); | ||||
abort(); | abort(); | ||||
} | } | ||||
ASSERT3U(object_count, ==, usedobjs); | |||||
} | } | ||||
static void | static void | ||||
dump_uberblock(uberblock_t *ub, const char *header, const char *footer) | dump_uberblock(uberblock_t *ub, const char *header, const char *footer) | ||||
{ | { | ||||
time_t timestamp = ub->ub_timestamp; | time_t timestamp = ub->ub_timestamp; | ||||
(void) printf("%s", header ? header : ""); | (void) printf("%s", header ? header : ""); | ||||
▲ Show 20 Lines • Show All 483 Lines • ▼ Show 20 Lines | zdb_blkptr_done(zio_t *zio) | ||||
int ioerr = zio->io_error; | int ioerr = zio->io_error; | ||||
zdb_cb_t *zcb = zio->io_private; | zdb_cb_t *zcb = zio->io_private; | ||||
zbookmark_phys_t *zb = &zio->io_bookmark; | zbookmark_phys_t *zb = &zio->io_bookmark; | ||||
abd_free(zio->io_abd); | abd_free(zio->io_abd); | ||||
mutex_enter(&spa->spa_scrub_lock); | mutex_enter(&spa->spa_scrub_lock); | ||||
spa->spa_scrub_inflight--; | spa->spa_scrub_inflight--; | ||||
spa->spa_load_verify_ios--; | |||||
cv_broadcast(&spa->spa_scrub_io_cv); | cv_broadcast(&spa->spa_scrub_io_cv); | ||||
if (ioerr && !(zio->io_flags & ZIO_FLAG_SPECULATIVE)) { | if (ioerr && !(zio->io_flags & ZIO_FLAG_SPECULATIVE)) { | ||||
char blkbuf[BP_SPRINTF_LEN]; | char blkbuf[BP_SPRINTF_LEN]; | ||||
zcb->zcb_haderrors = 1; | zcb->zcb_haderrors = 1; | ||||
zcb->zcb_errors[ioerr]++; | zcb->zcb_errors[ioerr]++; | ||||
▲ Show 20 Lines • Show All 55 Lines • ▼ Show 20 Lines | if (!BP_IS_EMBEDDED(bp) && | ||||
abd_t *abd = abd_alloc(size, B_FALSE); | abd_t *abd = abd_alloc(size, B_FALSE); | ||||
int flags = ZIO_FLAG_CANFAIL | ZIO_FLAG_SCRUB | ZIO_FLAG_RAW; | int flags = ZIO_FLAG_CANFAIL | ZIO_FLAG_SCRUB | ZIO_FLAG_RAW; | ||||
/* If it's an intent log block, failure is expected. */ | /* If it's an intent log block, failure is expected. */ | ||||
if (zb->zb_level == ZB_ZIL_LEVEL) | if (zb->zb_level == ZB_ZIL_LEVEL) | ||||
flags |= ZIO_FLAG_SPECULATIVE; | flags |= ZIO_FLAG_SPECULATIVE; | ||||
mutex_enter(&spa->spa_scrub_lock); | mutex_enter(&spa->spa_scrub_lock); | ||||
while (spa->spa_scrub_inflight > max_inflight) | while (spa->spa_load_verify_ios > max_inflight) | ||||
cv_wait(&spa->spa_scrub_io_cv, &spa->spa_scrub_lock); | cv_wait(&spa->spa_scrub_io_cv, &spa->spa_scrub_lock); | ||||
spa->spa_scrub_inflight++; | spa->spa_scrub_inflight++; | ||||
spa->spa_load_verify_ios++; | |||||
mutex_exit(&spa->spa_scrub_lock); | mutex_exit(&spa->spa_scrub_lock); | ||||
zio_nowait(zio_read(NULL, spa, bp, abd, size, | zio_nowait(zio_read(NULL, spa, bp, abd, size, | ||||
zdb_blkptr_done, zcb, ZIO_PRIORITY_ASYNC_READ, flags, zb)); | zdb_blkptr_done, zcb, ZIO_PRIORITY_ASYNC_READ, flags, zb)); | ||||
} | } | ||||
zcb->zcb_readfails = 0; | zcb->zcb_readfails = 0; | ||||
▲ Show 20 Lines • Show All 2,502 Lines • Show Last 20 Lines |