* Derive the enumerated allocation bias from string input. * String origin is either the per-vdev zap or zpool(8). */
| 237 | * String origin is either the per-vdev zap or zpool(8). |
| 238 | */ |
| 239 | static vdev_alloc_bias_t |
| 240 | vdev_derive_alloc_bias(const char *bias) |
| 241 | { |
| 242 | vdev_alloc_bias_t alloc_bias = VDEV_BIAS_NONE; |
| 243 | |
| 244 | if (strcmp(bias, VDEV_ALLOC_BIAS_LOG) == 0) |
| 245 | alloc_bias = VDEV_BIAS_LOG; |
| 246 | else if (strcmp(bias, VDEV_ALLOC_BIAS_SPECIAL) == 0) |
| 247 | alloc_bias = VDEV_BIAS_SPECIAL; |
| 248 | else if (strcmp(bias, VDEV_ALLOC_BIAS_DEDUP) == 0) |
| 249 | alloc_bias = VDEV_BIAS_DEDUP; |
| 250 | |
| 251 | return (alloc_bias); |
| 252 | } |
| 253 | |
| 254 | /* |
| 255 | * Default asize function: return the MAX of psize with the asize of |
no test coverage detected