From cccbed9f98597c2c354b218b0578625cc26358aa Mon Sep 17 00:00:00 2001 From: Matthew Macy Date: Wed, 5 Feb 2020 11:07:19 -0800 Subject: Convert dbuf dirty record record list to a list_t Additionally pull in state machine comments about upcoming async cow work. Reviewed-by: Brian Behlendorf Reviewed-by: Matt Ahrens Signed-off-by: Matt Macy Closes #9902 --- module/zfs/dnode_sync.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'module/zfs/dnode_sync.c') diff --git a/module/zfs/dnode_sync.c b/module/zfs/dnode_sync.c index 5df395a6f..4178d6f07 100644 --- a/module/zfs/dnode_sync.c +++ b/module/zfs/dnode_sync.c @@ -207,10 +207,7 @@ free_verify(dmu_buf_impl_t *db, uint64_t start, uint64_t end, dmu_tx_t *tx) continue; ASSERT(err == 0); ASSERT(child->db_level == 0); - dr = child->db_last_dirty; - while (dr && dr->dr_txg > txg) - dr = dr->dr_next; - ASSERT(dr == NULL || dr->dr_txg == txg); + dr = dbuf_find_dirty_eq(child, txg); /* data_old better be zeroed */ if (dr) { @@ -231,7 +228,7 @@ free_verify(dmu_buf_impl_t *db, uint64_t start, uint64_t end, dmu_tx_t *tx) mutex_enter(&child->db_mtx); buf = child->db.db_data; if (buf != NULL && child->db_state != DB_FILL && - child->db_last_dirty == NULL) { + list_is_empty(&child->db_dirty_records)) { for (j = 0; j < child->db.db_size >> 3; j++) { if (buf[j] != 0) { panic("freed data not zero: " @@ -541,8 +538,9 @@ dnode_undirty_dbufs(list_t *list) mutex_enter(&db->db_mtx); /* XXX - use dbuf_undirty()? */ list_remove(list, dr); - ASSERT(db->db_last_dirty == dr); - db->db_last_dirty = NULL; + ASSERT(list_head(&db->db_dirty_records) == dr); + list_remove_head(&db->db_dirty_records); + ASSERT(list_is_empty(&db->db_dirty_records)); db->db_dirtycnt -= 1; if (db->db_level == 0) { ASSERT(db->db_blkid == DMU_BONUS_BLKID || -- cgit v1.2.3