static int detach_metadata_devices(struct lv_segment *seg, struct dm_list *list) { uint32_t s; uint32_t num_meta_lvs; struct cmd_context *cmd = seg->lv->vg->cmd; struct lv_list *lvl; num_meta_lvs = seg_is_raid(seg) ? seg->area_count : !!seg->log_lv; if (!num_meta_lvs) return_0; if (!(lvl = dm_pool_alloc(cmd->mem, sizeof(*lvl) * num_meta_lvs))) return_0; if (seg_is_raid(seg)) { for (s = 0; s < seg->area_count; s++) { if (!seg_metalv(seg, s)) return_0; /* Trap this future possibility */ lvl[s].lv = seg_metalv(seg, s); lv_set_visible(lvl[s].lv); dm_list_add(list, &lvl[s].list); } return 1; } lvl[0].lv = detach_mirror_log(seg); dm_list_add(list, &lvl[0].list); return 1; }
static void _raid_display(const struct lv_segment *seg) { unsigned s; for (s = 0; s < seg->area_count; ++s) { log_print(" Raid Data LV%2d", s); display_stripe(seg, s, " "); } if (seg->meta_areas) for (s = 0; s < seg->area_count; ++s) if (seg_metalv(seg, s)) log_print(" Raid Metadata LV%2d\t%s", s, seg_metalv(seg, s)->name); log_print(" "); }