| 525 | } |
| 526 | |
| 527 | static void |
| 528 | dnode_undirty_dbufs(list_t *list) |
| 529 | { |
| 530 | dbuf_dirty_record_t *dr; |
| 531 | |
| 532 | while ((dr = list_head(list))) { |
| 533 | dmu_buf_impl_t *db = dr->dr_dbuf; |
| 534 | uint64_t txg = dr->dr_txg; |
| 535 | |
| 536 | if (db->db_level != 0) |
| 537 | dnode_undirty_dbufs(&dr->dt.di.dr_children); |
| 538 | |
| 539 | mutex_enter(&db->db_mtx); |
| 540 | /* XXX - use dbuf_undirty()? */ |
| 541 | list_remove(list, dr); |
| 542 | ASSERT(list_head(&db->db_dirty_records) == dr); |
| 543 | list_remove_head(&db->db_dirty_records); |
| 544 | ASSERT(list_is_empty(&db->db_dirty_records)); |
| 545 | db->db_dirtycnt -= 1; |
| 546 | if (db->db_level == 0) { |
| 547 | ASSERT(db->db_blkid == DMU_BONUS_BLKID || |
| 548 | dr->dt.dl.dr_data == db->db_buf); |
| 549 | dbuf_unoverride(dr); |
| 550 | } else { |
| 551 | mutex_destroy(&dr->dt.di.dr_mtx); |
| 552 | list_destroy(&dr->dt.di.dr_children); |
| 553 | } |
| 554 | kmem_free(dr, sizeof (dbuf_dirty_record_t)); |
| 555 | dbuf_rele_and_unlock(db, (void *)(uintptr_t)txg, B_FALSE); |
| 556 | } |
| 557 | } |
| 558 | |
| 559 | static void |
| 560 | dnode_sync_free(dnode_t *dn, dmu_tx_t *tx) |
no test coverage detected