mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2024-12-25 18:59:33 +03:00
Illumos #3498 panic in arc_read()
3498 panic in arc_read(): !refcount_is_zero(&pbuf->b_hdr->b_refcnt) Reviewed by: Adam Leventhal <ahl@delphix.com> Reviewed by: Matthew Ahrens <mahrens@delphix.com> Approved by: Richard Lowe <richlowe@richlowe.net> References: illumos/illumos-gate@1b912ec710 https://www.illumos.org/issues/3498 Ported-by: Brian Behlendorf <behlendorf1@llnl.gov> Closes #1249
This commit is contained in:
parent
96b89346c0
commit
294f68063b
@ -996,7 +996,7 @@ visit_indirect(spa_t *spa, const dnode_phys_t *dnp,
|
|||||||
arc_buf_t *buf;
|
arc_buf_t *buf;
|
||||||
uint64_t fill = 0;
|
uint64_t fill = 0;
|
||||||
|
|
||||||
err = arc_read_nolock(NULL, spa, bp, arc_getbuf_func, &buf,
|
err = arc_read(NULL, spa, bp, arc_getbuf_func, &buf,
|
||||||
ZIO_PRIORITY_ASYNC_READ, ZIO_FLAG_CANFAIL, &flags, zb);
|
ZIO_PRIORITY_ASYNC_READ, ZIO_FLAG_CANFAIL, &flags, zb);
|
||||||
if (err)
|
if (err)
|
||||||
return (err);
|
return (err);
|
||||||
@ -2048,9 +2048,8 @@ zdb_blkptr_done(zio_t *zio)
|
|||||||
mutex_exit(&spa->spa_scrub_lock);
|
mutex_exit(&spa->spa_scrub_lock);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ARGSUSED */
|
|
||||||
static int
|
static int
|
||||||
zdb_blkptr_cb(spa_t *spa, zilog_t *zilog, const blkptr_t *bp, arc_buf_t *pbuf,
|
zdb_blkptr_cb(spa_t *spa, zilog_t *zilog, const blkptr_t *bp,
|
||||||
const zbookmark_t *zb, const dnode_phys_t *dnp, void *arg)
|
const zbookmark_t *zb, const dnode_phys_t *dnp, void *arg)
|
||||||
{
|
{
|
||||||
zdb_cb_t *zcb = arg;
|
zdb_cb_t *zcb = arg;
|
||||||
@ -2457,7 +2456,7 @@ typedef struct zdb_ddt_entry {
|
|||||||
/* ARGSUSED */
|
/* ARGSUSED */
|
||||||
static int
|
static int
|
||||||
zdb_ddt_add_cb(spa_t *spa, zilog_t *zilog, const blkptr_t *bp,
|
zdb_ddt_add_cb(spa_t *spa, zilog_t *zilog, const blkptr_t *bp,
|
||||||
arc_buf_t *pbuf, const zbookmark_t *zb, const dnode_phys_t *dnp, void *arg)
|
const zbookmark_t *zb, const dnode_phys_t *dnp, void *arg)
|
||||||
{
|
{
|
||||||
avl_tree_t *t = arg;
|
avl_tree_t *t = arg;
|
||||||
avl_index_t where;
|
avl_index_t where;
|
||||||
|
@ -60,7 +60,6 @@ struct arc_buf {
|
|||||||
arc_buf_hdr_t *b_hdr;
|
arc_buf_hdr_t *b_hdr;
|
||||||
arc_buf_t *b_next;
|
arc_buf_t *b_next;
|
||||||
kmutex_t b_evict_lock;
|
kmutex_t b_evict_lock;
|
||||||
krwlock_t b_data_lock;
|
|
||||||
void *b_data;
|
void *b_data;
|
||||||
arc_evict_func_t *b_efunc;
|
arc_evict_func_t *b_efunc;
|
||||||
void *b_private;
|
void *b_private;
|
||||||
@ -104,8 +103,6 @@ void arc_buf_add_ref(arc_buf_t *buf, void *tag);
|
|||||||
int arc_buf_remove_ref(arc_buf_t *buf, void *tag);
|
int arc_buf_remove_ref(arc_buf_t *buf, void *tag);
|
||||||
int arc_buf_size(arc_buf_t *buf);
|
int arc_buf_size(arc_buf_t *buf);
|
||||||
void arc_release(arc_buf_t *buf, void *tag);
|
void arc_release(arc_buf_t *buf, void *tag);
|
||||||
int arc_release_bp(arc_buf_t *buf, void *tag, blkptr_t *bp, spa_t *spa,
|
|
||||||
zbookmark_t *zb);
|
|
||||||
int arc_released(arc_buf_t *buf);
|
int arc_released(arc_buf_t *buf);
|
||||||
int arc_has_callback(arc_buf_t *buf);
|
int arc_has_callback(arc_buf_t *buf);
|
||||||
void arc_buf_freeze(arc_buf_t *buf);
|
void arc_buf_freeze(arc_buf_t *buf);
|
||||||
@ -115,10 +112,7 @@ boolean_t arc_buf_eviction_needed(arc_buf_t *buf);
|
|||||||
int arc_referenced(arc_buf_t *buf);
|
int arc_referenced(arc_buf_t *buf);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int arc_read(zio_t *pio, spa_t *spa, const blkptr_t *bp, arc_buf_t *pbuf,
|
int arc_read(zio_t *pio, spa_t *spa, const blkptr_t *bp,
|
||||||
arc_done_func_t *done, void *private, int priority, int zio_flags,
|
|
||||||
uint32_t *arc_flags, const zbookmark_t *zb);
|
|
||||||
int arc_read_nolock(zio_t *pio, spa_t *spa, const blkptr_t *bp,
|
|
||||||
arc_done_func_t *done, void *private, int priority, int flags,
|
arc_done_func_t *done, void *private, int priority, int flags,
|
||||||
uint32_t *arc_flags, const zbookmark_t *zb);
|
uint32_t *arc_flags, const zbookmark_t *zb);
|
||||||
zio_t *arc_write(zio_t *pio, spa_t *spa, uint64_t txg,
|
zio_t *arc_write(zio_t *pio, spa_t *spa, uint64_t txg,
|
||||||
|
@ -40,8 +40,7 @@ struct zilog;
|
|||||||
struct arc_buf;
|
struct arc_buf;
|
||||||
|
|
||||||
typedef int (blkptr_cb_t)(spa_t *spa, zilog_t *zilog, const blkptr_t *bp,
|
typedef int (blkptr_cb_t)(spa_t *spa, zilog_t *zilog, const blkptr_t *bp,
|
||||||
struct arc_buf *pbuf, const zbookmark_t *zb, const struct dnode_phys *dnp,
|
const zbookmark_t *zb, const struct dnode_phys *dnp, void *arg);
|
||||||
void *arg);
|
|
||||||
|
|
||||||
#define TRAVERSE_PRE (1<<0)
|
#define TRAVERSE_PRE (1<<0)
|
||||||
#define TRAVERSE_POST (1<<1)
|
#define TRAVERSE_POST (1<<1)
|
||||||
|
@ -147,12 +147,6 @@ void dsl_pool_willuse_space(dsl_pool_t *dp, int64_t space, dmu_tx_t *tx);
|
|||||||
void dsl_free(dsl_pool_t *dp, uint64_t txg, const blkptr_t *bpp);
|
void dsl_free(dsl_pool_t *dp, uint64_t txg, const blkptr_t *bpp);
|
||||||
void dsl_free_sync(zio_t *pio, dsl_pool_t *dp, uint64_t txg,
|
void dsl_free_sync(zio_t *pio, dsl_pool_t *dp, uint64_t txg,
|
||||||
const blkptr_t *bpp);
|
const blkptr_t *bpp);
|
||||||
int dsl_read(zio_t *pio, spa_t *spa, const blkptr_t *bpp, arc_buf_t *pbuf,
|
|
||||||
arc_done_func_t *done, void *private, int priority, int zio_flags,
|
|
||||||
uint32_t *arc_flags, const zbookmark_t *zb);
|
|
||||||
int dsl_read_nolock(zio_t *pio, spa_t *spa, const blkptr_t *bpp,
|
|
||||||
arc_done_func_t *done, void *private, int priority, int zio_flags,
|
|
||||||
uint32_t *arc_flags, const zbookmark_t *zb);
|
|
||||||
void dsl_pool_create_origin(dsl_pool_t *dp, dmu_tx_t *tx);
|
void dsl_pool_create_origin(dsl_pool_t *dp, dmu_tx_t *tx);
|
||||||
void dsl_pool_upgrade_clones(dsl_pool_t *dp, dmu_tx_t *tx);
|
void dsl_pool_upgrade_clones(dsl_pool_t *dp, dmu_tx_t *tx);
|
||||||
void dsl_pool_upgrade_dir_clones(dsl_pool_t *dp, dmu_tx_t *tx);
|
void dsl_pool_upgrade_dir_clones(dsl_pool_t *dp, dmu_tx_t *tx);
|
||||||
|
@ -884,7 +884,6 @@ buf_cons(void *vbuf, void *unused, int kmflag)
|
|||||||
|
|
||||||
bzero(buf, sizeof (arc_buf_t));
|
bzero(buf, sizeof (arc_buf_t));
|
||||||
mutex_init(&buf->b_evict_lock, NULL, MUTEX_DEFAULT, NULL);
|
mutex_init(&buf->b_evict_lock, NULL, MUTEX_DEFAULT, NULL);
|
||||||
rw_init(&buf->b_data_lock, NULL, RW_DEFAULT, NULL);
|
|
||||||
arc_space_consume(sizeof (arc_buf_t), ARC_SPACE_HDRS);
|
arc_space_consume(sizeof (arc_buf_t), ARC_SPACE_HDRS);
|
||||||
|
|
||||||
return (0);
|
return (0);
|
||||||
@ -914,7 +913,6 @@ buf_dest(void *vbuf, void *unused)
|
|||||||
arc_buf_t *buf = vbuf;
|
arc_buf_t *buf = vbuf;
|
||||||
|
|
||||||
mutex_destroy(&buf->b_evict_lock);
|
mutex_destroy(&buf->b_evict_lock);
|
||||||
rw_destroy(&buf->b_data_lock);
|
|
||||||
arc_space_return(sizeof (arc_buf_t), ARC_SPACE_HDRS);
|
arc_space_return(sizeof (arc_buf_t), ARC_SPACE_HDRS);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2907,42 +2905,11 @@ arc_read_done(zio_t *zio)
|
|||||||
*
|
*
|
||||||
* arc_read_done() will invoke all the requested "done" functions
|
* arc_read_done() will invoke all the requested "done" functions
|
||||||
* for readers of this block.
|
* for readers of this block.
|
||||||
*
|
|
||||||
* Normal callers should use arc_read and pass the arc buffer and offset
|
|
||||||
* for the bp. But if you know you don't need locking, you can use
|
|
||||||
* arc_read_bp.
|
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
arc_read(zio_t *pio, spa_t *spa, const blkptr_t *bp, arc_buf_t *pbuf,
|
arc_read(zio_t *pio, spa_t *spa, const blkptr_t *bp, arc_done_func_t *done,
|
||||||
arc_done_func_t *done, void *private, int priority, int zio_flags,
|
void *private, int priority, int zio_flags, uint32_t *arc_flags,
|
||||||
uint32_t *arc_flags, const zbookmark_t *zb)
|
const zbookmark_t *zb)
|
||||||
{
|
|
||||||
int err;
|
|
||||||
|
|
||||||
if (pbuf == NULL) {
|
|
||||||
/*
|
|
||||||
* XXX This happens from traverse callback funcs, for
|
|
||||||
* the objset_phys_t block.
|
|
||||||
*/
|
|
||||||
return (arc_read_nolock(pio, spa, bp, done, private, priority,
|
|
||||||
zio_flags, arc_flags, zb));
|
|
||||||
}
|
|
||||||
|
|
||||||
ASSERT(!refcount_is_zero(&pbuf->b_hdr->b_refcnt));
|
|
||||||
ASSERT3U((char *)bp - (char *)pbuf->b_data, <, pbuf->b_hdr->b_size);
|
|
||||||
rw_enter(&pbuf->b_data_lock, RW_READER);
|
|
||||||
|
|
||||||
err = arc_read_nolock(pio, spa, bp, done, private, priority,
|
|
||||||
zio_flags, arc_flags, zb);
|
|
||||||
rw_exit(&pbuf->b_data_lock);
|
|
||||||
|
|
||||||
return (err);
|
|
||||||
}
|
|
||||||
|
|
||||||
int
|
|
||||||
arc_read_nolock(zio_t *pio, spa_t *spa, const blkptr_t *bp,
|
|
||||||
arc_done_func_t *done, void *private, int priority, int zio_flags,
|
|
||||||
uint32_t *arc_flags, const zbookmark_t *zb)
|
|
||||||
{
|
{
|
||||||
arc_buf_hdr_t *hdr;
|
arc_buf_hdr_t *hdr;
|
||||||
arc_buf_t *buf = NULL;
|
arc_buf_t *buf = NULL;
|
||||||
@ -3480,19 +3447,6 @@ arc_release(arc_buf_t *buf, void *tag)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Release this buffer. If it does not match the provided BP, fill it
|
|
||||||
* with that block's contents.
|
|
||||||
*/
|
|
||||||
/* ARGSUSED */
|
|
||||||
int
|
|
||||||
arc_release_bp(arc_buf_t *buf, void *tag, blkptr_t *bp, spa_t *spa,
|
|
||||||
zbookmark_t *zb)
|
|
||||||
{
|
|
||||||
arc_release(buf, tag);
|
|
||||||
return (0);
|
|
||||||
}
|
|
||||||
|
|
||||||
int
|
int
|
||||||
arc_released(arc_buf_t *buf)
|
arc_released(arc_buf_t *buf)
|
||||||
{
|
{
|
||||||
|
@ -135,7 +135,7 @@ bptree_add(objset_t *os, uint64_t obj, blkptr_t *bp, uint64_t birth_txg,
|
|||||||
|
|
||||||
/* ARGSUSED */
|
/* ARGSUSED */
|
||||||
static int
|
static int
|
||||||
bptree_visit_cb(spa_t *spa, zilog_t *zilog, const blkptr_t *bp, arc_buf_t *pbuf,
|
bptree_visit_cb(spa_t *spa, zilog_t *zilog, const blkptr_t *bp,
|
||||||
const zbookmark_t *zb, const dnode_phys_t *dnp, void *arg)
|
const zbookmark_t *zb, const dnode_phys_t *dnp, void *arg)
|
||||||
{
|
{
|
||||||
int err;
|
int err;
|
||||||
|
@ -559,7 +559,6 @@ dbuf_read_impl(dmu_buf_impl_t *db, zio_t *zio, uint32_t *flags)
|
|||||||
spa_t *spa;
|
spa_t *spa;
|
||||||
zbookmark_t zb;
|
zbookmark_t zb;
|
||||||
uint32_t aflags = ARC_NOWAIT;
|
uint32_t aflags = ARC_NOWAIT;
|
||||||
arc_buf_t *pbuf;
|
|
||||||
|
|
||||||
DB_DNODE_ENTER(db);
|
DB_DNODE_ENTER(db);
|
||||||
dn = DB_DNODE(db);
|
dn = DB_DNODE(db);
|
||||||
@ -621,14 +620,8 @@ dbuf_read_impl(dmu_buf_impl_t *db, zio_t *zio, uint32_t *flags)
|
|||||||
db->db.db_object, db->db_level, db->db_blkid);
|
db->db.db_object, db->db_level, db->db_blkid);
|
||||||
|
|
||||||
dbuf_add_ref(db, NULL);
|
dbuf_add_ref(db, NULL);
|
||||||
/* ZIO_FLAG_CANFAIL callers have to check the parent zio's error */
|
|
||||||
|
|
||||||
if (db->db_parent)
|
(void) arc_read(zio, spa, db->db_blkptr,
|
||||||
pbuf = db->db_parent->db_buf;
|
|
||||||
else
|
|
||||||
pbuf = db->db_objset->os_phys_buf;
|
|
||||||
|
|
||||||
(void) dsl_read(zio, spa, db->db_blkptr, pbuf,
|
|
||||||
dbuf_read_done, db, ZIO_PRIORITY_SYNC_READ,
|
dbuf_read_done, db, ZIO_PRIORITY_SYNC_READ,
|
||||||
(*flags & DB_RF_CANFAIL) ? ZIO_FLAG_CANFAIL : ZIO_FLAG_MUSTSUCCEED,
|
(*flags & DB_RF_CANFAIL) ? ZIO_FLAG_CANFAIL : ZIO_FLAG_MUSTSUCCEED,
|
||||||
&aflags, &zb);
|
&aflags, &zb);
|
||||||
@ -1026,7 +1019,6 @@ void
|
|||||||
dbuf_release_bp(dmu_buf_impl_t *db)
|
dbuf_release_bp(dmu_buf_impl_t *db)
|
||||||
{
|
{
|
||||||
objset_t *os;
|
objset_t *os;
|
||||||
zbookmark_t zb;
|
|
||||||
|
|
||||||
DB_GET_OBJSET(&os, db);
|
DB_GET_OBJSET(&os, db);
|
||||||
ASSERT(dsl_pool_sync_context(dmu_objset_pool(os)));
|
ASSERT(dsl_pool_sync_context(dmu_objset_pool(os)));
|
||||||
@ -1034,13 +1026,7 @@ dbuf_release_bp(dmu_buf_impl_t *db)
|
|||||||
list_link_active(&os->os_dsl_dataset->ds_synced_link));
|
list_link_active(&os->os_dsl_dataset->ds_synced_link));
|
||||||
ASSERT(db->db_parent == NULL || arc_released(db->db_parent->db_buf));
|
ASSERT(db->db_parent == NULL || arc_released(db->db_parent->db_buf));
|
||||||
|
|
||||||
zb.zb_objset = os->os_dsl_dataset ?
|
(void) arc_release(db->db_buf, db);
|
||||||
os->os_dsl_dataset->ds_object : 0;
|
|
||||||
zb.zb_object = db->db.db_object;
|
|
||||||
zb.zb_level = db->db_level;
|
|
||||||
zb.zb_blkid = db->db_blkid;
|
|
||||||
(void) arc_release_bp(db->db_buf, db,
|
|
||||||
db->db_blkptr, os->os_spa, &zb);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
dbuf_dirty_record_t *
|
dbuf_dirty_record_t *
|
||||||
@ -1886,7 +1872,6 @@ dbuf_prefetch(dnode_t *dn, uint64_t blkid)
|
|||||||
if (bp && !BP_IS_HOLE(bp)) {
|
if (bp && !BP_IS_HOLE(bp)) {
|
||||||
int priority = dn->dn_type == DMU_OT_DDT_ZAP ?
|
int priority = dn->dn_type == DMU_OT_DDT_ZAP ?
|
||||||
ZIO_PRIORITY_DDT_PREFETCH : ZIO_PRIORITY_ASYNC_READ;
|
ZIO_PRIORITY_DDT_PREFETCH : ZIO_PRIORITY_ASYNC_READ;
|
||||||
arc_buf_t *pbuf;
|
|
||||||
dsl_dataset_t *ds = dn->dn_objset->os_dsl_dataset;
|
dsl_dataset_t *ds = dn->dn_objset->os_dsl_dataset;
|
||||||
uint32_t aflags = ARC_NOWAIT | ARC_PREFETCH;
|
uint32_t aflags = ARC_NOWAIT | ARC_PREFETCH;
|
||||||
zbookmark_t zb;
|
zbookmark_t zb;
|
||||||
@ -1894,13 +1879,8 @@ dbuf_prefetch(dnode_t *dn, uint64_t blkid)
|
|||||||
SET_BOOKMARK(&zb, ds ? ds->ds_object : DMU_META_OBJSET,
|
SET_BOOKMARK(&zb, ds ? ds->ds_object : DMU_META_OBJSET,
|
||||||
dn->dn_object, 0, blkid);
|
dn->dn_object, 0, blkid);
|
||||||
|
|
||||||
if (db)
|
(void) arc_read(NULL, dn->dn_objset->os_spa,
|
||||||
pbuf = db->db_buf;
|
bp, NULL, NULL, priority,
|
||||||
else
|
|
||||||
pbuf = dn->dn_objset->os_phys_buf;
|
|
||||||
|
|
||||||
(void) dsl_read(NULL, dn->dn_objset->os_spa,
|
|
||||||
bp, pbuf, NULL, NULL, priority,
|
|
||||||
ZIO_FLAG_CANFAIL | ZIO_FLAG_SPECULATIVE,
|
ZIO_FLAG_CANFAIL | ZIO_FLAG_SPECULATIVE,
|
||||||
&aflags, &zb);
|
&aflags, &zb);
|
||||||
}
|
}
|
||||||
|
@ -105,7 +105,7 @@ report_dnode(struct diffarg *da, uint64_t object, dnode_phys_t *dnp)
|
|||||||
|
|
||||||
/* ARGSUSED */
|
/* ARGSUSED */
|
||||||
static int
|
static int
|
||||||
diff_cb(spa_t *spa, zilog_t *zilog, const blkptr_t *bp, arc_buf_t *pbuf,
|
diff_cb(spa_t *spa, zilog_t *zilog, const blkptr_t *bp,
|
||||||
const zbookmark_t *zb, const dnode_phys_t *dnp, void *arg)
|
const zbookmark_t *zb, const dnode_phys_t *dnp, void *arg)
|
||||||
{
|
{
|
||||||
struct diffarg *da = arg;
|
struct diffarg *da = arg;
|
||||||
@ -132,9 +132,9 @@ diff_cb(spa_t *spa, zilog_t *zilog, const blkptr_t *bp, arc_buf_t *pbuf,
|
|||||||
int blksz = BP_GET_LSIZE(bp);
|
int blksz = BP_GET_LSIZE(bp);
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if (dsl_read(NULL, spa, bp, pbuf,
|
if (arc_read(NULL, spa, bp, arc_getbuf_func, &abuf,
|
||||||
arc_getbuf_func, &abuf, ZIO_PRIORITY_ASYNC_READ,
|
ZIO_PRIORITY_ASYNC_READ, ZIO_FLAG_CANFAIL,
|
||||||
ZIO_FLAG_CANFAIL, &aflags, zb) != 0)
|
&aflags, zb) != 0)
|
||||||
return (EIO);
|
return (EIO);
|
||||||
|
|
||||||
blk = abuf->b_data;
|
blk = abuf->b_data;
|
||||||
|
@ -276,12 +276,7 @@ dmu_objset_open_impl(spa_t *spa, dsl_dataset_t *ds, blkptr_t *bp,
|
|||||||
aflags |= ARC_L2CACHE;
|
aflags |= ARC_L2CACHE;
|
||||||
|
|
||||||
dprintf_bp(os->os_rootbp, "reading %s", "");
|
dprintf_bp(os->os_rootbp, "reading %s", "");
|
||||||
/*
|
err = arc_read(NULL, spa, os->os_rootbp,
|
||||||
* XXX when bprewrite scrub can change the bp,
|
|
||||||
* and this is called from dmu_objset_open_ds_os, the bp
|
|
||||||
* could change, and we'll need a lock.
|
|
||||||
*/
|
|
||||||
err = dsl_read_nolock(NULL, spa, os->os_rootbp,
|
|
||||||
arc_getbuf_func, &os->os_phys_buf,
|
arc_getbuf_func, &os->os_phys_buf,
|
||||||
ZIO_PRIORITY_SYNC_READ, ZIO_FLAG_CANFAIL, &aflags, &zb);
|
ZIO_PRIORITY_SYNC_READ, ZIO_FLAG_CANFAIL, &aflags, &zb);
|
||||||
if (err) {
|
if (err) {
|
||||||
@ -1119,8 +1114,7 @@ dmu_objset_sync(objset_t *os, zio_t *pio, dmu_tx_t *tx)
|
|||||||
SET_BOOKMARK(&zb, os->os_dsl_dataset ?
|
SET_BOOKMARK(&zb, os->os_dsl_dataset ?
|
||||||
os->os_dsl_dataset->ds_object : DMU_META_OBJSET,
|
os->os_dsl_dataset->ds_object : DMU_META_OBJSET,
|
||||||
ZB_ROOT_OBJECT, ZB_ROOT_LEVEL, ZB_ROOT_BLKID);
|
ZB_ROOT_OBJECT, ZB_ROOT_LEVEL, ZB_ROOT_BLKID);
|
||||||
VERIFY3U(0, ==, arc_release_bp(os->os_phys_buf, &os->os_phys_buf,
|
arc_release(os->os_phys_buf, &os->os_phys_buf);
|
||||||
os->os_rootbp, os->os_spa, &zb));
|
|
||||||
|
|
||||||
dmu_write_policy(os, NULL, 0, 0, &zp);
|
dmu_write_policy(os, NULL, 0, 0, &zp);
|
||||||
|
|
||||||
@ -1765,7 +1759,7 @@ dmu_objset_prefetch(const char *name, void *arg)
|
|||||||
SET_BOOKMARK(&zb, ds->ds_object, ZB_ROOT_OBJECT,
|
SET_BOOKMARK(&zb, ds->ds_object, ZB_ROOT_OBJECT,
|
||||||
ZB_ROOT_LEVEL, ZB_ROOT_BLKID);
|
ZB_ROOT_LEVEL, ZB_ROOT_BLKID);
|
||||||
|
|
||||||
(void) dsl_read_nolock(NULL, dsl_dataset_get_spa(ds),
|
(void) arc_read(NULL, dsl_dataset_get_spa(ds),
|
||||||
&ds->ds_phys->ds_bp, NULL, NULL,
|
&ds->ds_phys->ds_bp, NULL, NULL,
|
||||||
ZIO_PRIORITY_ASYNC_READ,
|
ZIO_PRIORITY_ASYNC_READ,
|
||||||
ZIO_FLAG_CANFAIL | ZIO_FLAG_SPECULATIVE,
|
ZIO_FLAG_CANFAIL | ZIO_FLAG_SPECULATIVE,
|
||||||
|
@ -330,7 +330,7 @@ dump_dnode(dmu_sendarg_t *dsp, uint64_t object, dnode_phys_t *dnp)
|
|||||||
|
|
||||||
/* ARGSUSED */
|
/* ARGSUSED */
|
||||||
static int
|
static int
|
||||||
backup_cb(spa_t *spa, zilog_t *zilog, const blkptr_t *bp, arc_buf_t *pbuf,
|
backup_cb(spa_t *spa, zilog_t *zilog, const blkptr_t *bp,
|
||||||
const zbookmark_t *zb, const dnode_phys_t *dnp, void *arg)
|
const zbookmark_t *zb, const dnode_phys_t *dnp, void *arg)
|
||||||
{
|
{
|
||||||
dmu_sendarg_t *dsp = arg;
|
dmu_sendarg_t *dsp = arg;
|
||||||
@ -359,9 +359,9 @@ backup_cb(spa_t *spa, zilog_t *zilog, const blkptr_t *bp, arc_buf_t *pbuf,
|
|||||||
uint32_t aflags = ARC_WAIT;
|
uint32_t aflags = ARC_WAIT;
|
||||||
arc_buf_t *abuf;
|
arc_buf_t *abuf;
|
||||||
|
|
||||||
if (dsl_read(NULL, spa, bp, pbuf,
|
if (arc_read(NULL, spa, bp, arc_getbuf_func, &abuf,
|
||||||
arc_getbuf_func, &abuf, ZIO_PRIORITY_ASYNC_READ,
|
ZIO_PRIORITY_ASYNC_READ, ZIO_FLAG_CANFAIL,
|
||||||
ZIO_FLAG_CANFAIL, &aflags, zb) != 0)
|
&aflags, zb) != 0)
|
||||||
return (EIO);
|
return (EIO);
|
||||||
|
|
||||||
blk = abuf->b_data;
|
blk = abuf->b_data;
|
||||||
@ -378,9 +378,9 @@ backup_cb(spa_t *spa, zilog_t *zilog, const blkptr_t *bp, arc_buf_t *pbuf,
|
|||||||
arc_buf_t *abuf;
|
arc_buf_t *abuf;
|
||||||
int blksz = BP_GET_LSIZE(bp);
|
int blksz = BP_GET_LSIZE(bp);
|
||||||
|
|
||||||
if (arc_read_nolock(NULL, spa, bp,
|
if (arc_read(NULL, spa, bp, arc_getbuf_func, &abuf,
|
||||||
arc_getbuf_func, &abuf, ZIO_PRIORITY_ASYNC_READ,
|
ZIO_PRIORITY_ASYNC_READ, ZIO_FLAG_CANFAIL,
|
||||||
ZIO_FLAG_CANFAIL, &aflags, zb) != 0)
|
&aflags, zb) != 0)
|
||||||
return (EIO);
|
return (EIO);
|
||||||
|
|
||||||
err = dump_spill(dsp, zb->zb_object, blksz, abuf->b_data);
|
err = dump_spill(dsp, zb->zb_object, blksz, abuf->b_data);
|
||||||
@ -390,9 +390,9 @@ backup_cb(spa_t *spa, zilog_t *zilog, const blkptr_t *bp, arc_buf_t *pbuf,
|
|||||||
arc_buf_t *abuf;
|
arc_buf_t *abuf;
|
||||||
int blksz = BP_GET_LSIZE(bp);
|
int blksz = BP_GET_LSIZE(bp);
|
||||||
|
|
||||||
if (dsl_read(NULL, spa, bp, pbuf,
|
if (arc_read(NULL, spa, bp, arc_getbuf_func, &abuf,
|
||||||
arc_getbuf_func, &abuf, ZIO_PRIORITY_ASYNC_READ,
|
ZIO_PRIORITY_ASYNC_READ, ZIO_FLAG_CANFAIL,
|
||||||
ZIO_FLAG_CANFAIL, &aflags, zb) != 0) {
|
&aflags, zb) != 0) {
|
||||||
if (zfs_send_corrupt_data) {
|
if (zfs_send_corrupt_data) {
|
||||||
uint64_t *ptr;
|
uint64_t *ptr;
|
||||||
/* Send a block filled with 0x"zfs badd bloc" */
|
/* Send a block filled with 0x"zfs badd bloc" */
|
||||||
|
@ -62,9 +62,9 @@ typedef struct traverse_data {
|
|||||||
} traverse_data_t;
|
} traverse_data_t;
|
||||||
|
|
||||||
static int traverse_dnode(traverse_data_t *td, const dnode_phys_t *dnp,
|
static int traverse_dnode(traverse_data_t *td, const dnode_phys_t *dnp,
|
||||||
arc_buf_t *buf, uint64_t objset, uint64_t object);
|
uint64_t objset, uint64_t object);
|
||||||
static void prefetch_dnode_metadata(traverse_data_t *td, const dnode_phys_t *,
|
static void prefetch_dnode_metadata(traverse_data_t *td, const dnode_phys_t *,
|
||||||
arc_buf_t *buf, uint64_t objset, uint64_t object);
|
uint64_t objset, uint64_t object);
|
||||||
|
|
||||||
static int
|
static int
|
||||||
traverse_zil_block(zilog_t *zilog, blkptr_t *bp, void *arg, uint64_t claim_txg)
|
traverse_zil_block(zilog_t *zilog, blkptr_t *bp, void *arg, uint64_t claim_txg)
|
||||||
@ -81,7 +81,7 @@ traverse_zil_block(zilog_t *zilog, blkptr_t *bp, void *arg, uint64_t claim_txg)
|
|||||||
SET_BOOKMARK(&zb, td->td_objset, ZB_ZIL_OBJECT, ZB_ZIL_LEVEL,
|
SET_BOOKMARK(&zb, td->td_objset, ZB_ZIL_OBJECT, ZB_ZIL_LEVEL,
|
||||||
bp->blk_cksum.zc_word[ZIL_ZC_SEQ]);
|
bp->blk_cksum.zc_word[ZIL_ZC_SEQ]);
|
||||||
|
|
||||||
(void) td->td_func(td->td_spa, zilog, bp, NULL, &zb, NULL, td->td_arg);
|
(void) td->td_func(td->td_spa, zilog, bp, &zb, NULL, td->td_arg);
|
||||||
|
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
@ -105,7 +105,7 @@ traverse_zil_record(zilog_t *zilog, lr_t *lrc, void *arg, uint64_t claim_txg)
|
|||||||
SET_BOOKMARK(&zb, td->td_objset, lr->lr_foid,
|
SET_BOOKMARK(&zb, td->td_objset, lr->lr_foid,
|
||||||
ZB_ZIL_LEVEL, lr->lr_offset / BP_GET_LSIZE(bp));
|
ZB_ZIL_LEVEL, lr->lr_offset / BP_GET_LSIZE(bp));
|
||||||
|
|
||||||
(void) td->td_func(td->td_spa, zilog, bp, NULL, &zb, NULL,
|
(void) td->td_func(td->td_spa, zilog, bp, &zb, NULL,
|
||||||
td->td_arg);
|
td->td_arg);
|
||||||
}
|
}
|
||||||
return (0);
|
return (0);
|
||||||
@ -182,7 +182,7 @@ traverse_pause(traverse_data_t *td, const zbookmark_t *zb)
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
traverse_prefetch_metadata(traverse_data_t *td,
|
traverse_prefetch_metadata(traverse_data_t *td,
|
||||||
arc_buf_t *pbuf, const blkptr_t *bp, const zbookmark_t *zb)
|
const blkptr_t *bp, const zbookmark_t *zb)
|
||||||
{
|
{
|
||||||
uint32_t flags = ARC_NOWAIT | ARC_PREFETCH;
|
uint32_t flags = ARC_NOWAIT | ARC_PREFETCH;
|
||||||
|
|
||||||
@ -200,14 +200,13 @@ traverse_prefetch_metadata(traverse_data_t *td,
|
|||||||
if (BP_GET_LEVEL(bp) == 0 && BP_GET_TYPE(bp) != DMU_OT_DNODE)
|
if (BP_GET_LEVEL(bp) == 0 && BP_GET_TYPE(bp) != DMU_OT_DNODE)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
(void) arc_read(NULL, td->td_spa, bp,
|
(void) arc_read(NULL, td->td_spa, bp, NULL, NULL,
|
||||||
pbuf, NULL, NULL, ZIO_PRIORITY_ASYNC_READ,
|
ZIO_PRIORITY_ASYNC_READ, ZIO_FLAG_CANFAIL, &flags, zb);
|
||||||
ZIO_FLAG_CANFAIL, &flags, zb);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
traverse_visitbp(traverse_data_t *td, const dnode_phys_t *dnp,
|
traverse_visitbp(traverse_data_t *td, const dnode_phys_t *dnp,
|
||||||
arc_buf_t *pbuf, const blkptr_t *bp, const zbookmark_t *zb)
|
const blkptr_t *bp, const zbookmark_t *zb)
|
||||||
{
|
{
|
||||||
zbookmark_t czb;
|
zbookmark_t czb;
|
||||||
int err = 0, lasterr = 0;
|
int err = 0, lasterr = 0;
|
||||||
@ -228,8 +227,7 @@ traverse_visitbp(traverse_data_t *td, const dnode_phys_t *dnp,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (BP_IS_HOLE(bp)) {
|
if (BP_IS_HOLE(bp)) {
|
||||||
err = td->td_func(td->td_spa, NULL, NULL, pbuf, zb, dnp,
|
err = td->td_func(td->td_spa, NULL, NULL, zb, dnp, td->td_arg);
|
||||||
td->td_arg);
|
|
||||||
return (err);
|
return (err);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -249,7 +247,7 @@ traverse_visitbp(traverse_data_t *td, const dnode_phys_t *dnp,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (td->td_flags & TRAVERSE_PRE) {
|
if (td->td_flags & TRAVERSE_PRE) {
|
||||||
err = td->td_func(td->td_spa, NULL, bp, pbuf, zb, dnp,
|
err = td->td_func(td->td_spa, NULL, bp, zb, dnp,
|
||||||
td->td_arg);
|
td->td_arg);
|
||||||
if (err == TRAVERSE_VISIT_NO_CHILDREN)
|
if (err == TRAVERSE_VISIT_NO_CHILDREN)
|
||||||
return (0);
|
return (0);
|
||||||
@ -265,8 +263,7 @@ traverse_visitbp(traverse_data_t *td, const dnode_phys_t *dnp,
|
|||||||
blkptr_t *cbp;
|
blkptr_t *cbp;
|
||||||
int epb = BP_GET_LSIZE(bp) >> SPA_BLKPTRSHIFT;
|
int epb = BP_GET_LSIZE(bp) >> SPA_BLKPTRSHIFT;
|
||||||
|
|
||||||
err = dsl_read(NULL, td->td_spa, bp, pbuf,
|
err = arc_read(NULL, td->td_spa, bp, arc_getbuf_func, &buf,
|
||||||
arc_getbuf_func, &buf,
|
|
||||||
ZIO_PRIORITY_ASYNC_READ, ZIO_FLAG_CANFAIL, &flags, zb);
|
ZIO_PRIORITY_ASYNC_READ, ZIO_FLAG_CANFAIL, &flags, zb);
|
||||||
if (err)
|
if (err)
|
||||||
return (err);
|
return (err);
|
||||||
@ -276,7 +273,7 @@ traverse_visitbp(traverse_data_t *td, const dnode_phys_t *dnp,
|
|||||||
SET_BOOKMARK(&czb, zb->zb_objset, zb->zb_object,
|
SET_BOOKMARK(&czb, zb->zb_objset, zb->zb_object,
|
||||||
zb->zb_level - 1,
|
zb->zb_level - 1,
|
||||||
zb->zb_blkid * epb + i);
|
zb->zb_blkid * epb + i);
|
||||||
traverse_prefetch_metadata(td, buf, &cbp[i], &czb);
|
traverse_prefetch_metadata(td, &cbp[i], &czb);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* recursively visitbp() blocks below this */
|
/* recursively visitbp() blocks below this */
|
||||||
@ -284,7 +281,7 @@ traverse_visitbp(traverse_data_t *td, const dnode_phys_t *dnp,
|
|||||||
SET_BOOKMARK(&czb, zb->zb_objset, zb->zb_object,
|
SET_BOOKMARK(&czb, zb->zb_objset, zb->zb_object,
|
||||||
zb->zb_level - 1,
|
zb->zb_level - 1,
|
||||||
zb->zb_blkid * epb + i);
|
zb->zb_blkid * epb + i);
|
||||||
err = traverse_visitbp(td, dnp, buf, &cbp[i], &czb);
|
err = traverse_visitbp(td, dnp, &cbp[i], &czb);
|
||||||
if (err) {
|
if (err) {
|
||||||
if (!hard)
|
if (!hard)
|
||||||
break;
|
break;
|
||||||
@ -296,21 +293,20 @@ traverse_visitbp(traverse_data_t *td, const dnode_phys_t *dnp,
|
|||||||
int i;
|
int i;
|
||||||
int epb = BP_GET_LSIZE(bp) >> DNODE_SHIFT;
|
int epb = BP_GET_LSIZE(bp) >> DNODE_SHIFT;
|
||||||
|
|
||||||
err = dsl_read(NULL, td->td_spa, bp, pbuf,
|
err = arc_read(NULL, td->td_spa, bp, arc_getbuf_func, &buf,
|
||||||
arc_getbuf_func, &buf,
|
|
||||||
ZIO_PRIORITY_ASYNC_READ, ZIO_FLAG_CANFAIL, &flags, zb);
|
ZIO_PRIORITY_ASYNC_READ, ZIO_FLAG_CANFAIL, &flags, zb);
|
||||||
if (err)
|
if (err)
|
||||||
return (err);
|
return (err);
|
||||||
dnp = buf->b_data;
|
dnp = buf->b_data;
|
||||||
|
|
||||||
for (i = 0; i < epb; i++) {
|
for (i = 0; i < epb; i++) {
|
||||||
prefetch_dnode_metadata(td, &dnp[i], buf, zb->zb_objset,
|
prefetch_dnode_metadata(td, &dnp[i], zb->zb_objset,
|
||||||
zb->zb_blkid * epb + i);
|
zb->zb_blkid * epb + i);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* recursively visitbp() blocks below this */
|
/* recursively visitbp() blocks below this */
|
||||||
for (i = 0; i < epb; i++) {
|
for (i = 0; i < epb; i++) {
|
||||||
err = traverse_dnode(td, &dnp[i], buf, zb->zb_objset,
|
err = traverse_dnode(td, &dnp[i], zb->zb_objset,
|
||||||
zb->zb_blkid * epb + i);
|
zb->zb_blkid * epb + i);
|
||||||
if (err) {
|
if (err) {
|
||||||
if (!hard)
|
if (!hard)
|
||||||
@ -323,24 +319,23 @@ traverse_visitbp(traverse_data_t *td, const dnode_phys_t *dnp,
|
|||||||
objset_phys_t *osp;
|
objset_phys_t *osp;
|
||||||
dnode_phys_t *dnp;
|
dnode_phys_t *dnp;
|
||||||
|
|
||||||
err = dsl_read_nolock(NULL, td->td_spa, bp,
|
err = arc_read(NULL, td->td_spa, bp, arc_getbuf_func, &buf,
|
||||||
arc_getbuf_func, &buf,
|
|
||||||
ZIO_PRIORITY_ASYNC_READ, ZIO_FLAG_CANFAIL, &flags, zb);
|
ZIO_PRIORITY_ASYNC_READ, ZIO_FLAG_CANFAIL, &flags, zb);
|
||||||
if (err)
|
if (err)
|
||||||
return (err);
|
return (err);
|
||||||
|
|
||||||
osp = buf->b_data;
|
osp = buf->b_data;
|
||||||
dnp = &osp->os_meta_dnode;
|
dnp = &osp->os_meta_dnode;
|
||||||
prefetch_dnode_metadata(td, dnp, buf, zb->zb_objset,
|
prefetch_dnode_metadata(td, dnp, zb->zb_objset,
|
||||||
DMU_META_DNODE_OBJECT);
|
DMU_META_DNODE_OBJECT);
|
||||||
if (arc_buf_size(buf) >= sizeof (objset_phys_t)) {
|
if (arc_buf_size(buf) >= sizeof (objset_phys_t)) {
|
||||||
prefetch_dnode_metadata(td, &osp->os_userused_dnode,
|
prefetch_dnode_metadata(td, &osp->os_userused_dnode,
|
||||||
buf, zb->zb_objset, DMU_USERUSED_OBJECT);
|
zb->zb_objset, DMU_USERUSED_OBJECT);
|
||||||
prefetch_dnode_metadata(td, &osp->os_groupused_dnode,
|
prefetch_dnode_metadata(td, &osp->os_groupused_dnode,
|
||||||
buf, zb->zb_objset, DMU_USERUSED_OBJECT);
|
zb->zb_objset, DMU_USERUSED_OBJECT);
|
||||||
}
|
}
|
||||||
|
|
||||||
err = traverse_dnode(td, dnp, buf, zb->zb_objset,
|
err = traverse_dnode(td, dnp, zb->zb_objset,
|
||||||
DMU_META_DNODE_OBJECT);
|
DMU_META_DNODE_OBJECT);
|
||||||
if (err && hard) {
|
if (err && hard) {
|
||||||
lasterr = err;
|
lasterr = err;
|
||||||
@ -348,7 +343,7 @@ traverse_visitbp(traverse_data_t *td, const dnode_phys_t *dnp,
|
|||||||
}
|
}
|
||||||
if (err == 0 && arc_buf_size(buf) >= sizeof (objset_phys_t)) {
|
if (err == 0 && arc_buf_size(buf) >= sizeof (objset_phys_t)) {
|
||||||
dnp = &osp->os_userused_dnode;
|
dnp = &osp->os_userused_dnode;
|
||||||
err = traverse_dnode(td, dnp, buf, zb->zb_objset,
|
err = traverse_dnode(td, dnp, zb->zb_objset,
|
||||||
DMU_USERUSED_OBJECT);
|
DMU_USERUSED_OBJECT);
|
||||||
}
|
}
|
||||||
if (err && hard) {
|
if (err && hard) {
|
||||||
@ -357,7 +352,7 @@ traverse_visitbp(traverse_data_t *td, const dnode_phys_t *dnp,
|
|||||||
}
|
}
|
||||||
if (err == 0 && arc_buf_size(buf) >= sizeof (objset_phys_t)) {
|
if (err == 0 && arc_buf_size(buf) >= sizeof (objset_phys_t)) {
|
||||||
dnp = &osp->os_groupused_dnode;
|
dnp = &osp->os_groupused_dnode;
|
||||||
err = traverse_dnode(td, dnp, buf, zb->zb_objset,
|
err = traverse_dnode(td, dnp, zb->zb_objset,
|
||||||
DMU_GROUPUSED_OBJECT);
|
DMU_GROUPUSED_OBJECT);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -367,8 +362,7 @@ traverse_visitbp(traverse_data_t *td, const dnode_phys_t *dnp,
|
|||||||
|
|
||||||
post:
|
post:
|
||||||
if (err == 0 && lasterr == 0 && (td->td_flags & TRAVERSE_POST)) {
|
if (err == 0 && lasterr == 0 && (td->td_flags & TRAVERSE_POST)) {
|
||||||
err = td->td_func(td->td_spa, NULL, bp, pbuf, zb, dnp,
|
err = td->td_func(td->td_spa, NULL, bp, zb, dnp, td->td_arg);
|
||||||
td->td_arg);
|
|
||||||
if (err == ERESTART)
|
if (err == ERESTART)
|
||||||
pause = B_TRUE;
|
pause = B_TRUE;
|
||||||
}
|
}
|
||||||
@ -384,25 +378,25 @@ post:
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
prefetch_dnode_metadata(traverse_data_t *td, const dnode_phys_t *dnp,
|
prefetch_dnode_metadata(traverse_data_t *td, const dnode_phys_t *dnp,
|
||||||
arc_buf_t *buf, uint64_t objset, uint64_t object)
|
uint64_t objset, uint64_t object)
|
||||||
{
|
{
|
||||||
int j;
|
int j;
|
||||||
zbookmark_t czb;
|
zbookmark_t czb;
|
||||||
|
|
||||||
for (j = 0; j < dnp->dn_nblkptr; j++) {
|
for (j = 0; j < dnp->dn_nblkptr; j++) {
|
||||||
SET_BOOKMARK(&czb, objset, object, dnp->dn_nlevels - 1, j);
|
SET_BOOKMARK(&czb, objset, object, dnp->dn_nlevels - 1, j);
|
||||||
traverse_prefetch_metadata(td, buf, &dnp->dn_blkptr[j], &czb);
|
traverse_prefetch_metadata(td, &dnp->dn_blkptr[j], &czb);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dnp->dn_flags & DNODE_FLAG_SPILL_BLKPTR) {
|
if (dnp->dn_flags & DNODE_FLAG_SPILL_BLKPTR) {
|
||||||
SET_BOOKMARK(&czb, objset, object, 0, DMU_SPILL_BLKID);
|
SET_BOOKMARK(&czb, objset, object, 0, DMU_SPILL_BLKID);
|
||||||
traverse_prefetch_metadata(td, buf, &dnp->dn_spill, &czb);
|
traverse_prefetch_metadata(td, &dnp->dn_spill, &czb);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
traverse_dnode(traverse_data_t *td, const dnode_phys_t *dnp,
|
traverse_dnode(traverse_data_t *td, const dnode_phys_t *dnp,
|
||||||
arc_buf_t *buf, uint64_t objset, uint64_t object)
|
uint64_t objset, uint64_t object)
|
||||||
{
|
{
|
||||||
int j, err = 0, lasterr = 0;
|
int j, err = 0, lasterr = 0;
|
||||||
zbookmark_t czb;
|
zbookmark_t czb;
|
||||||
@ -410,7 +404,7 @@ traverse_dnode(traverse_data_t *td, const dnode_phys_t *dnp,
|
|||||||
|
|
||||||
for (j = 0; j < dnp->dn_nblkptr; j++) {
|
for (j = 0; j < dnp->dn_nblkptr; j++) {
|
||||||
SET_BOOKMARK(&czb, objset, object, dnp->dn_nlevels - 1, j);
|
SET_BOOKMARK(&czb, objset, object, dnp->dn_nlevels - 1, j);
|
||||||
err = traverse_visitbp(td, dnp, buf, &dnp->dn_blkptr[j], &czb);
|
err = traverse_visitbp(td, dnp, &dnp->dn_blkptr[j], &czb);
|
||||||
if (err) {
|
if (err) {
|
||||||
if (!hard)
|
if (!hard)
|
||||||
break;
|
break;
|
||||||
@ -420,7 +414,7 @@ traverse_dnode(traverse_data_t *td, const dnode_phys_t *dnp,
|
|||||||
|
|
||||||
if (dnp->dn_flags & DNODE_FLAG_SPILL_BLKPTR) {
|
if (dnp->dn_flags & DNODE_FLAG_SPILL_BLKPTR) {
|
||||||
SET_BOOKMARK(&czb, objset, object, 0, DMU_SPILL_BLKID);
|
SET_BOOKMARK(&czb, objset, object, 0, DMU_SPILL_BLKID);
|
||||||
err = traverse_visitbp(td, dnp, buf, &dnp->dn_spill, &czb);
|
err = traverse_visitbp(td, dnp, &dnp->dn_spill, &czb);
|
||||||
if (err) {
|
if (err) {
|
||||||
if (!hard)
|
if (!hard)
|
||||||
return (err);
|
return (err);
|
||||||
@ -433,8 +427,7 @@ traverse_dnode(traverse_data_t *td, const dnode_phys_t *dnp,
|
|||||||
/* ARGSUSED */
|
/* ARGSUSED */
|
||||||
static int
|
static int
|
||||||
traverse_prefetcher(spa_t *spa, zilog_t *zilog, const blkptr_t *bp,
|
traverse_prefetcher(spa_t *spa, zilog_t *zilog, const blkptr_t *bp,
|
||||||
arc_buf_t *pbuf, const zbookmark_t *zb, const dnode_phys_t *dnp,
|
const zbookmark_t *zb, const dnode_phys_t *dnp, void *arg)
|
||||||
void *arg)
|
|
||||||
{
|
{
|
||||||
prefetch_data_t *pfd = arg;
|
prefetch_data_t *pfd = arg;
|
||||||
uint32_t aflags = ARC_NOWAIT | ARC_PREFETCH;
|
uint32_t aflags = ARC_NOWAIT | ARC_PREFETCH;
|
||||||
@ -455,10 +448,8 @@ traverse_prefetcher(spa_t *spa, zilog_t *zilog, const blkptr_t *bp,
|
|||||||
cv_broadcast(&pfd->pd_cv);
|
cv_broadcast(&pfd->pd_cv);
|
||||||
mutex_exit(&pfd->pd_mtx);
|
mutex_exit(&pfd->pd_mtx);
|
||||||
|
|
||||||
(void) dsl_read(NULL, spa, bp, pbuf, NULL, NULL,
|
(void) arc_read(NULL, spa, bp, NULL, NULL, ZIO_PRIORITY_ASYNC_READ,
|
||||||
ZIO_PRIORITY_ASYNC_READ,
|
ZIO_FLAG_CANFAIL | ZIO_FLAG_SPECULATIVE, &aflags, zb);
|
||||||
ZIO_FLAG_CANFAIL | ZIO_FLAG_SPECULATIVE,
|
|
||||||
&aflags, zb);
|
|
||||||
|
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
@ -476,7 +467,7 @@ traverse_prefetch_thread(void *arg)
|
|||||||
|
|
||||||
SET_BOOKMARK(&czb, td.td_objset,
|
SET_BOOKMARK(&czb, td.td_objset,
|
||||||
ZB_ROOT_OBJECT, ZB_ROOT_LEVEL, ZB_ROOT_BLKID);
|
ZB_ROOT_OBJECT, ZB_ROOT_LEVEL, ZB_ROOT_BLKID);
|
||||||
(void) traverse_visitbp(&td, NULL, NULL, td.td_rootbp, &czb);
|
(void) traverse_visitbp(&td, NULL, td.td_rootbp, &czb);
|
||||||
|
|
||||||
mutex_enter(&td_main->td_pfd->pd_mtx);
|
mutex_enter(&td_main->td_pfd->pd_mtx);
|
||||||
td_main->td_pfd->pd_exited = B_TRUE;
|
td_main->td_pfd->pd_exited = B_TRUE;
|
||||||
@ -544,7 +535,7 @@ traverse_impl(spa_t *spa, dsl_dataset_t *ds, uint64_t objset, blkptr_t *rootbp,
|
|||||||
|
|
||||||
SET_BOOKMARK(czb, td->td_objset,
|
SET_BOOKMARK(czb, td->td_objset,
|
||||||
ZB_ROOT_OBJECT, ZB_ROOT_LEVEL, ZB_ROOT_BLKID);
|
ZB_ROOT_OBJECT, ZB_ROOT_LEVEL, ZB_ROOT_BLKID);
|
||||||
err = traverse_visitbp(td, NULL, NULL, rootbp, czb);
|
err = traverse_visitbp(td, NULL, rootbp, czb);
|
||||||
|
|
||||||
mutex_enter(&pd->pd_mtx);
|
mutex_enter(&pd->pd_mtx);
|
||||||
pd->pd_cancel = B_TRUE;
|
pd->pd_cancel = B_TRUE;
|
||||||
|
@ -1271,7 +1271,7 @@ struct killarg {
|
|||||||
|
|
||||||
/* ARGSUSED */
|
/* ARGSUSED */
|
||||||
static int
|
static int
|
||||||
kill_blkptr(spa_t *spa, zilog_t *zilog, const blkptr_t *bp, arc_buf_t *pbuf,
|
kill_blkptr(spa_t *spa, zilog_t *zilog, const blkptr_t *bp,
|
||||||
const zbookmark_t *zb, const dnode_phys_t *dnp, void *arg)
|
const zbookmark_t *zb, const dnode_phys_t *dnp, void *arg)
|
||||||
{
|
{
|
||||||
struct killarg *ka = arg;
|
struct killarg *ka = arg;
|
||||||
|
@ -363,24 +363,6 @@ dsl_free_sync(zio_t *pio, dsl_pool_t *dp, uint64_t txg, const blkptr_t *bpp)
|
|||||||
zio_nowait(zio_free_sync(pio, dp->dp_spa, txg, bpp, pio->io_flags));
|
zio_nowait(zio_free_sync(pio, dp->dp_spa, txg, bpp, pio->io_flags));
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
|
||||||
dsl_read(zio_t *pio, spa_t *spa, const blkptr_t *bpp, arc_buf_t *pbuf,
|
|
||||||
arc_done_func_t *done, void *private, int priority, int zio_flags,
|
|
||||||
uint32_t *arc_flags, const zbookmark_t *zb)
|
|
||||||
{
|
|
||||||
return (arc_read(pio, spa, bpp, pbuf, done, private,
|
|
||||||
priority, zio_flags, arc_flags, zb));
|
|
||||||
}
|
|
||||||
|
|
||||||
int
|
|
||||||
dsl_read_nolock(zio_t *pio, spa_t *spa, const blkptr_t *bpp,
|
|
||||||
arc_done_func_t *done, void *private, int priority, int zio_flags,
|
|
||||||
uint32_t *arc_flags, const zbookmark_t *zb)
|
|
||||||
{
|
|
||||||
return (arc_read_nolock(pio, spa, bpp, done, private,
|
|
||||||
priority, zio_flags, arc_flags, zb));
|
|
||||||
}
|
|
||||||
|
|
||||||
static uint64_t
|
static uint64_t
|
||||||
dsl_scan_ds_maxtxg(dsl_dataset_t *ds)
|
dsl_scan_ds_maxtxg(dsl_dataset_t *ds)
|
||||||
{
|
{
|
||||||
@ -551,12 +533,8 @@ dsl_scan_prefetch(dsl_scan_t *scn, arc_buf_t *buf, blkptr_t *bp,
|
|||||||
|
|
||||||
SET_BOOKMARK(&czb, objset, object, BP_GET_LEVEL(bp), blkid);
|
SET_BOOKMARK(&czb, objset, object, BP_GET_LEVEL(bp), blkid);
|
||||||
|
|
||||||
/*
|
|
||||||
* XXX need to make sure all of these arc_read() prefetches are
|
|
||||||
* done before setting xlateall (similar to dsl_read())
|
|
||||||
*/
|
|
||||||
(void) arc_read(scn->scn_zio_root, scn->scn_dp->dp_spa, bp,
|
(void) arc_read(scn->scn_zio_root, scn->scn_dp->dp_spa, bp,
|
||||||
buf, NULL, NULL, ZIO_PRIORITY_ASYNC_READ,
|
NULL, NULL, ZIO_PRIORITY_ASYNC_READ,
|
||||||
ZIO_FLAG_CANFAIL | ZIO_FLAG_SCAN_THREAD, &flags, &czb);
|
ZIO_FLAG_CANFAIL | ZIO_FLAG_SCAN_THREAD, &flags, &czb);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -614,8 +592,7 @@ dsl_scan_recurse(dsl_scan_t *scn, dsl_dataset_t *ds, dmu_objset_type_t ostype,
|
|||||||
blkptr_t *cbp;
|
blkptr_t *cbp;
|
||||||
int epb = BP_GET_LSIZE(bp) >> SPA_BLKPTRSHIFT;
|
int epb = BP_GET_LSIZE(bp) >> SPA_BLKPTRSHIFT;
|
||||||
|
|
||||||
err = arc_read_nolock(NULL, dp->dp_spa, bp,
|
err = arc_read(NULL, dp->dp_spa, bp, arc_getbuf_func, bufp,
|
||||||
arc_getbuf_func, bufp,
|
|
||||||
ZIO_PRIORITY_ASYNC_READ, zio_flags, &flags, zb);
|
ZIO_PRIORITY_ASYNC_READ, zio_flags, &flags, zb);
|
||||||
if (err) {
|
if (err) {
|
||||||
scn->scn_phys.scn_errors++;
|
scn->scn_phys.scn_errors++;
|
||||||
@ -637,8 +614,7 @@ dsl_scan_recurse(dsl_scan_t *scn, dsl_dataset_t *ds, dmu_objset_type_t ostype,
|
|||||||
} else if (BP_GET_TYPE(bp) == DMU_OT_USERGROUP_USED) {
|
} else if (BP_GET_TYPE(bp) == DMU_OT_USERGROUP_USED) {
|
||||||
uint32_t flags = ARC_WAIT;
|
uint32_t flags = ARC_WAIT;
|
||||||
|
|
||||||
err = arc_read_nolock(NULL, dp->dp_spa, bp,
|
err = arc_read(NULL, dp->dp_spa, bp, arc_getbuf_func, bufp,
|
||||||
arc_getbuf_func, bufp,
|
|
||||||
ZIO_PRIORITY_ASYNC_READ, zio_flags, &flags, zb);
|
ZIO_PRIORITY_ASYNC_READ, zio_flags, &flags, zb);
|
||||||
if (err) {
|
if (err) {
|
||||||
scn->scn_phys.scn_errors++;
|
scn->scn_phys.scn_errors++;
|
||||||
@ -650,8 +626,7 @@ dsl_scan_recurse(dsl_scan_t *scn, dsl_dataset_t *ds, dmu_objset_type_t ostype,
|
|||||||
int i, j;
|
int i, j;
|
||||||
int epb = BP_GET_LSIZE(bp) >> DNODE_SHIFT;
|
int epb = BP_GET_LSIZE(bp) >> DNODE_SHIFT;
|
||||||
|
|
||||||
err = arc_read_nolock(NULL, dp->dp_spa, bp,
|
err = arc_read(NULL, dp->dp_spa, bp, arc_getbuf_func, bufp,
|
||||||
arc_getbuf_func, bufp,
|
|
||||||
ZIO_PRIORITY_ASYNC_READ, zio_flags, &flags, zb);
|
ZIO_PRIORITY_ASYNC_READ, zio_flags, &flags, zb);
|
||||||
if (err) {
|
if (err) {
|
||||||
scn->scn_phys.scn_errors++;
|
scn->scn_phys.scn_errors++;
|
||||||
@ -673,8 +648,7 @@ dsl_scan_recurse(dsl_scan_t *scn, dsl_dataset_t *ds, dmu_objset_type_t ostype,
|
|||||||
uint32_t flags = ARC_WAIT;
|
uint32_t flags = ARC_WAIT;
|
||||||
objset_phys_t *osp;
|
objset_phys_t *osp;
|
||||||
|
|
||||||
err = arc_read_nolock(NULL, dp->dp_spa, bp,
|
err = arc_read(NULL, dp->dp_spa, bp, arc_getbuf_func, bufp,
|
||||||
arc_getbuf_func, bufp,
|
|
||||||
ZIO_PRIORITY_ASYNC_READ, zio_flags, &flags, zb);
|
ZIO_PRIORITY_ASYNC_READ, zio_flags, &flags, zb);
|
||||||
if (err) {
|
if (err) {
|
||||||
scn->scn_phys.scn_errors++;
|
scn->scn_phys.scn_errors++;
|
||||||
|
@ -1856,7 +1856,7 @@ spa_load_verify_done(zio_t *zio)
|
|||||||
/*ARGSUSED*/
|
/*ARGSUSED*/
|
||||||
static int
|
static int
|
||||||
spa_load_verify_cb(spa_t *spa, zilog_t *zilog, const blkptr_t *bp,
|
spa_load_verify_cb(spa_t *spa, zilog_t *zilog, const blkptr_t *bp,
|
||||||
arc_buf_t *pbuf, const zbookmark_t *zb, const dnode_phys_t *dnp, void *arg)
|
const zbookmark_t *zb, const dnode_phys_t *dnp, void *arg)
|
||||||
{
|
{
|
||||||
if (bp != NULL) {
|
if (bp != NULL) {
|
||||||
zio_t *rio = arg;
|
zio_t *rio = arg;
|
||||||
|
@ -212,7 +212,7 @@ zil_read_log_block(zilog_t *zilog, const blkptr_t *bp, blkptr_t *nbp, void *dst,
|
|||||||
SET_BOOKMARK(&zb, bp->blk_cksum.zc_word[ZIL_ZC_OBJSET],
|
SET_BOOKMARK(&zb, bp->blk_cksum.zc_word[ZIL_ZC_OBJSET],
|
||||||
ZB_ZIL_OBJECT, ZB_ZIL_LEVEL, bp->blk_cksum.zc_word[ZIL_ZC_SEQ]);
|
ZB_ZIL_OBJECT, ZB_ZIL_LEVEL, bp->blk_cksum.zc_word[ZIL_ZC_SEQ]);
|
||||||
|
|
||||||
error = dsl_read_nolock(NULL, zilog->zl_spa, bp, arc_getbuf_func, &abuf,
|
error = arc_read(NULL, zilog->zl_spa, bp, arc_getbuf_func, &abuf,
|
||||||
ZIO_PRIORITY_SYNC_READ, zio_flags, &aflags, &zb);
|
ZIO_PRIORITY_SYNC_READ, zio_flags, &aflags, &zb);
|
||||||
|
|
||||||
if (error == 0) {
|
if (error == 0) {
|
||||||
@ -288,7 +288,7 @@ zil_read_log_data(zilog_t *zilog, const lr_write_t *lr, void *wbuf)
|
|||||||
SET_BOOKMARK(&zb, dmu_objset_id(zilog->zl_os), lr->lr_foid,
|
SET_BOOKMARK(&zb, dmu_objset_id(zilog->zl_os), lr->lr_foid,
|
||||||
ZB_ZIL_LEVEL, lr->lr_offset / BP_GET_LSIZE(bp));
|
ZB_ZIL_LEVEL, lr->lr_offset / BP_GET_LSIZE(bp));
|
||||||
|
|
||||||
error = arc_read_nolock(NULL, zilog->zl_spa, bp, arc_getbuf_func, &abuf,
|
error = arc_read(NULL, zilog->zl_spa, bp, arc_getbuf_func, &abuf,
|
||||||
ZIO_PRIORITY_SYNC_READ, zio_flags, &aflags, &zb);
|
ZIO_PRIORITY_SYNC_READ, zio_flags, &aflags, &zb);
|
||||||
|
|
||||||
if (error == 0) {
|
if (error == 0) {
|
||||||
|
@ -2051,7 +2051,7 @@ zio_ddt_collision(zio_t *zio, ddt_t *ddt, ddt_entry_t *dde)
|
|||||||
|
|
||||||
ddt_exit(ddt);
|
ddt_exit(ddt);
|
||||||
|
|
||||||
error = arc_read_nolock(NULL, spa, &blk,
|
error = arc_read(NULL, spa, &blk,
|
||||||
arc_getbuf_func, &abuf, ZIO_PRIORITY_SYNC_READ,
|
arc_getbuf_func, &abuf, ZIO_PRIORITY_SYNC_READ,
|
||||||
ZIO_FLAG_CANFAIL | ZIO_FLAG_SPECULATIVE,
|
ZIO_FLAG_CANFAIL | ZIO_FLAG_SPECULATIVE,
|
||||||
&aflags, &zio->io_bookmark);
|
&aflags, &zio->io_bookmark);
|
||||||
|
Loading…
Reference in New Issue
Block a user