Home | History | Annotate | Download | only in metadata

Lines Matching defs:mirrored_seg

143  * @mirrored_seg
165 int shift_mirror_images(struct lv_segment *mirrored_seg, unsigned mimage)
170 if (mimage >= mirrored_seg->area_count) {
176 area = mirrored_seg->areas[mimage];
179 for (i = mimage + 1; i < mirrored_seg->area_count; i++)
180 mirrored_seg->areas[i-1] = mirrored_seg->areas[i];
183 mirrored_seg->areas[i-1] = area;
407 struct logical_volume *detach_mirror_log(struct lv_segment *mirrored_seg)
411 if (!mirrored_seg->log_lv)
414 log_lv = mirrored_seg->log_lv;
415 mirrored_seg->log_lv = NULL;
418 remove_seg_from_segs_using_this_lv(log_lv, mirrored_seg);
465 * Remove num_removed images from mirrored_seg
500 struct lv_segment *mirrored_seg = first_seg(lv);
501 uint32_t old_area_count = mirrored_seg->area_count;
502 uint32_t new_area_count = mirrored_seg->area_count;
522 for (s = 0; s < mirrored_seg->area_count &&
524 sub_lv = seg_lv(mirrored_seg, s);
528 if (!shift_mirror_images(mirrored_seg, s))
540 for (m = new_area_count; m < mirrored_seg->area_count; m++) {
541 seg_lv(mirrored_seg, m)->status &= ~MIRROR_IMAGE;
542 lv_set_visible(seg_lv(mirrored_seg, m));
547 lvl->lv = seg_lv(mirrored_seg, m);
549 release_lv_segment_area(mirrored_seg, m, mirrored_seg->area_len);
551 mirrored_seg->area_count = new_area_count;
558 lv1 = seg_lv(mirrored_seg, 0);
561 detached_log_lv = detach_mirror_log(mirrored_seg);
575 detached_log_lv = detach_mirror_log(mirrored_seg);
581 detached_log_lv = detach_mirror_log(mirrored_seg);
589 if (!vg_write(mirrored_seg->lv->vg)) {
594 if (!suspend_lv(mirrored_seg->lv->vg->cmd, mirrored_seg->lv)) {
595 log_error("Failed to lock %s", mirrored_seg->lv->name);
596 vg_revert(mirrored_seg->lv->vg);
600 if (!vg_commit(mirrored_seg->lv->vg)) {
601 resume_lv(mirrored_seg->lv->vg->cmd, mirrored_seg
605 log_very_verbose("Updating \"%s\" in kernel", mirrored_seg->lv->name);
610 * As it's now detached from mirrored_seg->lv we must resume it
632 if (!resume_lv(mirrored_seg->lv->vg->cmd, mirrored_seg->lv)) {
633 log_error("Problem reactivating %s", mirrored_seg->lv->name);
813 * @mirrored_seg: segment (which may be linear now) to restore
824 static int replace_mirror_images(struct lv_segment *mirrored_seg,
829 struct logical_volume *lv = mirrored_seg->lv;
833 if (mirrored_seg->area_count < num_mirrors) {
835 mirrored_seg->lv->vg->name, mirrored_seg->lv->name);
837 if ((mirrored_seg->area_count > 1) && !mirrored_seg->log_lv)
853 if ((mirrored_seg->area_count > 1) && !mirrored_seg->log_lv &&
859 mirrored_seg->area_count - 1 , lv->vg->name, lv->name);
866 int reconfigure_mirror_images(struct lv_segment *mirrored_seg, uint32_t num_mirrors,
872 uint32_t old_num_mirrors = mirrored_seg->area_count;
873 int had_log = (mirrored_seg->log_lv) ? 1 : 0;
876 in_sync = _mirrored_lv_in_sync(mirrored_seg->lv);
885 r = _remove_mirror_images(mirrored_seg->lv, old_num_mirrors - num_mirrors,
892 mirrored_seg->lv->vg->name, mirrored_seg->lv->name);
894 log_policy = get_mirror_log_fault_policy(mirrored_seg->lv->vg->cmd);
895 dev_policy = get_mirror_device_fault_policy(mirrored_seg->lv->vg->cmd);
897 r = replace_mirror_images(mirrored_seg,
905 mirrored_seg->lv->vg->name, mirrored_seg->lv->name);
909 mirrored_seg->lv->vg->name, mirrored_seg->lv->name);
912 if (mirrored_seg->area_count == 1) {
914 mirrored_seg->lv->vg->name, mirrored_seg->lv->name);
915 } else if (had_log && !mirrored_seg->log_lv) {
917 mirrored_seg->lv->vg->name, mirrored_seg->lv->name);