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

Function vdev_root_open

freebsd/contrib/openzfs/module/zfs/vdev_root.c:83–122  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

81}
82
83static int
84vdev_root_open(vdev_t *vd, uint64_t *asize, uint64_t *max_asize,
85 uint64_t *ashift, uint64_t *pshift)
86{
87 spa_t *spa = vd->vdev_spa;
88 int lasterror = 0;
89 int numerrors = 0;
90
91 if (vd->vdev_children == 0) {
92 vd->vdev_stat.vs_aux = VDEV_AUX_BAD_LABEL;
93 return (SET_ERROR(EINVAL));
94 }
95
96 vdev_open_children(vd);
97
98 for (int c = 0; c < vd->vdev_children; c++) {
99 vdev_t *cvd = vd->vdev_child[c];
100
101 if (cvd->vdev_open_error && !cvd->vdev_islog &&
102 cvd->vdev_ops != &vdev_indirect_ops) {
103 lasterror = cvd->vdev_open_error;
104 numerrors++;
105 }
106 }
107
108 if (spa_load_state(spa) != SPA_LOAD_NONE)
109 spa_set_missing_tvds(spa, numerrors);
110
111 if (too_many_errors(vd, numerrors)) {
112 vd->vdev_stat.vs_aux = VDEV_AUX_NO_REPLICAS;
113 return (lasterror);
114 }
115
116 *asize = 0;
117 *max_asize = 0;
118 *ashift = 0;
119 *pshift = 0;
120
121 return (0);
122}
123
124static void
125vdev_root_close(vdev_t *vd)

Callers

nothing calls this directly

Calls 4

vdev_open_childrenFunction · 0.85
spa_load_stateFunction · 0.85
spa_set_missing_tvdsFunction · 0.85
too_many_errorsFunction · 0.85

Tested by

no test coverage detected