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

Function spa_async_remove

freebsd/contrib/openzfs/module/zfs/spa.c:7955–7981  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7953 */
7954
7955static void
7956spa_async_remove(spa_t *spa, vdev_t *vd)
7957{
7958 if (vd->vdev_remove_wanted) {
7959 vd->vdev_remove_wanted = B_FALSE;
7960 vd->vdev_delayed_close = B_FALSE;
7961 vdev_set_state(vd, B_FALSE, VDEV_STATE_REMOVED, VDEV_AUX_NONE);
7962
7963 /*
7964 * We want to clear the stats, but we don't want to do a full
7965 * vdev_clear() as that will cause us to throw away
7966 * degraded/faulted state as well as attempt to reopen the
7967 * device, all of which is a waste.
7968 */
7969 vd->vdev_stat.vs_read_errors = 0;
7970 vd->vdev_stat.vs_write_errors = 0;
7971 vd->vdev_stat.vs_checksum_errors = 0;
7972
7973 vdev_state_dirty(vd->vdev_top);
7974
7975 /* Tell userspace that the vdev is gone. */
7976 zfs_post_remove(spa, vd);
7977 }
7978
7979 for (int c = 0; c < vd->vdev_children; c++)
7980 spa_async_remove(spa, vd->vdev_child[c]);
7981}
7982
7983static void
7984spa_async_probe(spa_t *spa, vdev_t *vd)

Callers 1

spa_async_threadFunction · 0.85

Calls 3

vdev_set_stateFunction · 0.85
vdev_state_dirtyFunction · 0.85
zfs_post_removeFunction · 0.85

Tested by

no test coverage detected