| 81 | } |
| 82 | |
| 83 | static int |
| 84 | vdev_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 | |
| 124 | static void |
| 125 | vdev_root_close(vdev_t *vd) |
nothing calls this directly
no test coverage detected