Add fix-locks branch

This commit is contained in:
Brian Behlendorf 2008-11-20 12:51:56 -08:00
parent 34dc7c2f25
commit 46492187dd
7 changed files with 32 additions and 0 deletions

1
.topdeps Normal file
View File

@ -0,0 +1 @@
master

8
.topmsg Normal file
View File

@ -0,0 +1,8 @@
From: Brian Behlendorf <behlendorf1@llnl.gov>
Subject: [PATCH] fix locks
Properly initialize and destroy locking primitives.
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
---

View File

@ -3364,6 +3364,7 @@ arc_fini(void)
mutex_destroy(&arc_mru_ghost->arcs_mtx);
mutex_destroy(&arc_mfu->arcs_mtx);
mutex_destroy(&arc_mfu_ghost->arcs_mtx);
mutex_destroy(&arc_l2c_only->arcs_mtx);
buf_fini();
}

View File

@ -58,6 +58,8 @@ dnode_cons(void *arg, void *unused, int kmflag)
rw_init(&dn->dn_struct_rwlock, NULL, RW_DEFAULT, NULL);
mutex_init(&dn->dn_mtx, NULL, MUTEX_DEFAULT, NULL);
mutex_init(&dn->dn_dbufs_mtx, NULL, MUTEX_DEFAULT, NULL);
cv_init(&dn->dn_notxholds, NULL, CV_DEFAULT, NULL);
refcount_create(&dn->dn_holds);
refcount_create(&dn->dn_tx_holds);
@ -86,6 +88,7 @@ dnode_dest(void *arg, void *unused)
rw_destroy(&dn->dn_struct_rwlock);
mutex_destroy(&dn->dn_mtx);
mutex_destroy(&dn->dn_dbufs_mtx);
cv_destroy(&dn->dn_notxholds);
refcount_destroy(&dn->dn_holds);
refcount_destroy(&dn->dn_tx_holds);

View File

@ -335,6 +335,7 @@ spa_add(const char *name, const char *altroot)
cv_init(&spa->spa_async_cv, NULL, CV_DEFAULT, NULL);
cv_init(&spa->spa_scrub_cv, NULL, CV_DEFAULT, NULL);
cv_init(&spa->spa_scrub_io_cv, NULL, CV_DEFAULT, NULL);
cv_init(&spa->spa_zio_cv, NULL, CV_DEFAULT, NULL);
spa->spa_name = spa_strdup(name);
spa->spa_state = POOL_STATE_UNINITIALIZED;
@ -398,6 +399,7 @@ spa_remove(spa_t *spa)
cv_destroy(&spa->spa_async_cv);
cv_destroy(&spa->spa_scrub_cv);
cv_destroy(&spa->spa_scrub_io_cv);
cv_destroy(&spa->spa_zio_cv);
mutex_destroy(&spa->spa_uberblock_lock);
mutex_destroy(&spa->spa_async_lock);

View File

@ -63,6 +63,8 @@ space_map_create(space_map_t *sm, uint64_t start, uint64_t size, uint8_t shift,
avl_create(&sm->sm_root, space_map_seg_compare,
sizeof (space_seg_t), offsetof(struct space_seg, ss_node));
cv_init(&sm->sm_load_cv, NULL, CV_DEFAULT, NULL);
sm->sm_start = start;
sm->sm_size = size;
sm->sm_shift = shift;
@ -74,6 +76,7 @@ space_map_destroy(space_map_t *sm)
{
ASSERT(!sm->sm_loaded && !sm->sm_loading);
VERIFY3U(sm->sm_space, ==, 0);
cv_destroy(&sm->sm_load_cv);
avl_destroy(&sm->sm_root);
}

View File

@ -72,6 +72,13 @@ txg_init(dsl_pool_t *dp, uint64_t txg)
rw_init(&tx->tx_suspend, NULL, RW_DEFAULT, NULL);
mutex_init(&tx->tx_sync_lock, NULL, MUTEX_DEFAULT, NULL);
cv_init(&tx->tx_sync_more_cv, NULL, CV_DEFAULT, NULL);
cv_init(&tx->tx_sync_done_cv, NULL, CV_DEFAULT, NULL);
cv_init(&tx->tx_quiesce_more_cv, NULL, CV_DEFAULT, NULL);
cv_init(&tx->tx_quiesce_done_cv, NULL, CV_DEFAULT, NULL);
cv_init(&tx->tx_timeout_cv, NULL, CV_DEFAULT, NULL);
cv_init(&tx->tx_exit_cv, NULL, CV_DEFAULT, NULL);
tx->tx_open_txg = txg;
}
@ -86,6 +93,13 @@ txg_fini(dsl_pool_t *dp)
ASSERT(tx->tx_threads == 0);
cv_destroy(&tx->tx_sync_more_cv);
cv_destroy(&tx->tx_sync_done_cv);
cv_destroy(&tx->tx_quiesce_more_cv);
cv_destroy(&tx->tx_quiesce_done_cv);
cv_destroy(&tx->tx_timeout_cv);
cv_destroy(&tx->tx_exit_cv);
rw_destroy(&tx->tx_suspend);
mutex_destroy(&tx->tx_sync_lock);