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

Function zfs_special_devs

freebsd/contrib/openzfs/module/zcommon/zfs_comutil.c:70–96  ·  view source on GitHub ↗

* Are there special vdevs? */

Source from the content-addressed store, hash-verified

68 * Are there special vdevs?
69 */
70boolean_t
71zfs_special_devs(nvlist_t *nv, char *type)
72{
73 char *bias;
74 uint_t c;
75 nvlist_t **child;
76 uint_t children;
77
78 if (nvlist_lookup_nvlist_array(nv, ZPOOL_CONFIG_CHILDREN,
79 &child, &children) != 0) {
80 return (B_FALSE);
81 }
82 for (c = 0; c < children; c++) {
83 if (nvlist_lookup_string(child[c], ZPOOL_CONFIG_ALLOCATION_BIAS,
84 &bias) == 0) {
85 if (strcmp(bias, VDEV_ALLOC_BIAS_SPECIAL) == 0 ||
86 strcmp(bias, VDEV_ALLOC_BIAS_DEDUP) == 0) {
87 if (type != NULL && strcmp(bias, type) == 0) {
88 return (B_TRUE);
89 } else if (type == NULL) {
90 return (B_TRUE);
91 }
92 }
93 }
94 }
95 return (B_FALSE);
96}
97
98void
99zpool_get_load_policy(nvlist_t *nvl, zpool_load_policy_t *zlpp)

Callers 2

spa_createFunction · 0.85
zpool_do_addFunction · 0.85

Calls 3

nvlist_lookup_stringFunction · 0.85
strcmpFunction · 0.85

Tested by

no test coverage detected