| 7953 | */ |
| 7954 | |
| 7955 | static void |
| 7956 | spa_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 | |
| 7983 | static void |
| 7984 | spa_async_probe(spa_t *spa, vdev_t *vd) |
no test coverage detected