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

Function zio_suspend

freebsd/contrib/openzfs/module/zfs/zio.c:2349–2382  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2347}
2348
2349void
2350zio_suspend(spa_t *spa, zio_t *zio, zio_suspend_reason_t reason)
2351{
2352 if (spa_get_failmode(spa) == ZIO_FAILURE_MODE_PANIC)
2353 fm_panic("Pool '%s' has encountered an uncorrectable I/O "
2354 "failure and the failure mode property for this pool "
2355 "is set to panic.", spa_name(spa));
2356
2357 cmn_err(CE_WARN, "Pool '%s' has encountered an uncorrectable I/O "
2358 "failure and has been suspended.\n", spa_name(spa));
2359
2360 (void) zfs_ereport_post(FM_EREPORT_ZFS_IO_FAILURE, spa, NULL,
2361 NULL, NULL, 0);
2362
2363 mutex_enter(&spa->spa_suspend_lock);
2364
2365 if (spa->spa_suspend_zio_root == NULL)
2366 spa->spa_suspend_zio_root = zio_root(spa, NULL, NULL,
2367 ZIO_FLAG_CANFAIL | ZIO_FLAG_SPECULATIVE |
2368 ZIO_FLAG_GODFATHER);
2369
2370 spa->spa_suspended = reason;
2371
2372 if (zio != NULL) {
2373 ASSERT(!(zio->io_flags & ZIO_FLAG_GODFATHER));
2374 ASSERT(zio != spa->spa_suspend_zio_root);
2375 ASSERT(zio->io_child_type == ZIO_CHILD_LOGICAL);
2376 ASSERT(zio_unique_parent(zio) == NULL);
2377 ASSERT(zio->io_stage == ZIO_STAGE_DONE);
2378 zio_add_child(spa->spa_suspend_zio_root, zio);
2379 }
2380
2381 mutex_exit(&spa->spa_suspend_lock);
2382}
2383
2384int
2385zio_resume(spa_t *spa)

Callers 3

mmp_threadFunction · 0.85
zio_doneFunction · 0.85

Calls 9

spa_get_failmodeFunction · 0.85
spa_nameFunction · 0.85
zfs_ereport_postFunction · 0.85
mutex_enterFunction · 0.85
zio_rootFunction · 0.85
zio_unique_parentFunction · 0.85
zio_add_childFunction · 0.85
mutex_exitFunction · 0.85
cmn_errFunction · 0.50

Tested by

no test coverage detected