return dlid;
}
+char *build_dlid(struct dev_manager *dm, const char *lvid, const char *layer)
+{
+ return _build_dlid(dm->mem, lvid, layer);
+}
+
/*
* Low level device-layer operations.
*/
const char *trailing_space;
uint64_t esize = seg->lv->vg->extent_size;
char devbuf[10];
+ char *dlid;
for (s = start_area; s < areas; s++, *pos += tw) {
trailing_space = (areas - s - 1) ? " " : "";
(esize * seg_pe(seg, s))),
trailing_space);
else if (seg_type(seg, s) == AREA_LV) {
- if (!build_dev_string(dm, seg_lv(seg, s)->lvid.s, devbuf,
- sizeof(devbuf), "LV")) {
+ if (!(dlid = _build_dlid(dm->mem,
+ seg_lv(seg, s)->lvid.s, NULL))) {
+ stack;
+ return 0;
+ }
+ if (!build_dev_string(dm, dlid,
+ devbuf,sizeof(devbuf), "LV")) {
stack;
return 0;
}
/* add the dependency on the visible origin device */
if (!str_list_add(dm->mem, &dl->pre_suspend,
- snap_seg->origin->lvid.s)) {
+ _build_dlid(dm->mem, snap_seg->origin->lvid.s,
+ NULL))) {
stack;
return 0;
}
/* Rename? */
if (dl->info.exists) {
- if ((suffix = rindex(dl->dlid, '-')))
+ if ((suffix = rindex(dl->dlid + 4, '-')))
suffix++;
newname = build_dm_name(dm->mem, dm->vg_name, dl->lv->name,
suffix);
int tw;
char devbuf[10];
const char *clustered = "";
+ char *dlid;
/*
* Use clustered mirror log for non-exclusive activation
tw = lvm_snprintf(params, paramsize, "%score 1 %u %u ",
clustered, region_size, areas);
else {
- if (!build_dev_string(dm, seg->log_lv->lvid.s, devbuf,
+ if (!(dlid = build_dlid(dm, seg->log_lv->lvid.s, NULL))) {
+ stack;
+ return 0;
+ }
+ if (!build_dev_string(dm, dlid, devbuf,
sizeof(devbuf), "log")) {
stack;
return 0;