]> sourceware.org Git - lvm2.git/commitdiff
Fix LVM2- prefix changes; export build_dlid.
authorAlasdair Kergon <agk@redhat.com>
Thu, 20 Oct 2005 21:07:57 +0000 (21:07 +0000)
committerAlasdair Kergon <agk@redhat.com>
Thu, 20 Oct 2005 21:07:57 +0000 (21:07 +0000)
lib/activate/dev_manager.c
lib/activate/targets.h
lib/mirror/mirrored.c

index 89af6c27b46a4f0e451232c68a8da9ece3382995..de92333e5987cd9e0a22abb4f194399ddee6dac3 100644 (file)
@@ -182,6 +182,11 @@ static char *_build_dlid(struct dm_pool *mem, const char *lvid, const char *laye
        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.
  */
@@ -770,6 +775,7 @@ int compose_areas_line(struct dev_manager *dm, struct lv_segment *seg,
        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) ? " " : "";
@@ -789,8 +795,13 @@ int compose_areas_line(struct dev_manager *dm, struct lv_segment *seg,
                                           (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;
                        }
@@ -1315,7 +1326,8 @@ static int _expand_snapshot(struct dev_manager *dm, struct logical_volume *lv,
 
        /* 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;
        }
@@ -1574,7 +1586,7 @@ static int _create_rec(struct dev_manager *dm, struct dev_layer *dl)
 
        /* 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);
index 079a481361e386773b6e507de85134a97eab630e..c51079b6462f4a02e32e22e900c2aa391c9f36bf 100644 (file)
@@ -26,4 +26,6 @@ int compose_areas_line(struct dev_manager *dm, struct lv_segment *seg,
 int build_dev_string(struct dev_manager *dm, char *dlid, char *devbuf,
                     size_t bufsize, const char *desc);
 
+char *build_dlid(struct dev_manager *dm, const char *lvid, const char *layer);
+
 #endif
index 01cd6dcdf3cdea245f62813b0007f12d9b500fe8..45a47bd4037f636a9eaba6ec95ae4bd3a18dfcb9 100644 (file)
@@ -170,6 +170,7 @@ static int _compose_log_line(struct dev_manager *dm, struct lv_segment *seg,
        int tw;
        char devbuf[10];
        const char *clustered = "";
+       char *dlid;
 
        /*
         * Use clustered mirror log for non-exclusive activation 
@@ -183,7 +184,11 @@ static int _compose_log_line(struct dev_manager *dm, struct lv_segment *seg,
                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;
This page took 0.041984 seconds and 5 git commands to generate.