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

Function zio_worst_error

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

* ========================================================================== * Error rank. Error are ranked in the order 0, ENXIO, ECKSUM, EIO, other. * An error of 0 indicates success. ENXIO indicates whole-device failure, * which may be transient (e.g. unplugged) or permanent. ECKSUM and EIO * indicate errors that are specific to one I/O, and most likely permanent. * Any other error is p

Source from the content-addressed store, hash-verified

4295 * ==========================================================================
4296 */
4297int
4298zio_worst_error(int e1, int e2)
4299{
4300 static int zio_error_rank[] = { 0, ENXIO, ECKSUM, EIO };
4301 int r1, r2;
4302
4303 for (r1 = 0; r1 < sizeof (zio_error_rank) / sizeof (int); r1++)
4304 if (e1 == zio_error_rank[r1])
4305 break;
4306
4307 for (r2 = 0; r2 < sizeof (zio_error_rank) / sizeof (int); r2++)
4308 if (e2 == zio_error_rank[r2])
4309 break;
4310
4311 return (r1 > r2 ? e1 : e2);
4312}
4313
4314/*
4315 * ==========================================================================

Callers 5

vdev_raidz_worst_errorFunction · 0.85
vdev_mirror_worst_errorFunction · 0.85
zio_notify_parentFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected