summaryrefslogtreecommitdiffstats
path: root/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c
diff options
context:
space:
mode:
authorpjd <pjd@FreeBSD.org>2007-05-06 19:05:37 +0000
committerpjd <pjd@FreeBSD.org>2007-05-06 19:05:37 +0000
commite719d9746950e5d50fca7db8e178d20037263262 (patch)
tree95cba692d0bf26f725dbc7a37642171ee00406de /sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c
parentc1f9a3e303048a7b8d456ac3131ecb19ae26e7d8 (diff)
downloadFreeBSD-src-e719d9746950e5d50fca7db8e178d20037263262.zip
FreeBSD-src-e719d9746950e5d50fca7db8e178d20037263262.tar.gz
- Add missing lock destruction and remove duplicate initializations.
With this change it is possible to unload zfs.ko module from WITNESS-enabled kernel. - Remove bogus comment.
Diffstat (limited to 'sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c')
-rw-r--r--sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c
index bd6d50b..94c6308 100644
--- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c
+++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c
@@ -1178,7 +1178,8 @@ dbuf_undirty(dmu_buf_impl_t *db, dmu_tx_t *tx)
} else {
ASSERT(db->db_buf != NULL);
ASSERT(list_head(&dr->dt.di.dr_children) == NULL);
- /* XXX - mutex and list destroy? */
+ list_destroy(&dr->dt.di.dr_children);
+ mutex_destroy(&dr->dt.di.dr_mtx);
}
kmem_free(dr, sizeof (dbuf_dirty_record_t));
@@ -1925,6 +1926,10 @@ dbuf_sync_leaf(dbuf_dirty_record_t *dr, dmu_tx_t *tx)
drp = &(*drp)->dr_next;
ASSERT((*drp)->dr_next == NULL);
*drp = NULL;
+ if (dr->dr_dbuf->db_level != 0) {
+ list_destroy(&dr->dt.di.dr_children);
+ mutex_destroy(&dr->dt.di.dr_mtx);
+ }
kmem_free(dr, sizeof (dbuf_dirty_record_t));
ASSERT(db->db_dirtycnt > 0);
db->db_dirtycnt -= 1;
@@ -2225,6 +2230,8 @@ dbuf_write_done(zio_t *zio, arc_buf_t *buf, void *vdb)
>> (db->db_level * epbs), >=, db->db_blkid);
arc_set_callback(db->db_buf, dbuf_do_evict, db);
}
+ list_destroy(&dr->dt.di.dr_children);
+ mutex_destroy(&dr->dt.di.dr_mtx);
}
kmem_free(dr, sizeof (dbuf_dirty_record_t));
OpenPOWER on IntegriCloud