| 3893 | } |
| 3894 | |
| 3895 | static void |
| 3896 | dbuf_sync_bonus(dbuf_dirty_record_t *dr, dmu_tx_t *tx) |
| 3897 | { |
| 3898 | dmu_buf_impl_t *db = dr->dr_dbuf; |
| 3899 | void *data = dr->dt.dl.dr_data; |
| 3900 | |
| 3901 | ASSERT0(db->db_level); |
| 3902 | ASSERT(MUTEX_HELD(&db->db_mtx)); |
| 3903 | ASSERT(db->db_blkid == DMU_BONUS_BLKID); |
| 3904 | ASSERT(data != NULL); |
| 3905 | |
| 3906 | dnode_t *dn = dr->dr_dnode; |
| 3907 | ASSERT3U(DN_MAX_BONUS_LEN(dn->dn_phys), <=, |
| 3908 | DN_SLOTS_TO_BONUSLEN(dn->dn_phys->dn_extra_slots + 1)); |
| 3909 | bcopy(data, DN_BONUS(dn->dn_phys), DN_MAX_BONUS_LEN(dn->dn_phys)); |
| 3910 | |
| 3911 | dbuf_sync_leaf_verify_bonus_dnode(dr); |
| 3912 | |
| 3913 | dbuf_undirty_bonus(dr); |
| 3914 | dbuf_rele_and_unlock(db, (void *)(uintptr_t)tx->tx_txg, B_FALSE); |
| 3915 | } |
| 3916 | |
| 3917 | /* |
| 3918 | * When syncing out a blocks of dnodes, adjust the block to deal with |
no test coverage detected