summaryrefslogtreecommitdiffstats
path: root/module/zfs/dnode_sync.c
diff options
context:
space:
mode:
authorMatthew Macy <[email protected]>2020-02-05 11:07:19 -0800
committerGitHub <[email protected]>2020-02-05 11:07:19 -0800
commitcccbed9f98597c2c354b218b0578625cc26358aa (patch)
treee4b47c15e228b3e85cb3dcb8f90a255cd96e67c9 /module/zfs/dnode_sync.c
parent741db5a3466236620612772319c3401171d3f2b6 (diff)
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 <[email protected]> Reviewed-by: Matt Ahrens <[email protected]> Signed-off-by: Matt Macy <[email protected]> Closes #9902
Diffstat (limited to 'module/zfs/dnode_sync.c')
-rw-r--r--module/zfs/dnode_sync.c12
1 files changed, 5 insertions, 7 deletions
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 ||