uint32_t meta_extents, prev_meta_extents;
uint32_t area_count, s;
+ if (!lv_is_raid(lv))
+ return_0;
+
seg_top = first_seg(lv);
if (!(segtype = get_segtype_from_string(cmd, SEG_TYPE_NAME_STRIPED)))
struct lv_segment *seg, *seg_image;
uint32_t s;
+ if (!lv_is_raid(lv) && !lv_is_integrity(lv)) {
+ log_error("Invalid LV type for clearing integrity");
+ return;
+ }
+
seg = first_seg(lv);
if (seg_is_raid(seg)) {
}
} else if (seg_is_integrity(seg)) {
seg->integrity_recalculate = 0;
- } else {
- log_error("Invalid LV type for clearing integrity");
- return;
}
if (!vg_write(vg) || !vg_commit(vg)) {
uint32_t s;
int ret = 0;
+ if (!lv_is_raid(lv) && !lv_is_integrity(lv))
+ return_0;
+
seg = first_seg(lv);
if (seg_is_raid(seg)) {
struct lv_segment *seg, *seg_image;
uint32_t s;
- if (!(seg = first_seg(lv)))
- return 0;
+ if (!lv_is_raid(lv))
+ return_0;
- if (seg_is_raid(seg)) {
- for (s = 0; s < seg->area_count; s++) {
- lv_image = seg_lv(seg, s);
- seg_image = first_seg(lv_image);
+ seg = first_seg(lv);
- if (seg_is_integrity(seg_image))
- return 1;
- }
+ for (s = 0; s < seg->area_count; s++) {
+ lv_image = seg_lv(seg, s);
+ seg_image = first_seg(lv_image);
+
+ if (seg_is_integrity(seg_image))
+ return 1;
}
return 0;
struct lv_segment *seg, *seg_image;
uint32_t s;
+ if (!lv_is_raid(lv))
+ return_0;
+
seg = first_seg(lv);
- if (seg_is_raid(seg)) {
- for (s = 0; s < seg->area_count; s++) {
- lv_image = seg_lv(seg, s);
- seg_image = first_seg(lv_image);
+ for (s = 0; s < seg->area_count; s++) {
+ lv_image = seg_lv(seg, s);
+ seg_image = first_seg(lv_image);
- if (seg_is_integrity(seg_image)) {
- *isettings = &seg_image->integrity_settings;
- return 1;
- }
+ if (seg_is_integrity(seg_image)) {
+ *isettings = &seg_image->integrity_settings;
+ return 1;
}
}
{
struct lv_with_info_and_seg_status status;
+ if (!lv_is_integrity(lv))
+ return_0;
+
memset(&status, 0, sizeof(status));
status.seg_status.type = SEG_STATUS_NONE;