* ========================================================================== * 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
| 4295 | * ========================================================================== |
| 4296 | */ |
| 4297 | int |
| 4298 | zio_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 | * ========================================================================== |
no outgoing calls
no test coverage detected