X-Git-Url: https://git.camperquake.de/gitweb.cgi?a=blobdiff_plain;f=module%2Fzfs%2Fdbuf.c;h=d08359156d5626045be1319a62f4f938d0dde326;hb=8a8f5c6b3ca44248b47a4a65515d7828803c71ff;hp=7b66fcea429913f7110cfb78d9dbc604447e5db6;hpb=1fde1e37208c2f56c72c70a06676676f04b65998;p=zfs.git diff --git a/module/zfs/dbuf.c b/module/zfs/dbuf.c index 7b66fce..d083591 100644 --- a/module/zfs/dbuf.c +++ b/module/zfs/dbuf.c @@ -55,6 +55,7 @@ dbuf_cons(void *vdb, void *unused, int kmflag) mutex_init(&db->db_mtx, NULL, MUTEX_DEFAULT, NULL); cv_init(&db->db_changed, NULL, CV_DEFAULT, NULL); refcount_create(&db->db_holds); + list_link_init(&db->db_link); return (0); } @@ -1136,6 +1137,7 @@ dbuf_dirty(dmu_buf_impl_t *db, dmu_tx_t *tx) * transaction group won't leak out when we sync the older txg. */ dr = kmem_zalloc(sizeof (dbuf_dirty_record_t), KM_SLEEP); + list_link_init(&dr->dr_dirty_node); if (db->db_level == 0) { void *data_old = db->db_buf; @@ -2319,6 +2321,10 @@ dbuf_sync_leaf(dbuf_dirty_record_t *dr, dmu_tx_t *tx) ASSERT(dr->dr_next == NULL); ASSERT(dr->dr_dbuf == db); *drp = dr->dr_next; + if (dr->dr_dbuf->db_level != 0) { + mutex_destroy(&dr->dt.di.dr_mtx); + list_destroy(&dr->dt.di.dr_children); + } kmem_free(dr, sizeof (dbuf_dirty_record_t)); ASSERT(db->db_dirtycnt > 0); db->db_dirtycnt -= 1;