aboutsummaryrefslogtreecommitdiff
path: root/cddl/contrib/opensolaris/cmd/zdb/zdb.c
diff options
context:
space:
mode:
authorAlexander Motin <mav@FreeBSD.org>2015-08-12 22:41:06 +0000
committerAlexander Motin <mav@FreeBSD.org>2015-08-12 22:41:06 +0000
commitb696497df0197b0dc72d87fd0fedac61a504d0b7 (patch)
tree66f394e094d8472a37e6c1a6cae22884f36b19e2 /cddl/contrib/opensolaris/cmd/zdb/zdb.c
parent6b5c8394f1e8f5250d60f5117b5fc03833f28b89 (diff)
parentfa4d80aacbc26c4cb733b42af06bcc8a8f6a602f (diff)
downloadsrc-b696497df0197b0dc72d87fd0fedac61a504d0b7.tar.gz
src-b696497df0197b0dc72d87fd0fedac61a504d0b7.zip
MFV r286704: 5960 zfs recv should prefetch indirect blocks
5925 zfs receive -o origin= Reviewed by: Prakash Surya <prakash.surya@delphix.com> Reviewed by: Matthew Ahrens <mahrens@delphix.com> Author: Paul Dagnelie <pcd@delphix.com> While running 'zfs recv' we noticed that every 128th 8K block required a read. We were seeing that restore_write() was calling dmu_tx_hold_write() and the indirect block was not cached. We should prefetch upcoming indirect blocks to avoid having to go to disk and blocking the restore_write(). Allow an incremental send stream to be received as a clone, even if the stream does not mark it as a clone.
Notes
Notes: svn path=/head/; revision=286705
Diffstat (limited to 'cddl/contrib/opensolaris/cmd/zdb/zdb.c')
-rw-r--r--cddl/contrib/opensolaris/cmd/zdb/zdb.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/cddl/contrib/opensolaris/cmd/zdb/zdb.c b/cddl/contrib/opensolaris/cmd/zdb/zdb.c
index 7c5df0bda408..75adc7148463 100644
--- a/cddl/contrib/opensolaris/cmd/zdb/zdb.c
+++ b/cddl/contrib/opensolaris/cmd/zdb/zdb.c
@@ -2428,6 +2428,9 @@ zdb_blkptr_cb(spa_t *spa, zilog_t *zilog, const blkptr_t *bp,
dmu_object_type_t type;
boolean_t is_metadata;
+ if (bp == NULL)
+ return (0);
+
if (dump_opt['b'] >= 5 && bp->blk_birth > 0) {
char blkbuf[BP_SPRINTF_LEN];
snprintf_blkptr(blkbuf, sizeof (blkbuf), bp);
@@ -2917,7 +2920,7 @@ zdb_ddt_add_cb(spa_t *spa, zilog_t *zilog, const blkptr_t *bp,
avl_index_t where;
zdb_ddt_entry_t *zdde, zdde_search;
- if (BP_IS_HOLE(bp) || BP_IS_EMBEDDED(bp))
+ if (bp == NULL || BP_IS_HOLE(bp) || BP_IS_EMBEDDED(bp))
return (0);
if (dump_opt['S'] > 1 && zb->zb_level == ZB_ROOT_LEVEL) {