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

Function vdev_derive_alloc_bias

freebsd/contrib/openzfs/module/zfs/vdev.c:239–252  ·  view source on GitHub ↗

* Derive the enumerated allocation bias from string input. * String origin is either the per-vdev zap or zpool(8). */

Source from the content-addressed store, hash-verified

237 * String origin is either the per-vdev zap or zpool(8).
238 */
239static vdev_alloc_bias_t
240vdev_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

Callers 2

vdev_allocFunction · 0.85
vdev_loadFunction · 0.85

Calls 1

strcmpFunction · 0.85

Tested by

no test coverage detected