MCPcopy Create free account
hub / github.com/F-Stack/f-stack / vdev_state_dirty

Function vdev_state_dirty

freebsd/contrib/openzfs/module/zfs/vdev.c:4661–4682  ·  view source on GitHub ↗

* Mark a top-level vdev's state as dirty, so that the next pass of * spa_sync() can convert this into vdev_config_dirty(). We distinguish * the state changes from larger config changes because they require * much less locking, and are often needed for administrative actions. */

Source from the content-addressed store, hash-verified

4659 * much less locking, and are often needed for administrative actions.
4660 */
4661void
4662vdev_state_dirty(vdev_t *vd)
4663{
4664 spa_t *spa = vd->vdev_spa;
4665
4666 ASSERT(spa_writeable(spa));
4667 ASSERT(vd == vd->vdev_top);
4668
4669 /*
4670 * The state list is protected by the SCL_STATE lock. The caller
4671 * must either hold SCL_STATE as writer, or must be the sync thread
4672 * (which holds SCL_STATE as reader). There's only one sync thread,
4673 * so this is sufficient to ensure mutual exclusion.
4674 */
4675 ASSERT(spa_config_held(spa, SCL_STATE, RW_WRITER) ||
4676 (dsl_pool_sync_context(spa_get_dsl(spa)) &&
4677 spa_config_held(spa, SCL_STATE, RW_READER)));
4678
4679 if (!list_link_active(&vd->vdev_state_dirty_node) &&
4680 vdev_is_concrete(vd))
4681 list_insert_head(&spa->spa_state_dirty_list, vd);
4682}
4683
4684void
4685vdev_state_clean(vdev_t *vd)

Callers 4

spa_vdev_state_exitFunction · 0.85
vdev_top_transferFunction · 0.85
vdev_clearFunction · 0.85
spa_async_removeFunction · 0.85

Calls 7

spa_writeableFunction · 0.85
spa_config_heldFunction · 0.85
dsl_pool_sync_contextFunction · 0.85
spa_get_dslFunction · 0.85
vdev_is_concreteFunction · 0.85
list_link_activeFunction · 0.50
list_insert_headFunction · 0.50

Tested by

no test coverage detected