Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 35296 Details for
Bug 56873
lvm2-2.00.15-r1.ebuild (Update)
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
paatch against lvm2 sources
lvm2-2.00.15-linux-2.6.7.patch (text/plain), 253.44 KB, created by
Bruno Redondi
on 2004-07-13 01:33:09 UTC
(
hide
)
Description:
paatch against lvm2 sources
Filename:
MIME Type:
Creator:
Bruno Redondi
Created:
2004-07-13 01:33:09 UTC
Size:
253.44 KB
patch
obsolete
>diff -ruN LVM2.2.00.15.orig/lib/activate/activate.c LVM2.2.00.15/lib/activate/activate.c >--- LVM2.2.00.15.orig/lib/activate/activate.c 2004-04-14 17:33:04.000000000 +0000 >+++ LVM2.2.00.15/lib/activate/activate.c 2004-07-03 20:59:05.811605352 +0000 >@@ -180,7 +180,7 @@ > > if (!(cn = find_config_node(cmd->cft->root, "activation/volume_list"))) { > /* If no hosts tags defined, activate */ >- if (list_empty(&cmd->tags)) >+ if (lvm_list_empty(&cmd->tags)) > return 1; > > /* If any host tag matches any LV or VG tag, activate */ >@@ -270,7 +270,7 @@ > > log_very_verbose("Getting driver version"); > if (!(dmt = dm_task_create(DM_DEVICE_VERSION))) { >- stack; >+ STACK; > return 0; > } > >@@ -299,7 +299,7 @@ > > log_very_verbose("Getting target version for %s", target_name); > if (!(dmt = dm_task_create(DM_DEVICE_LIST_VERSIONS))) { >- stack; >+ STACK; > return 0; > } > >@@ -342,12 +342,12 @@ > return 0; > > if (!(dm = dev_manager_create(lv->vg->name, lv->vg->cmd->cft))) { >- stack; >+ STACK; > return 0; > } > > if (!(r = dev_manager_info(dm, lv, mknodes, &dminfo))) >- stack; >+ STACK; > > info->exists = dminfo.exists; > info->suspended = dminfo.suspended; >@@ -388,12 +388,12 @@ > return 0; > > if (!(dm = dev_manager_create(lv->vg->name, lv->vg->cmd->cft))) { >- stack; >+ STACK; > return 0; > } > > if (!(r = dev_manager_snapshot_percent(dm, lv, percent))) >- stack; >+ STACK; > > dev_manager_destroy(dm); > >@@ -412,7 +412,7 @@ > return 0; > > if (!lv_info(lv, &info)) { >- stack; >+ STACK; > return 0; > } > >@@ -420,12 +420,12 @@ > return 0; > > if (!(dm = dev_manager_create(lv->vg->name, lv->vg->cmd->cft))) { >- stack; >+ STACK; > return 0; > } > > if (!(r = dev_manager_mirror_percent(dm, lv, wait, percent, event_nr))) >- stack; >+ STACK; > > dev_manager_destroy(dm); > >@@ -437,7 +437,7 @@ > struct lvinfo info; > > if (!lv_info(lv, &info)) { >- stack; >+ STACK; > return -1; > } > >@@ -449,7 +449,7 @@ > struct lvinfo info; > > if (!lv_info(lv, &info)) { >- stack; >+ STACK; > return -1; > } > >@@ -463,12 +463,12 @@ > struct dev_manager *dm; > > if (!(dm = dev_manager_create(lv->vg->name, lv->vg->cmd->cft))) { >- stack; >+ STACK; > return 0; > } > > if (!(r = dev_manager_activate(dm, lv))) >- stack; >+ STACK; > > dev_manager_destroy(dm); > return r; >@@ -480,12 +480,12 @@ > struct dev_manager *dm; > > if (!(dm = dev_manager_create(lv->vg->name, lv->vg->cmd->cft))) { >- stack; >+ STACK; > return 0; > } > > if (!(r = dev_manager_deactivate(dm, lv))) >- stack; >+ STACK; > > dev_manager_destroy(dm); > return r; >@@ -497,12 +497,12 @@ > struct dev_manager *dm; > > if (!(dm = dev_manager_create(lv->vg->name, lv->vg->cmd->cft))) { >- stack; >+ STACK; > return 0; > } > > if (!(r = dev_manager_suspend(dm, lv))) >- stack; >+ STACK; > > dev_manager_destroy(dm); > return r; >@@ -514,15 +514,15 @@ > */ > int lvs_in_vg_activated(struct volume_group *vg) > { >- struct list *lvh; >+ struct lvm_list *lvh; > struct logical_volume *lv; > int count = 0; > > if (!activation()) > return 0; > >- list_iterate(lvh, &vg->lvs) { >- lv = list_item(lvh, struct lv_list)->lv; >+ lvm_list_iterate(lvh, &vg->lvs) { >+ lv = lvm_list_item(lvh, struct lv_list)->lv; > count += (_lv_active(lv) == 1); > } > >@@ -531,15 +531,15 @@ > > int lvs_in_vg_opened(struct volume_group *vg) > { >- struct list *lvh; >+ struct lvm_list *lvh; > struct logical_volume *lv; > int count = 0; > > if (!activation()) > return 0; > >- list_iterate(lvh, &vg->lvs) { >- lv = list_item(lvh, struct lv_list)->lv; >+ lvm_list_iterate(lvh, &vg->lvs) { >+ lv = lvm_list_item(lvh, struct lv_list)->lv; > count += (_lv_open_count(lv) > 0); > } > >@@ -564,7 +564,7 @@ > } > > if (!lv_info(lv, &info)) { >- stack; >+ STACK; > return 0; > } > >@@ -610,7 +610,7 @@ > } > > if (!lv_info(lv, &info)) { >- stack; >+ STACK; > return 0; > } > >@@ -655,7 +655,7 @@ > } > > if (!lv_info(lv, &info)) { >- stack; >+ STACK; > return 0; > } > >@@ -724,7 +724,7 @@ > } > > if (!lv_info(lv, &info)) { >- stack; >+ STACK; > return 0; > } > >@@ -763,7 +763,7 @@ > } > > if (!_lv_info(lv, 1, &info)) { >- stack; >+ STACK; > return 0; > } > >diff -ruN LVM2.2.00.15.orig/lib/activate/dev_manager.c LVM2.2.00.15/lib/activate/dev_manager.c >--- LVM2.2.00.15.orig/lib/activate/dev_manager.c 2004-03-30 19:35:37.000000000 +0000 >+++ LVM2.2.00.15/lib/activate/dev_manager.c 2004-07-03 19:26:25.132957000 +0000 >@@ -99,15 +99,15 @@ > * Devices that must be created before this one can be created. > * Reloads get propagated to this list. Holds str_lists. > */ >- struct list pre_create; >+ struct lvm_list pre_create; > > /* Inverse of pre_create */ >- struct list pre_suspend; >+ struct lvm_list pre_suspend; > > }; > > struct dl_list { >- struct list list; >+ struct lvm_list list; > struct dev_layer *dl; > }; > >@@ -128,22 +128,22 @@ > * list of struct lv_list, contains lvs that we wish to > * be active after execution. > */ >- struct list active_list; >+ struct lvm_list active_list; > > /* > * Layers that need reloading. > */ >- struct list reload_list; >+ struct lvm_list reload_list; > > /* > * Layers that need suspending. > */ >- struct list suspend_list; >+ struct lvm_list suspend_list; > > /* > * Layers that will need removing after activation. > */ >- struct list remove_list; >+ struct lvm_list remove_list; > > struct hash_table *layers; > }; >@@ -213,7 +213,7 @@ > len += hyphens + 2; > > if (!(r = pool_alloc(mem, len))) { >- stack; >+ STACK; > return NULL; > } > >@@ -260,7 +260,7 @@ > len = strlen(lvid) + strlen(layer) + 2; > > if (!(dlid = pool_alloc(mem, len))) { >- stack; >+ STACK; > return NULL; > } > >@@ -278,7 +278,7 @@ > struct dm_task *dmt; > > if (!(dmt = dm_task_create(task))) { >- stack; >+ STACK; > return NULL; > } > >@@ -305,23 +305,23 @@ > dmtask = mknodes ? DM_DEVICE_MKNODES : DM_DEVICE_INFO; > > if (!(dmt = _setup_task(name, uuid, 0, dmtask))) { >- stack; >+ STACK; > return 0; > } > > if (!dm_task_run(dmt)) { >- stack; >+ STACK; > goto out; > } > > if (!dm_task_get_info(dmt, info)) { >- stack; >+ STACK; > goto out; > } > > if (info->exists && uuid_out) { > if (!(u = dm_task_get_uuid(dmt))) { >- stack; >+ STACK; > goto out; > } > *uuid_out = pool_strdup(mem, u); >@@ -359,12 +359,12 @@ > char *params = NULL; > > if (!(dmt = _setup_task(name, uuid, 0, DM_DEVICE_STATUS))) { >- stack; >+ STACK; > return 0; > } > > if (!dm_task_run(dmt)) { >- stack; >+ STACK; > goto out; > } > >@@ -428,7 +428,7 @@ > char *type = NULL; > char *params = NULL; > float percent2; >- struct list *segh = &lv->segments; >+ struct lvm_list *segh = &lv->segments; > struct lv_segment *seg = NULL; > > uint64_t numerator, denominator; >@@ -439,17 +439,17 @@ > if (!(dmt = _setup_task(name, uuid, event_nr, > wait ? DM_DEVICE_WAITEVENT : DM_DEVICE_STATUS))) > { >- stack; >+ STACK; > return 0; > } > > if (!dm_task_run(dmt)) { >- stack; >+ STACK; > goto out; > } > > if (!dm_task_get_info(dmt, &info) || !info.exists) { >- stack; >+ STACK; > goto out; > } > >@@ -460,12 +460,12 @@ > next = dm_get_next_target(dmt, next, &start, &length, &type, > ¶ms); > if (lv) { >- if (!(segh = list_next(&lv->segments, segh))) { >+ if (!(segh = lvm_list_next(&lv->segments, segh))) { > log_error("Number of segments in active LV %s " > "does not match metadata", lv->name); > goto out; > } >- seg = list_item(segh, struct lv_segment); >+ seg = lvm_list_item(segh, struct lv_segment); > } > > if (!type || !params || strcmp(type, target_type)) >@@ -507,7 +507,7 @@ > } > } while (next); > >- if (lv && (segh = list_next(&lv->segments, segh))) { >+ if (lv && (segh = lvm_list_next(&lv->segments, segh))) { > log_error("Number of segments in active LV %s does not " > "match metadata", lv->name); > goto out; >@@ -551,12 +551,12 @@ > log_verbose("Renaming %s to %s", dl->name, newname); > > if (!(dmt = _setup_task(dl->name, NULL, 0, DM_DEVICE_RENAME))) { >- stack; >+ STACK; > return 0; > } > > if (!dm_task_set_newname(dmt, newname)) { >- stack; >+ STACK; > r = 0; > goto out; > } >@@ -582,7 +582,7 @@ > log_verbose("Loading %s", dl->name); > if (!(dmt = _setup_task(task == DM_DEVICE_CREATE ? dl->name : NULL, > dl->dlid, 0, task))) { >- stack; >+ STACK; > return 0; > } > >@@ -639,13 +639,13 @@ > } > > if (!dm_task_get_info(dmt, &dl->info)) { >- stack; >+ STACK; > r = 0; > goto out; > } > > if (!dl->info.exists || !dl->info.live_table) { >- stack; >+ STACK; > r = 0; > goto out; > } >@@ -674,7 +674,7 @@ > log_very_verbose("Removing %s", dl->name); > > if (!(dmt = _setup_task(dl->name, NULL, 0, DM_DEVICE_REMOVE))) { >- stack; >+ STACK; > return 0; > } > >@@ -705,7 +705,7 @@ > > log_very_verbose("%s %s", sus ? "Suspending" : "Resuming", name); > if (!(dmt = _setup_task(name, NULL, 0, task))) { >- stack; >+ STACK; > return 0; > } > >@@ -723,7 +723,7 @@ > return 1; > > if (!_suspend_or_resume(dl->name, SUSPEND)) { >- stack; >+ STACK; > return 0; > } > >@@ -737,7 +737,7 @@ > return 1; > > if (!_suspend_or_resume(dl->name, RESUME)) { >- stack; >+ STACK; > return 0; > } > >@@ -858,7 +858,7 @@ > > if (!dm_task_add_target(dmt, esize * seg->le, esize * seg->len, > target, params)) { >- stack; >+ STACK; > return 0; > } > >@@ -887,7 +887,7 @@ > dbg_free(params); > > if (!ret) >- stack; >+ STACK; > > if (ret >= 0) > return ret; >@@ -902,14 +902,14 @@ > static int _populate_vanilla(struct dev_manager *dm, > struct dm_task *dmt, struct dev_layer *dl) > { >- struct list *segh; >+ struct lvm_list *segh; > struct lv_segment *seg; > struct logical_volume *lv = dl->lv; > > dm->pvmove_mirror_count = 0u; > >- list_iterate(segh, &lv->segments) { >- seg = list_item(segh, struct lv_segment); >+ lvm_list_iterate(segh, &lv->segments) { >+ seg = lvm_list_item(segh, struct lv_segment); > if (!_emit_target(dm, dmt, seg)) { > log_error("Unable to build table for '%s'", lv->name); > return 0; >@@ -927,7 +927,7 @@ > struct dev_layer *dlr; > > if (!(real = _build_dlid(dm->mem, dl->lv->lvid.s, "real"))) { >- stack; >+ STACK; > return 0; > } > >@@ -947,7 +947,7 @@ > dl->lv->size, params); > if (!dm_task_add_target(dmt, UINT64_C(0), dl->lv->size, > "snapshot-origin", params)) { >- stack; >+ STACK; > return 0; > } > >@@ -969,12 +969,12 @@ > } > > if (!(origin = _build_dlid(dm->mem, s->origin->lvid.s, "real"))) { >- stack; >+ STACK; > return 0; > } > > if (!(cow = _build_dlid(dm->mem, s->cow->lvid.s, "cow"))) { >- stack; >+ STACK; > return 0; > } > >@@ -1005,7 +1005,7 @@ > > if (lvm_snprintf(params, sizeof(params), "%s %s P %d", > devbufo, devbufc, s->chunk_size) == -1) { >- stack; >+ STACK; > return 0; > } > >@@ -1013,7 +1013,7 @@ > s->origin->size, params); > if (!dm_task_add_target > (dmt, UINT64_C(0), s->origin->size, "snapshot", params)) { >- stack; >+ STACK; > return 0; > } > >@@ -1030,12 +1030,12 @@ > struct dev_manager *dm; > > if (!(mem = pool_create(16 * 1024))) { >- stack; >+ STACK; > return NULL; > } > > if (!(dm = pool_alloc(mem, sizeof(*dm)))) { >- stack; >+ STACK; > goto bad; > } > >@@ -1056,19 +1056,19 @@ > dm->mirror_region_size = mirror_region_size; > > if (!(dm->vg_name = pool_strdup(dm->mem, vg_name))) { >- stack; >+ STACK; > goto bad; > } > > if (!(dm->layers = hash_create(32))) { >- stack; >+ STACK; > goto bad; > } > >- list_init(&dm->active_list); >- list_init(&dm->reload_list); >- list_init(&dm->remove_list); >- list_init(&dm->suspend_list); >+ lvm_list_init(&dm->active_list); >+ lvm_list_init(&dm->reload_list); >+ lvm_list_init(&dm->remove_list); >+ lvm_list_init(&dm->suspend_list); > > return dm; > >@@ -1092,7 +1092,7 @@ > * Build a name for the top layer. > */ > if (!(name = _build_name(dm->mem, lv->vg->name, lv->name, NULL))) { >- stack; >+ STACK; > return 0; > } > >@@ -1101,7 +1101,7 @@ > */ > log_debug("Getting device info for %s", name); > if (!_info(name, lv->lvid.s, mknodes, info, NULL, NULL)) { >- stack; >+ STACK; > return 0; > } > >@@ -1117,7 +1117,7 @@ > * Build a name for the top layer. > */ > if (!(name = _build_name(dm->mem, lv->vg->name, lv->name, NULL))) { >- stack; >+ STACK; > return 0; > } > >@@ -1127,7 +1127,7 @@ > log_debug("Getting device status percentage for %s", name); > if (!(_percent(dm, name, lv->lvid.s, "snapshot", 0, NULL, percent, > NULL))) { >- stack; >+ STACK; > return 0; > } > >@@ -1149,7 +1149,7 @@ > * Build a name for the top layer. > */ > if (!(name = _build_name(dm->mem, lv->vg->name, lv->name, NULL))) { >- stack; >+ STACK; > return 0; > } > >@@ -1158,7 +1158,7 @@ > log_debug("Getting device mirror status percentage for %s", name); > if (!(_percent(dm, name, lv->lvid.s, "mirror", wait, lv, percent, > event_nr))) { >- stack; >+ STACK; > return 0; > } > >@@ -1172,7 +1172,7 @@ > char *uuid; > > if (!(dl = pool_zalloc(dm->mem, sizeof(*dl)))) { >- stack; >+ STACK; > return NULL; > } > >@@ -1180,7 +1180,7 @@ > > log_debug("Getting device info for %s", dl->name); > if (!_info(dl->name, dlid, 0, &dl->info, dm->mem, &uuid)) { >- stack; >+ STACK; > return NULL; > } > >@@ -1189,11 +1189,11 @@ > else > dl->dlid = dlid; > >- list_init(&dl->pre_create); >- list_init(&dl->pre_suspend); >+ lvm_list_init(&dl->pre_create); >+ lvm_list_init(&dl->pre_suspend); > > if (!hash_insert(dm->layers, dl->dlid, dl)) { >- stack; >+ STACK; > return NULL; > } > >@@ -1213,18 +1213,18 @@ > struct dev_layer *dl; > > if (!(name = _build_name(dm->mem, lv->vg->name, lv->name, layer))) { >- stack; >+ STACK; > return NULL; > } > > if (!(dlid = _build_dlid(dm->mem, lv->lvid.s, layer))) { >- stack; >+ STACK; > return NULL; > } > > if (!(dl = hash_lookup(dm->layers, dlid)) && > !(dl = _create_dev(dm, name, dlid))) { >- stack; >+ STACK; > return NULL; > } > >@@ -1246,7 +1246,7 @@ > struct dev_layer *dl; > > if (!(dlid = _build_dlid(dm->mem, lvid, layer))) { >- stack; >+ STACK; > return NULL; > } > >@@ -1262,12 +1262,12 @@ > * only one layer. > */ > struct dev_layer *dl, *dlr; >- struct list *segh; >+ struct lvm_list *segh; > struct lv_segment *seg; > uint32_t s; > > if (!(dl = _create_layer(dm, NULL, lv))) { >- stack; >+ STACK; > return 0; > } > dl->populate = _populate_vanilla; >@@ -1280,8 +1280,8 @@ > _set_flag(dl, TOPLEVEL); > > /* Add dependencies for any LVs that segments refer to */ >- list_iterate(segh, &lv->segments) { >- seg = list_item(segh, struct lv_segment); >+ lvm_list_iterate(segh, &lv->segments) { >+ seg = lvm_list_item(segh, struct lv_segment); > if (seg->type != SEG_STRIPED && seg->type != SEG_MIRRORED) > continue; > for (s = 0; s < seg->area_count; s++) { >@@ -1291,7 +1291,7 @@ > _build_dlid(dm->mem, > seg->area[s].u.lv. > lv->lvid.s, NULL))) { >- stack; >+ STACK; > return 0; > } > _set_flag(dl, NOPROPAGATE); >@@ -1303,7 +1303,7 @@ > > /* Deactivating the last snapshot */ > if (!(dlr = _create_layer(dm, "real", lv))) { >- stack; >+ STACK; > return 0; > } > >@@ -1315,7 +1315,7 @@ > /* add the dependency on the real device */ > if (!str_list_add(dm->mem, &dl->pre_create, > pool_strdup(dm->mem, dlr->dlid))) { >- stack; >+ STACK; > return 0; > } > >@@ -1329,7 +1329,7 @@ > const char *real_dlid; > > if (!(dl = _create_layer(dm, "real", lv))) { >- stack; >+ STACK; > return 0; > } > dl->populate = _populate_vanilla; >@@ -1339,7 +1339,7 @@ > real_dlid = dl->dlid; > > if (!(dl = _create_layer(dm, NULL, lv))) { >- stack; >+ STACK; > return 0; > } > dl->populate = _populate_origin; >@@ -1349,7 +1349,7 @@ > /* add the dependency on the real device */ > if (!str_list_add(dm->mem, &dl->pre_create, > pool_strdup(dm->mem, real_dlid))) { >- stack; >+ STACK; > return 0; > } > >@@ -1360,14 +1360,14 @@ > { > struct logical_volume *active; > struct snapshot *s; >- struct list *sh; >+ struct lvm_list *sh; > > /* > * We only need to create an origin layer if one of our > * snapshots is in the active list > */ >- list_iterate(sh, &dm->active_list) { >- active = list_item(sh, struct lv_list)->lv; >+ lvm_list_iterate(sh, &dm->active_list) { >+ active = lvm_list_item(sh, struct lv_list)->lv; > if ((s = find_cow(active)) && (s->origin == lv)) > return _expand_origin_real(dm, lv); > } >@@ -1389,7 +1389,7 @@ > const char *cow_dlid; > > if (!(dl = _create_layer(dm, "cow", lv))) { >- stack; >+ STACK; > return 0; > } > dl->populate = _populate_vanilla; >@@ -1400,7 +1400,7 @@ > cow_dlid = dl->dlid; > > if (!(dl = _create_layer(dm, NULL, lv))) { >- stack; >+ STACK; > return 0; > } > dl->populate = _populate_snapshot; >@@ -1410,20 +1410,20 @@ > /* add the dependency on the cow device */ > if (!str_list_add(dm->mem, &dl->pre_create, > pool_strdup(dm->mem, cow_dlid))) { >- stack; >+ STACK; > return 0; > } > > /* add the dependency on the real origin device */ > if (!str_list_add(dm->mem, &dl->pre_create, > _build_dlid(dm->mem, s->origin->lvid.s, "real"))) { >- stack; >+ STACK; > return 0; > } > > /* add the dependency on the visible origin device */ > if (!str_list_add(dm->mem, &dl->pre_suspend, s->origin->lvid.s)) { >- stack; >+ STACK; > return 0; > } > >@@ -1469,12 +1469,12 @@ > static int _trace_layer_marks(struct dev_manager *dm, struct dev_layer *dl, > int flag) > { >- struct list *sh; >+ struct lvm_list *sh; > const char *dlid; > struct dev_layer *dep; > >- list_iterate(sh, &dl->pre_create) { >- dlid = list_item(sh, struct str_list)->str; >+ lvm_list_iterate(sh, &dl->pre_create) { >+ dlid = lvm_list_item(sh, struct str_list)->str; > > if (!(dep = hash_lookup(dm->layers, dlid))) { > log_error("Couldn't find device layer '%s'.", dlid); >@@ -1491,7 +1491,7 @@ > _set_flag(dep, flag); > > if (!_trace_layer_marks(dm, dep, flag)) { >- stack; >+ STACK; > return 0; > } > } >@@ -1510,7 +1510,7 @@ > hash_iterate(hn, dm->layers) { > dl = hash_get_data(dm->layers, hn); > if (_get_flag(dl, flag) && !_trace_layer_marks(dm, dl, flag)) { >- stack; >+ STACK; > return 0; > } > } >@@ -1522,17 +1522,17 @@ > * Marks the top layers, then traces these through the > * dependencies. > */ >-static int _mark_lvs(struct dev_manager *dm, struct list *lvs, int flag) >+static int _mark_lvs(struct dev_manager *dm, struct lvm_list *lvs, int flag) > { >- struct list *lvh; >+ struct lvm_list *lvh; > struct logical_volume *lv; > struct dev_layer *dl; > >- list_iterate(lvh, lvs) { >- lv = list_item(lvh, struct lv_list)->lv; >+ lvm_list_iterate(lvh, lvs) { >+ lv = lvm_list_item(lvh, struct lv_list)->lv; > > if (!(dl = _lookup(dm, lv->lvid.s, NULL))) { >- stack; >+ STACK; > return 0; > } > >@@ -1540,7 +1540,7 @@ > } > > if (!_trace_all_marks(dm, flag)) { >- stack; >+ STACK; > return 0; > } > >@@ -1549,12 +1549,12 @@ > > static int _suspend_parents(struct dev_manager *dm, struct dev_layer *dl) > { >- struct list *sh; >+ struct lvm_list *sh; > struct dev_layer *dep; > const char *dlid; > >- list_iterate(sh, &dl->pre_suspend) { >- dlid = list_item(sh, struct str_list)->str; >+ lvm_list_iterate(sh, &dl->pre_suspend) { >+ dlid = lvm_list_item(sh, struct str_list)->str; > > if (!(dep = hash_lookup(dm->layers, dlid))) { > log_debug("_suspend_parents couldn't find device " >@@ -1568,12 +1568,12 @@ > } > > if (!_suspend_parents(dm, dep)) { >- stack; >+ STACK; > return 0; > } > > if (dep->info.exists & !_suspend(dep)) { >- stack; >+ STACK; > return 0; > } > } >@@ -1583,12 +1583,12 @@ > > static int _resume_with_deps(struct dev_manager *dm, struct dev_layer *dl) > { >- struct list *sh; >+ struct lvm_list *sh; > struct dev_layer *dep; > const char *dlid; > >- list_iterate(sh, &dl->pre_create) { >- dlid = list_item(sh, struct str_list)->str; >+ lvm_list_iterate(sh, &dl->pre_create) { >+ dlid = lvm_list_item(sh, struct str_list)->str; > > if (!(dep = hash_lookup(dm->layers, dlid))) { > log_debug("_resume_with_deps couldn't find device " >@@ -1602,13 +1602,13 @@ > } > > if (!_resume_with_deps(dm, dep)) { >- stack; >+ STACK; > return 0; > } > } > > if (dl->info.exists & !_get_flag(dl, SUSPENDED) && !_resume(dl)) { >- stack; >+ STACK; > return 0; > } > >@@ -1621,7 +1621,7 @@ > */ > static int _create_rec(struct dev_manager *dm, struct dev_layer *dl) > { >- struct list *sh; >+ struct lvm_list *sh; > struct dev_layer *dep; > const char *dlid; > char *newname, *suffix; >@@ -1629,12 +1629,12 @@ > /* Suspend? */ > if (_get_flag(dl, SUSPENDED) && > (!_suspend_parents(dm, dl) || !_suspend(dl))) { >- stack; >+ STACK; > return 0; > } > >- list_iterate(sh, &dl->pre_create) { >- dlid = list_item(sh, struct str_list)->str; >+ lvm_list_iterate(sh, &dl->pre_create) { >+ dlid = lvm_list_item(sh, struct str_list)->str; > > if (!(dep = hash_lookup(dm->layers, dlid))) { > log_error("Couldn't find device layer '%s'.", dlid); >@@ -1647,7 +1647,7 @@ > } > > if (!_create_rec(dm, dep)) { >- stack; >+ STACK; > return 0; > } > } >@@ -1661,7 +1661,7 @@ > if (strcmp(newname, dl->name)) { > if (!_suspend_parents(dm, dl) || > !_suspend(dl) || !_rename(dl, newname)) { >- stack; >+ STACK; > return 0; > } > } >@@ -1671,7 +1671,7 @@ > if (!dl->info.exists) { > if (!_suspend_parents(dm, dl) || > !_load(dm, dl, DM_DEVICE_CREATE)) { >- stack; >+ STACK; > return 0; > } > return 1; >@@ -1681,7 +1681,7 @@ > if (_get_flag(dl, RELOAD) && > (!_suspend_parents(dm, dl) || !_suspend(dl) || > !_load(dm, dl, DM_DEVICE_RELOAD))) { >- stack; >+ STACK; > return 0; > } > >@@ -1691,16 +1691,16 @@ > > static int _build_all_layers(struct dev_manager *dm, struct volume_group *vg) > { >- struct list *lvh; >+ struct lvm_list *lvh; > struct logical_volume *lvt; > > /* > * Build layers for complete vg. > */ >- list_iterate(lvh, &vg->lvs) { >- lvt = list_item(lvh, struct lv_list)->lv; >+ lvm_list_iterate(lvh, &vg->lvs) { >+ lvt = lvm_list_item(lvh, struct lv_list)->lv; > if (!_expand_lv(dm, lvt)) { >- stack; >+ STACK; > return 0; > } > } >@@ -1723,12 +1723,12 @@ > if (!_get_flag(dl, ACTIVE)) { > dll = pool_alloc(dm->mem, sizeof(*dll)); > if (!dll) { >- stack; >+ STACK; > return 0; > } > > dll->dl = dl; >- list_add(&dm->remove_list, &dll->list); >+ lvm_list_add(&dm->remove_list, &dll->list); > } > } > >@@ -1739,15 +1739,15 @@ > { > struct hash_node *hn; > struct dev_layer *dl; >- struct list *sh; >+ struct lvm_list *sh; > const char *dlid; > struct dev_layer *dep; > > hash_iterate(hn, dm->layers) { > dl = hash_get_data(dm->layers, hn); > >- list_iterate(sh, &dl->pre_suspend) { >- dlid = list_item(sh, struct str_list)->str; >+ lvm_list_iterate(sh, &dl->pre_suspend) { >+ dlid = lvm_list_item(sh, struct str_list)->str; > > if (!(dep = hash_lookup(dm->layers, dlid))) { > log_debug("_populate_pre_suspend_lists: " >@@ -1758,13 +1758,13 @@ > > if (!str_list_add(dm->mem, &dep->pre_create, > dl->dlid)) { >- stack; >+ STACK; > return 0; > } > } > >- list_iterate(sh, &dl->pre_create) { >- dlid = list_item(sh, struct str_list)->str; >+ lvm_list_iterate(sh, &dl->pre_create) { >+ dlid = lvm_list_item(sh, struct str_list)->str; > > if (!(dep = hash_lookup(dm->layers, dlid))) { > log_debug("_populate_pre_suspend_lists: " >@@ -1775,7 +1775,7 @@ > > if (!str_list_add(dm->mem, &dep->pre_suspend, > dl->dlid)) { >- stack; >+ STACK; > return 0; > } > } >@@ -1790,30 +1790,30 @@ > static int _remove_old_layers(struct dev_manager *dm) > { > int change; >- struct list *rh, *n; >+ struct lvm_list *rh, *n; > struct dev_layer *dl; > > do { > change = 0; >- list_iterate_safe(rh, n, &dm->remove_list) { >- dl = list_item(rh, struct dl_list)->dl; >+ lvm_list_iterate_safe(rh, n, &dm->remove_list) { >+ dl = lvm_list_item(rh, struct dl_list)->dl; > > if (!dl->info.exists) { >- list_del(rh); >+ lvm_list_del(rh); > continue; > } > > if (_remove(dl)) { > change = 1; >- list_del(rh); >+ lvm_list_del(rh); > } > } > > } while (change); > >- if (!list_empty(&dm->remove_list)) { >- list_iterate(rh, &dm->remove_list) { >- dl = list_item(rh, struct dl_list)->dl; >+ if (!lvm_list_empty(&dm->remove_list)) { >+ lvm_list_iterate(rh, &dm->remove_list) { >+ dl = lvm_list_item(rh, struct dl_list)->dl; > log_error("Couldn't deactivate device %s", dl->name); > } > return 0; >@@ -1833,7 +1833,7 @@ > struct dev_layer *dl; > > if (!_build_all_layers(dm, vg)) { >- stack; >+ STACK; > return 0; > } > >@@ -1842,7 +1842,7 @@ > */ > _clear_marks(dm, RELOAD); > if (!_mark_lvs(dm, &dm->reload_list, RELOAD)) { >- stack; >+ STACK; > return 0; > } > >@@ -1851,7 +1851,7 @@ > */ > _clear_marks(dm, ACTIVE); > if (!_mark_lvs(dm, &dm->active_list, ACTIVE)) { >- stack; >+ STACK; > return 0; > } > >@@ -1860,17 +1860,17 @@ > */ > _clear_marks(dm, SUSPENDED); > if (!_mark_lvs(dm, &dm->suspend_list, SUSPENDED)) { >- stack; >+ STACK; > return 0; > } > > if (!_fill_in_remove_list(dm)) { >- stack; >+ STACK; > return 0; > } > > if (!_populate_pre_suspend_lists(dm)) { >- stack; >+ STACK; > return 0; > } > >@@ -1882,7 +1882,7 @@ > > if (_get_flag(dl, ACTIVE) && _get_flag(dl, TOPLEVEL)) > if (!_create_rec(dm, dl)) { >- stack; >+ STACK; > return 0; > } > } >@@ -1892,13 +1892,13 @@ > dl = hash_get_data(dm->layers, hn); > > if (!_resume_with_deps(dm, dl)) { >- stack; >+ STACK; > return 0; > } > } > > if (!_remove_old_layers(dm)) { >- stack; >+ STACK; > return 0; > } > >@@ -1934,12 +1934,12 @@ > log_debug("Found existing layer '%s'", name); > > if (!(copy = pool_strdup(dm->mem, name))) { >- stack; >+ STACK; > return 0; > } > > if (!(dl = _create_dev(dm, copy, ""))) { >- stack; >+ STACK; > return 0; > } > >@@ -1971,7 +1971,7 @@ > names = (void *) names + next; > if (_belong_to_vg(dm->vg_name, names->name) && > !_add_existing_layer(dm, names->name)) { >- stack; >+ STACK; > r = 0; > break; > } >@@ -1984,30 +1984,30 @@ > } > > static int _add_lv(struct pool *mem, >- struct list *head, struct logical_volume *lv) >+ struct lvm_list *head, struct logical_volume *lv) > { > struct lv_list *lvl; > > if (!(lvl = pool_alloc(mem, sizeof(*lvl)))) { >- stack; >+ STACK; > return 0; > } > > lvl->lv = lv; >- list_add(head, &lvl->list); >+ lvm_list_add(head, &lvl->list); > > return 1; > } > > static int _add_lvs(struct pool *mem, >- struct list *head, struct logical_volume *origin) >+ struct lvm_list *head, struct logical_volume *origin) > { > struct logical_volume *lv; > struct snapshot *s; >- struct list *lvh; >+ struct lvm_list *lvh; > >- list_iterate(lvh, &origin->vg->lvs) { >- lv = list_item(lvh, struct lv_list)->lv; >+ lvm_list_iterate(lvh, &origin->vg->lvs) { >+ lv = lvm_list_item(lvh, struct lv_list)->lv; > if ((s = find_cow(lv)) && s->origin == origin) > if (!_add_lv(mem, head, lv)) > return 0; >@@ -2016,15 +2016,15 @@ > return _add_lv(mem, head, origin); > } > >-static void _remove_lv(struct list *head, struct logical_volume *lv) >+static void _remove_lv(struct lvm_list *head, struct logical_volume *lv) > { >- struct list *lvh; >+ struct lvm_list *lvh; > struct lv_list *lvl; > >- list_iterate(lvh, head) { >- lvl = list_item(lvh, struct lv_list); >+ lvm_list_iterate(lvh, head) { >+ lvl = lvm_list_item(lvh, struct lv_list); > if (lvl->lv == lv) { >- list_del(lvh); >+ lvm_list_del(lvh); > break; > } > } >@@ -2034,13 +2034,13 @@ > { > struct logical_volume *active, *old_origin; > struct snapshot *s; >- struct list *sh, *active_head; >+ struct lvm_list *sh, *active_head; > > active_head = &dm->active_list; > > /* Remove any snapshots with given origin */ >- list_iterate(sh, active_head) { >- active = list_item(sh, struct lv_list)->lv; >+ lvm_list_iterate(sh, active_head) { >+ active = lvm_list_item(sh, struct lv_list)->lv; > if ((s = find_cow(active)) && s->origin == lv) { > _remove_lv(active_head, active); > } >@@ -2054,8 +2054,8 @@ > old_origin = s->origin; > > /* Was this the last active snapshot with this origin? */ >- list_iterate(sh, active_head) { >- active = list_item(sh, struct lv_list)->lv; >+ lvm_list_iterate(sh, active_head) { >+ active = lvm_list_item(sh, struct lv_list)->lv; > if ((s = find_cow(active)) && s->origin == old_origin) { > return 1; > } >@@ -2069,13 +2069,13 @@ > { > struct logical_volume *suspended; > struct snapshot *s; >- struct list *sh, *suspend_head; >+ struct lvm_list *sh, *suspend_head; > > suspend_head = &dm->suspend_list; > > /* Remove from list any snapshots with given origin */ >- list_iterate(sh, suspend_head) { >- suspended = list_item(sh, struct lv_list)->lv; >+ lvm_list_iterate(sh, suspend_head) { >+ suspended = lvm_list_item(sh, struct lv_list)->lv; > if ((s = find_cow(suspended)) && s->origin == lv) { > _remove_lv(suspend_head, suspended); > } >@@ -2089,15 +2089,15 @@ > static int _fill_in_active_list(struct dev_manager *dm, struct volume_group *vg) > { > char *dlid; >- struct list *lvh; >+ struct lvm_list *lvh; > struct logical_volume *lv; > struct dev_layer *dl; > >- list_iterate(lvh, &vg->lvs) { >- lv = list_item(lvh, struct lv_list)->lv; >+ lvm_list_iterate(lvh, &vg->lvs) { >+ lv = lvm_list_item(lvh, struct lv_list)->lv; > > if (!(dlid = _build_dlid(dm->mem, lv->lvid.s, NULL))) { >- stack; >+ STACK; > return 0; > } > >@@ -2109,13 +2109,13 @@ > dl->info.suspended ? " (suspended)" : ""); > > if (!_add_lv(dm->mem, &dm->active_list, lv)) { >- stack; >+ STACK; > return 0; > } > > if (dl->info.suspended) { > if (!_add_lv(dm->mem, &dm->suspend_list, lv)) { >- stack; >+ STACK; > return 0; > } > } >@@ -2129,19 +2129,19 @@ > action_t action) > { > if (!_scan_existing_devices(dm)) { >- stack; >+ STACK; > return 0; > } > > if (!_fill_in_active_list(dm, lv->vg)) { >- stack; >+ STACK; > return 0; > } > > if (action == ACTIVATE || action == DEACTIVATE) > /* Get into known state - remove from active list if present */ > if (!_remove_lvs(dm, lv)) { >- stack; >+ STACK; > return 0; > } > >@@ -2149,7 +2149,7 @@ > /* Add to active & reload lists */ > if (!_add_lvs(dm->mem, &dm->reload_list, lv) || > !_add_lvs(dm->mem, &dm->active_list, lv)) { >- stack; >+ STACK; > return 0; > } > } >@@ -2157,19 +2157,19 @@ > if (action == SUSPEND || action == RESUME || action == ACTIVATE) > /* Get into known state - remove from suspend list if present */ > if (!_remove_suspended_lvs(dm, lv)) { >- stack; >+ STACK; > return 0; > } > > if (action == SUSPEND) { > if (!_add_lvs(dm->mem, &dm->suspend_list, lv)) { >- stack; >+ STACK; > return 0; > } > } > > if (!_execute(dm, lv->vg)) { >- stack; >+ STACK; > return 0; > } > >@@ -2197,7 +2197,7 @@ > > if (!(name = _build_name(lv->vg->cmd->mem, lv->vg->name, > lv->name, NULL))) { >- stack; >+ STACK; > return 0; > } > >diff -ruN LVM2.2.00.15.orig/lib/activate/fs.c LVM2.2.00.15/lib/activate/fs.c >--- LVM2.2.00.15.orig/lib/activate/fs.c 2004-04-14 18:10:10.000000000 +0000 >+++ LVM2.2.00.15/lib/activate/fs.c 2004-07-03 19:27:18.413857072 +0000 >@@ -231,24 +231,24 @@ > case FS_ADD: > if (!_mk_dir(dev_dir, vg_name) || > !_mk_link(dev_dir, vg_name, lv_name, dev)) { >- stack; >+ STACK; > return 0; > } > break; > case FS_DEL: > if (!_rm_link(dev_dir, vg_name, lv_name) || > !_rm_dir(dev_dir, vg_name)) { >- stack; >+ STACK; > return 0; > } > break; > /* FIXME Use rename() */ > case FS_RENAME: > if (old_lv_name && !_rm_link(dev_dir, vg_name, old_lv_name)) >- stack; >+ STACK; > > if (!_mk_link(dev_dir, vg_name, lv_name, dev)) >- stack; >+ STACK; > } > > return 1; >@@ -257,7 +257,7 @@ > static LIST_INIT(_fs_ops); > > struct fs_op_parms { >- struct list list; >+ struct lvm_list list; > fs_op_t type; > char *dev_dir; > char *vg_name; >@@ -297,21 +297,21 @@ > _store_str(&pos, &fsp->dev, dev); > _store_str(&pos, &fsp->old_lv_name, old_lv_name); > >- list_add(&_fs_ops, &fsp->list); >+ lvm_list_add(&_fs_ops, &fsp->list); > > return 1; > } > > static void _pop_fs_ops(void) > { >- struct list *fsph, *fspht; >+ struct lvm_list *fsph, *fspht; > struct fs_op_parms *fsp; > >- list_iterate_safe(fsph, fspht, &_fs_ops) { >- fsp = list_item(fsph, struct fs_op_parms); >+ lvm_list_iterate_safe(fsph, fspht, &_fs_ops) { >+ fsp = lvm_list_item(fsph, struct fs_op_parms); > _do_fs_op(fsp->type, fsp->dev_dir, fsp->vg_name, fsp->lv_name, > fsp->dev, fsp->old_lv_name); >- list_del(&fsp->list); >+ lvm_list_del(&fsp->list); > dbg_free(fsp); > } > } >@@ -322,7 +322,7 @@ > if (memlock()) { > if (!_stack_fs_op(type, dev_dir, vg_name, lv_name, dev, > old_lv_name)) { >- stack; >+ STACK; > return 0; > } > return 1; >diff -ruN LVM2.2.00.15.orig/lib/cache/lvmcache.c LVM2.2.00.15/lib/cache/lvmcache.c >--- LVM2.2.00.15.orig/lib/cache/lvmcache.c 2004-03-30 19:35:37.000000000 +0000 >+++ LVM2.2.00.15/lib/cache/lvmcache.c 2004-07-03 19:29:12.267548680 +0000 >@@ -28,13 +28,13 @@ > static struct hash_table *_vgid_hash = NULL; > static struct hash_table *_vgname_hash = NULL; > static struct hash_table *_lock_hash = NULL; >-static struct list _vginfos; >+static struct lvm_list _vginfos; > static int _has_scanned = 0; > static int _vgs_locked = 0; > > int lvmcache_init(void) > { >- list_init(&_vginfos); >+ lvm_list_init(&_vginfos); > > if (!(_vgname_hash = hash_create(128))) > return 0; >@@ -166,7 +166,7 @@ > struct label *label; > struct dev_iter *iter; > struct device *dev; >- struct list *fmth; >+ struct lvm_list *fmth; > struct format_type *fmt; > > static int _scanning_in_progress = 0; >@@ -201,8 +201,8 @@ > _has_scanned = 1; > > /* Perform any format-specific scanning e.g. text files */ >- list_iterate(fmth, &cmd->formats) { >- fmt = list_item(fmth, struct format_type); >+ lvm_list_iterate(fmth, &cmd->formats) { >+ fmt = lvm_list_item(fmth, struct format_type); > if (fmt->ops->scan && !fmt->ops->scan(fmt)) > goto out; > } >@@ -215,9 +215,9 @@ > return r; > } > >-struct list *lvmcache_get_vgnames(struct cmd_context *cmd, int full_scan) >+struct lvm_list *lvmcache_get_vgnames(struct cmd_context *cmd, int full_scan) > { >- struct list *vgnames; >+ struct lvm_list *vgnames; > struct lvmcache_vginfo *vgi; > > lvmcache_label_scan(cmd, full_scan); >@@ -227,7 +227,7 @@ > return NULL; > } > >- list_iterate_items(vgi, &_vginfos) { >+ lvm_list_iterate_items(vgi, &_vginfos) { > if (!str_list_add(cmd->mem, vgnames, > pool_strdup(cmd->mem, vgi->vgname))) { > log_error("strlist allocation failed"); >@@ -282,18 +282,18 @@ > > static void _drop_vginfo(struct lvmcache_info *info) > { >- if (!list_empty(&info->list)) { >- list_del(&info->list); >- list_init(&info->list); >+ if (!lvm_list_empty(&info->list)) { >+ lvm_list_del(&info->list); >+ lvm_list_init(&info->list); > } > >- if (info->vginfo && list_empty(&info->vginfo->infos)) { >+ if (info->vginfo && lvm_list_empty(&info->vginfo->infos)) { > hash_remove(_vgname_hash, info->vginfo->vgname); > if (info->vginfo->vgname) > dbg_free(info->vginfo->vgname); > if (*info->vginfo->vgid) > hash_remove(_vgid_hash, info->vginfo->vgid); >- list_del(&info->vginfo->list); >+ lvm_list_del(&info->vginfo->list); > dbg_free(info->vginfo); > } > >@@ -382,7 +382,7 @@ > log_error("cache vgname alloc failed for %s", vgname); > return 0; > } >- list_init(&vginfo->infos); >+ lvm_list_init(&vginfo->infos); > if (!hash_insert(_vgname_hash, vginfo->vgname, vginfo)) { > log_error("cache_update: vg hash insertion failed: %s", > vginfo->vgname); >@@ -392,13 +392,13 @@ > } > /* Ensure orphans appear last on list_iterate */ > if (!*vgname) >- list_add(&_vginfos, &vginfo->list); >+ lvm_list_add(&_vginfos, &vginfo->list); > else >- list_add_h(&_vginfos, &vginfo->list); >+ lvm_list_add_h(&_vginfos, &vginfo->list); > } > > info->vginfo = vginfo; >- list_add(&vginfo->infos, &info->list); >+ lvm_list_add(&vginfo->infos, &info->list); > > /* FIXME Check consistency of list! */ > vginfo->fmt = info->fmt; >@@ -408,7 +408,7 @@ > > int lvmcache_update_vg(struct volume_group *vg) > { >- struct list *pvh; >+ struct lvm_list *pvh; > struct physical_volume *pv; > struct lvmcache_info *info; > char pvid_s[ID_LEN + 1]; >@@ -416,8 +416,8 @@ > > pvid_s[sizeof(pvid_s) - 1] = '\0'; > >- list_iterate(pvh, &vg->pvs) { >- pv = list_item(pvh, struct pv_list)->pv; >+ lvm_list_iterate(pvh, &vg->pvs) { >+ pv = lvm_list_item(pvh, struct pv_list)->pv; > strncpy(pvid_s, (char *) &pv->id, sizeof(pvid_s) - 1); > /* FIXME Could pv->dev->pvid ever be different? */ > if ((info = info_from_pvid(pvid_s))) { >@@ -451,7 +451,7 @@ > if (!(existing = info_from_pvid(pvid_s)) && > !(existing = info_from_pvid(dev->pvid))) { > if (!(label = label_create(labeller))) { >- stack; >+ STACK; > return NULL; > } > if (!(info = dbg_malloc(sizeof(*info)))) { >@@ -463,7 +463,7 @@ > > label->info = info; > info->label = label; >- list_init(&info->list); >+ lvm_list_init(&info->list); > info->dev = dev; > } else { > if (existing->dev != dev) { >@@ -492,7 +492,7 @@ > label_destroy(info->label); > if (!(info->label = label_create(labeller))) { > /* FIXME leaves info without label! */ >- stack; >+ STACK; > return NULL; > } > info->label->info = info; >@@ -523,15 +523,15 @@ > > if (!_lvmcache_update_vgid(info, vgid)) > /* Non-critical */ >- stack; >+ STACK; > > return info; > } > > static void _lvmcache_destroy_entry(struct lvmcache_info *info) > { >- if (!list_empty(&info->list)) >- list_del(&info->list); >+ if (!lvm_list_empty(&info->list)) >+ lvm_list_del(&info->list); > strcpy(info->dev->pvid, ""); > label_destroy(info->label); > dbg_free(info); >@@ -577,5 +577,5 @@ > _lock_hash = NULL; > } > >- list_init(&_vginfos); >+ lvm_list_init(&_vginfos); > } >diff -ruN LVM2.2.00.15.orig/lib/cache/lvmcache.h LVM2.2.00.15/lib/cache/lvmcache.h >--- LVM2.2.00.15.orig/lib/cache/lvmcache.h 2004-03-30 19:35:37.000000000 +0000 >+++ LVM2.2.00.15/lib/cache/lvmcache.h 2004-07-03 20:57:06.040813280 +0000 >@@ -31,17 +31,17 @@ > /* Eventual replacement for struct physical_volume perhaps? */ > > struct lvmcache_vginfo { >- struct list list; /* Join these vginfos together */ >- struct list infos; /* List head for lvmcache_infos */ >+ struct lvm_list list; /* Join these vginfos together */ >+ struct lvm_list infos; /* List head for lvmcache_infos */ > char *vgname; /* "" == orphan */ > char vgid[ID_LEN + 1]; > const struct format_type *fmt; > }; > > struct lvmcache_info { >- struct list list; /* Join VG members together */ >- struct list mdas; /* list head for metadata areas */ >- struct list das; /* list head for data areas */ >+ struct lvm_list list; /* Join VG members together */ >+ struct lvm_list mdas; /* list head for metadata areas */ >+ struct lvm_list das; /* list head for data areas */ > struct lvmcache_vginfo *vginfo; /* NULL == unknown */ > struct label *label; > const struct format_type *fmt; >@@ -79,6 +79,6 @@ > > /* Returns list of struct str_lists containing pool-allocated copy of vgnames */ > /* Set full_scan to 1 to reread every filtered device label */ >-struct list *lvmcache_get_vgnames(struct cmd_context *cmd, int full_scan); >+struct lvm_list *lvmcache_get_vgnames(struct cmd_context *cmd, int full_scan); > > #endif >diff -ruN LVM2.2.00.15.orig/lib/commands/toolcontext.c LVM2.2.00.15/lib/commands/toolcontext.c >--- LVM2.2.00.15.orig/lib/commands/toolcontext.c 2004-04-16 16:11:34.000000000 +0000 >+++ LVM2.2.00.15/lib/commands/toolcontext.c 2004-07-03 19:32:19.314113280 +0000 >@@ -205,7 +205,7 @@ > char config_file[PATH_MAX] = ""; > > if (!(cmd->cft = create_config_tree())) { >- stack; >+ STACK; > return 0; > } > >@@ -244,7 +244,7 @@ > struct config_value *cv; > > if (!dev_cache_init()) { >- stack; >+ STACK; > return 0; > } > >@@ -381,7 +381,7 @@ > const char *format; > > struct format_type *fmt; >- struct list *fmth; >+ struct lvm_list *fmth; > > #ifdef HAVE_LIBDL > struct config_node *cn; >@@ -393,7 +393,7 @@ > if (!(fmt = init_lvm1_format(cmd))) > return 0; > fmt->library = NULL; >- list_add(&cmd->formats, &fmt->list); >+ lvm_list_add(&cmd->formats, &fmt->list); > #endif > > #ifdef HAVE_LIBDL >@@ -412,7 +412,7 @@ > } > if (!(lib = load_shared_library(cmd->cft, cv->v.str, > "format"))) { >- stack; >+ STACK; > return 0; > } > >@@ -426,7 +426,7 @@ > if (!(fmt = init_format_fn(cmd))) > return 0; > fmt->library = lib; >- list_add(&cmd->formats, &fmt->list); >+ lvm_list_add(&cmd->formats, &fmt->list); > } > } > #endif >@@ -434,15 +434,15 @@ > if (!(fmt = create_text_format(cmd))) > return 0; > fmt->library = NULL; >- list_add(&cmd->formats, &fmt->list); >+ lvm_list_add(&cmd->formats, &fmt->list); > > cmd->fmt_backup = fmt; > > format = find_config_str(cmd->cft->root, "global/format", > DEFAULT_FORMAT); > >- list_iterate(fmth, &cmd->formats) { >- fmt = list_item(fmth, struct format_type); >+ lvm_list_iterate(fmth, &cmd->formats) { >+ fmt = lvm_list_item(fmth, struct format_type); > if (!strcasecmp(fmt->name, format) || > (fmt->alias && !strcasecmp(fmt->alias, format))) { > cmd->default_settings.fmt = fmt; >@@ -530,7 +530,7 @@ > const char *tag; > int passes; > >- list_init(&cmd->tags); >+ lvm_list_init(&cmd->tags); > > if (!(tn = find_config_node(cmd->cft->root, "tags")) || > !tn->child) { >@@ -542,7 +542,7 @@ > DEFAULT_HOSTTAGS)) { > /* FIXME Strip out invalid chars: only A-Za-z0-9_+.- */ > if (!_set_tag(cmd, cmd->hostname)) { >- stack; >+ STACK; > return 0; > } > } >@@ -560,14 +560,14 @@ > if (cn->child) { > passes = 0; > if (!_check_host_filters(cmd, cn->child, &passes)) { >- stack; >+ STACK; > return 0; > } > if (!passes) > continue; > } > if (!_set_tag(cmd, tag)) { >- stack; >+ STACK; > return 0; > } > } >@@ -599,7 +599,7 @@ > } > memset(cmd, 0, sizeof(*cmd)); > cmd->args = the_args; >- list_init(&cmd->formats); >+ lvm_list_init(&cmd->formats); > > strcpy(cmd->sys_dir, DEFAULT_SYS_DIR); > >@@ -664,15 +664,15 @@ > return 1; > } > >-static void _destroy_formats(struct list *formats) >+static void _destroy_formats(struct lvm_list *formats) > { >- struct list *fmtl, *tmp; >+ struct lvm_list *fmtl, *tmp; > struct format_type *fmt; > void *lib; > >- list_iterate_safe(fmtl, tmp, formats) { >- fmt = list_item(fmtl, struct format_type); >- list_del(&fmt->list); >+ lvm_list_iterate_safe(fmtl, tmp, formats) { >+ fmt = lvm_list_item(fmtl, struct format_type); >+ lvm_list_del(&fmt->list); > lib = fmt->library; > fmt->ops->destroy(fmt); > #ifdef HAVE_LIBDL >diff -ruN LVM2.2.00.15.orig/lib/commands/toolcontext.h LVM2.2.00.15/lib/commands/toolcontext.h >--- LVM2.2.00.15.orig/lib/commands/toolcontext.h 2004-04-08 15:23:23.000000000 +0000 >+++ LVM2.2.00.15/lib/commands/toolcontext.h 2004-07-03 19:31:40.481016808 +0000 >@@ -56,7 +56,7 @@ > const struct format_type *fmt; /* Current format to use by default */ > struct format_type *fmt_backup; /* Format to use for backups */ > >- struct list formats; /* Available formats */ >+ struct lvm_list formats; /* Available formats */ > const char *hostname; > const char *kernel_vsn; > >@@ -73,7 +73,7 @@ > struct config_info current_settings; > > /* List of defined tags */ >- struct list tags; >+ struct lvm_list tags; > > char sys_dir[PATH_MAX]; > char dev_dir[PATH_MAX]; >diff -ruN LVM2.2.00.15.orig/lib/config/config.c LVM2.2.00.15/lib/config/config.c >--- LVM2.2.00.15.orig/lib/config/config.c 2004-03-30 19:35:37.000000000 +0000 >+++ LVM2.2.00.15/lib/config/config.c 2004-07-03 18:31:44.339713384 +0000 >@@ -99,12 +99,12 @@ > struct pool *mem = pool_create(10 * 1024); > > if (!mem) { >- stack; >+ STACK; > return 0; > } > > if (!(c = pool_alloc(mem, sizeof(*c)))) { >- stack; >+ STACK; > pool_destroy(mem); > return 0; > } >@@ -132,7 +132,7 @@ > off_t mmap_offset = 0; > > if (!(p = pool_alloc(c->mem, sizeof(*p)))) { >- stack; >+ STACK; > return 0; > } > p->mem = c->mem; >@@ -153,7 +153,7 @@ > p->fb = p->fb + mmap_offset; > } else { > if (!(p->fb = dbg_malloc(size + size2))) { >- stack; >+ STACK; > return 0; > } > if (!dev_read(dev, (uint64_t) offset, size, p->fb)) { >@@ -184,7 +184,7 @@ > p->line = 1; > _get_token(p, TOK_SECTION_E); > if (!(cft->root = _file(p))) { >- stack; >+ STACK; > goto out; > } > >@@ -227,12 +227,12 @@ > } > > if (!(dev = dev_create_file(file, NULL, NULL))) { >- stack; >+ STACK; > return 0; > } > > if (!dev_open_flags(dev, O_RDONLY, 0, 0)) { >- stack; >+ STACK; > return 0; > } > >@@ -300,12 +300,12 @@ > } > > if (!(dev = dev_create_file(c->filename, NULL, NULL))) { >- stack; >+ STACK; > return 0; > } > > if (!dev_open_flags(dev, O_RDONLY, 0, 0)) { >- stack; >+ STACK; > return 0; > } > >@@ -426,7 +426,7 @@ > struct config_node *root = NULL, *n, *l = NULL; > while (p->t != TOK_EOF) { > if (!(n = _section(p))) { >- stack; >+ STACK; > return 0; > } > >@@ -444,12 +444,12 @@ > /* IDENTIFIER '{' VALUE* '}' */ > struct config_node *root, *n, *l = NULL; > if (!(root = _create_node(p))) { >- stack; >+ STACK; > return 0; > } > > if (!(root->key = _dup_tok(p))) { >- stack; >+ STACK; > return 0; > } > >@@ -459,7 +459,7 @@ > match(TOK_SECTION_B); > while (p->t != TOK_SECTION_E) { > if (!(n = _section(p))) { >- stack; >+ STACK; > return 0; > } > >@@ -473,7 +473,7 @@ > } else { > match(TOK_EQ); > if (!(root->v = _value(p))) { >- stack; >+ STACK; > return 0; > } > } >@@ -489,7 +489,7 @@ > match(TOK_ARRAY_B); > while (p->t != TOK_ARRAY_E) { > if (!(l = _type(p))) { >- stack; >+ STACK; > return 0; > } > >@@ -545,7 +545,7 @@ > > p->tb++, p->te--; /* strip "'s */ > if (!(v->v.str = _dup_tok(p))) { >- stack; >+ STACK; > return 0; > } > p->te++; >@@ -728,7 +728,7 @@ > size_t len = p->te - p->tb; > char *str = pool_alloc(p->mem, len + 1); > if (!str) { >- stack; >+ STACK; > return 0; > } > strncpy(str, p->tb, len); >diff -ruN LVM2.2.00.15.orig/lib/datastruct/btree.c LVM2.2.00.15/lib/datastruct/btree.c >--- LVM2.2.00.15.orig/lib/datastruct/btree.c 2004-03-30 19:35:38.000000000 +0000 >+++ LVM2.2.00.15/lib/datastruct/btree.c 2004-07-03 18:31:45.194583424 +0000 >@@ -87,7 +87,7 @@ > > if (!*c) { > if (!(n = pool_alloc(t->mem, sizeof(*n)))) { >- stack; >+ STACK; > return 0; > } > >diff -ruN LVM2.2.00.15.orig/lib/datastruct/hash.c LVM2.2.00.15/lib/datastruct/hash.c >--- LVM2.2.00.15.orig/lib/datastruct/hash.c 2004-03-30 19:35:38.000000000 +0000 >+++ LVM2.2.00.15/lib/datastruct/hash.c 2004-07-03 18:31:46.541378680 +0000 >@@ -90,7 +90,7 @@ > struct hash_table *hc = dbg_malloc(sizeof(*hc)); > > if (!hc) { >- stack; >+ STACK; > return 0; > } > >@@ -103,7 +103,7 @@ > hc->num_slots = new_size; > len = sizeof(*(hc->slots)) * new_size; > if (!(hc->slots = dbg_malloc(len))) { >- stack; >+ STACK; > goto bad; > } > memset(hc->slots, 0, len); >diff -ruN LVM2.2.00.15.orig/lib/datastruct/list.h LVM2.2.00.15/lib/datastruct/list.h >--- LVM2.2.00.15.orig/lib/datastruct/list.h 2004-03-30 19:35:38.000000000 +0000 >+++ LVM2.2.00.15/lib/datastruct/list.h 2004-07-03 19:18:40.334617088 +0000 >@@ -18,18 +18,18 @@ > > #include <assert.h> > >-struct list { >- struct list *n, *p; >+struct lvm_list { >+ struct lvm_list *n, *p; > }; > >-#define LIST_INIT(name) struct list name = { &(name), &(name) } >+#define LIST_INIT(name) struct lvm_list name = { &(name), &(name) } > >-static inline void list_init(struct list *head) >+static inline void lvm_list_init(struct lvm_list *head) > { > head->n = head->p = head; > } > >-static inline void list_add(struct list *head, struct list *elem) >+static inline void lvm_list_add(struct lvm_list *head, struct lvm_list *elem) > { > assert(head->n); > >@@ -40,7 +40,7 @@ > head->p = elem; > } > >-static inline void list_add_h(struct list *head, struct list *elem) >+static inline void lvm_list_add_h(struct lvm_list *head, struct lvm_list *elem) > { > assert(head->n); > >@@ -51,59 +51,59 @@ > head->n = elem; > } > >-static inline void list_del(struct list *elem) >+static inline void lvm_list_del(struct lvm_list *elem) > { > elem->n->p = elem->p; > elem->p->n = elem->n; > } > >-static inline int list_empty(struct list *head) >+static inline int lvm_list_empty(struct lvm_list *head) > { > return head->n == head; > } > >-static inline int list_end(struct list *head, struct list *elem) >+static inline int lvm_list_end(struct lvm_list *head, struct lvm_list *elem) > { > return elem->n == head; > } > >-static inline struct list *list_next(struct list *head, struct list *elem) >+static inline struct lvm_list *lvm_list_next(struct lvm_list *head, struct lvm_list *elem) > { >- return (list_end(head, elem) ? NULL : elem->n); >+ return (lvm_list_end(head, elem) ? NULL : elem->n); > } > >-#define list_item(v, t) \ >+#define lvm_list_item(v, t) \ > ((t *)((uintptr_t)(v) - (uintptr_t)&((t *) 0)->list)) > >-#define list_struct_base(v, t, h) \ >+#define lvm_list_struct_base(v, t, h) \ > ((t *)((uintptr_t)(v) - (uintptr_t)&((t *) 0)->h)) > > /* Given a known element in a known structure, locate another */ > #define struct_field(v, t, e, f) \ > (((t *)((uintptr_t)(v) - (uintptr_t)&((t *) 0)->e))->f) > >-/* Given a known element in a known structure, locate the list head */ >-#define list_head(v, t, e) struct_field(v, t, e, list) >+/* Given a known element in a known structure, locate the lvm_list head */ >+#define lvm_list_head(v, t, e) struct_field(v, t, e, lvm_list) > >-#define list_iterate(v, head) \ >+#define lvm_list_iterate(v, head) \ > for (v = (head)->n; v != head; v = v->n) > >-#define list_uniterate(v, head, start) \ >+#define lvm_list_uniterate(v, head, start) \ > for (v = (start)->p; v != head; v = v->p) > >-#define list_iterate_safe(v, t, head) \ >+#define lvm_list_iterate_safe(v, t, head) \ > for (v = (head)->n, t = v->n; v != head; v = t, t = v->n) > >-#define list_iterate_items(v, head) \ >- for (v = list_item((head)->n, typeof(*v)); &v->list != (head); \ >- v = list_item(v->list.n, typeof(*v))) >+#define lvm_list_iterate_items(v, head) \ >+ for (v = lvm_list_item((head)->n, typeof(*v)); &v->list != (head); \ >+ v = lvm_list_item(v->list.n, typeof(*v))) > >-static inline unsigned int list_size(const struct list *head) >+static inline unsigned int lvm_list_size(const struct lvm_list *head) > { > unsigned int s = 0; >- const struct list *v; >+ const struct lvm_list *v; > >- list_iterate(v, head) >+ lvm_list_iterate(v, head) > s++; > > return s; >diff -ruN LVM2.2.00.15.orig/lib/datastruct/lvm-types.h LVM2.2.00.15/lib/datastruct/lvm-types.h >--- LVM2.2.00.15.orig/lib/datastruct/lvm-types.h 2004-03-30 19:35:38.000000000 +0000 >+++ LVM2.2.00.15/lib/datastruct/lvm-types.h 2004-07-03 19:33:01.979627136 +0000 >@@ -25,7 +25,7 @@ > #define PRIsize_t "Zu" > > struct str_list { >- struct list list; >+ struct lvm_list list; > const char *str; > }; > >diff -ruN LVM2.2.00.15.orig/lib/datastruct/str_list.c LVM2.2.00.15/lib/datastruct/str_list.c >--- LVM2.2.00.15.orig/lib/datastruct/str_list.c 2004-03-30 19:35:38.000000000 +0000 >+++ LVM2.2.00.15/lib/datastruct/str_list.c 2004-07-03 19:35:09.936174784 +0000 >@@ -16,26 +16,26 @@ > #include "lib.h" > #include "str_list.h" > >-struct list *str_list_create(struct pool *mem) >+struct lvm_list *str_list_create(struct pool *mem) > { >- struct list *sl; >+ struct lvm_list *sl; > >- if (!(sl = pool_alloc(mem, sizeof(struct list)))) { >- stack; >+ if (!(sl = pool_alloc(mem, sizeof(struct lvm_list)))) { >+ STACK; > return NULL; > } > >- list_init(sl); >+ lvm_list_init(sl); > > return sl; > } > >-int str_list_add(struct pool *mem, struct list *sll, const char *str) >+int str_list_add(struct pool *mem, struct lvm_list *sll, const char *str) > { > struct str_list *sln; > > if (!str) { >- stack; >+ STACK; > return 0; > } > >@@ -44,37 +44,37 @@ > return 1; > > if (!(sln = pool_alloc(mem, sizeof(*sln)))) { >- stack; >+ STACK; > return 0; > } > > sln->str = str; >- list_add(sll, &sln->list); >+ lvm_list_add(sll, &sln->list); > > return 1; > } > >-int str_list_del(struct list *sll, const char *str) >+int str_list_del(struct lvm_list *sll, const char *str) > { >- struct list *slh, *slht; >+ struct lvm_list *slh, *slht; > >- list_iterate_safe(slh, slht, sll) { >- if (!strcmp(str, list_item(slh, struct str_list)->str)) >- list_del(slh); >+ lvm_list_iterate_safe(slh, slht, sll) { >+ if (!strcmp(str, lvm_list_item(slh, struct str_list)->str)) >+ lvm_list_del(slh); > } > > return 1; > } > >-int str_list_dup(struct pool *mem, struct list *sllnew, struct list *sllold) >+int str_list_dup(struct pool *mem, struct lvm_list *sllnew, struct lvm_list *sllold) > { > struct str_list *sl; > >- list_init(sllnew); >+ lvm_list_init(sllnew); > >- list_iterate_items(sl, sllold) { >+ lvm_list_iterate_items(sl, sllold) { > if (!str_list_add(mem, sllnew, strdup(sl->str))) { >- stack; >+ STACK; > return 0; > } > } >@@ -85,11 +85,11 @@ > /* > * Is item on list? > */ >-int str_list_match_item(struct list *sll, const char *str) >+int str_list_match_item(struct lvm_list *sll, const char *str) > { > struct str_list *sl; > >- list_iterate_items(sl, sll) >+ lvm_list_iterate_items(sl, sll) > if (!strcmp(str, sl->str)) > return 1; > >@@ -99,11 +99,11 @@ > /* > * Is at least one item on both lists? > */ >-int str_list_match_list(struct list *sll, struct list *sll2) >+int str_list_match_list(struct lvm_list *sll, struct lvm_list *sll2) > { > struct str_list *sl; > >- list_iterate_items(sl, sll) >+ lvm_list_iterate_items(sl, sll) > if (str_list_match_item(sll2, sl->str)) > return 1; > >@@ -113,14 +113,14 @@ > /* > * Do both lists contain the same set of items? > */ >-int str_list_lists_equal(struct list *sll, struct list *sll2) >+int str_list_lists_equal(struct lvm_list *sll, struct lvm_list *sll2) > { > struct str_list *sl; > >- if (list_size(sll) != list_size(sll2)) >+ if (lvm_list_size(sll) != lvm_list_size(sll2)) > return 0; > >- list_iterate_items(sl, sll) >+ lvm_list_iterate_items(sl, sll) > if (!str_list_match_item(sll2, sl->str)) > return 0; > >diff -ruN LVM2.2.00.15.orig/lib/datastruct/str_list.h LVM2.2.00.15/lib/datastruct/str_list.h >--- LVM2.2.00.15.orig/lib/datastruct/str_list.h 2004-03-30 19:35:38.000000000 +0000 >+++ LVM2.2.00.15/lib/datastruct/str_list.h 2004-07-03 19:33:46.066924848 +0000 >@@ -18,12 +18,12 @@ > > #include "pool.h" > >-struct list *str_list_create(struct pool *mem); >-int str_list_add(struct pool *mem, struct list *sll, const char *str); >-int str_list_del(struct list *sll, const char *str); >-int str_list_match_item(struct list *sll, const char *str); >-int str_list_match_list(struct list *sll, struct list *sll2); >-int str_list_lists_equal(struct list *sll, struct list *sll2); >-int str_list_dup(struct pool *mem, struct list *sllnew, struct list *sllold); >+struct lvm_list *str_list_create(struct pool *mem); >+int str_list_add(struct pool *mem, struct lvm_list *sll, const char *str); >+int str_list_del(struct lvm_list *sll, const char *str); >+int str_list_match_item(struct lvm_list *sll, const char *str); >+int str_list_match_list(struct lvm_list *sll, struct lvm_list *sll2); >+int str_list_lists_equal(struct lvm_list *sll, struct lvm_list *sll2); >+int str_list_dup(struct pool *mem, struct lvm_list *sllnew, struct lvm_list *sllold); > > #endif >diff -ruN LVM2.2.00.15.orig/lib/device/dev-cache.c LVM2.2.00.15/lib/device/dev-cache.c >--- LVM2.2.00.15.orig/lib/device/dev-cache.c 2004-03-30 19:35:38.000000000 +0000 >+++ LVM2.2.00.15/lib/device/dev-cache.c 2004-07-03 19:38:35.100984992 +0000 >@@ -32,7 +32,7 @@ > }; > > struct dir_list { >- struct list list; >+ struct lvm_list list; > char dir[0]; > }; > >@@ -42,7 +42,7 @@ > struct btree *devices; > > int has_scanned; >- struct list dirs; >+ struct lvm_list dirs; > > } _cache; > >@@ -76,14 +76,14 @@ > dev->flags = DEV_REGULAR; > if (allocate) > dev->flags |= DEV_ALLOCED; >- list_init(&dev->aliases); >- list_add(&dev->aliases, &alias->list); >+ lvm_list_init(&dev->aliases); >+ lvm_list_add(&dev->aliases, &alias->list); > dev->end = UINT64_C(0); > dev->dev = 0; > dev->fd = -1; > dev->open_count = 0; > memset(dev->pvid, 0, sizeof(dev->pvid)); >- list_init(&dev->open_list); >+ lvm_list_init(&dev->open_list); > > return dev; > } >@@ -97,13 +97,13 @@ > return NULL; > } > dev->flags = 0; >- list_init(&dev->aliases); >+ lvm_list_init(&dev->aliases); > dev->dev = d; > dev->fd = -1; > dev->open_count = 0; > dev->end = UINT64_C(0); > memset(dev->pvid, 0, sizeof(dev->pvid)); >- list_init(&dev->open_list); >+ lvm_list_init(&dev->open_list); > > return dev; > } >@@ -172,30 +172,30 @@ > static int _add_alias(struct device *dev, const char *path) > { > struct str_list *sl = _alloc(sizeof(*sl)); >- struct list *ah; >+ struct lvm_list *ah; > const char *oldpath; > int prefer_old = 1; > > if (!sl) { >- stack; >+ STACK; > return 0; > } > > /* Is name already there? */ >- list_iterate(ah, &dev->aliases) { >- if (!strcmp(list_item(ah, struct str_list)->str, path)) { >- stack; >+ lvm_list_iterate(ah, &dev->aliases) { >+ if (!strcmp(lvm_list_item(ah, struct str_list)->str, path)) { >+ STACK; > return 1; > } > } > > if (!(sl->str = pool_strdup(_cache.mem, path))) { >- stack; >+ STACK; > return 0; > } > >- if (!list_empty(&dev->aliases)) { >- oldpath = list_item(dev->aliases.n, struct str_list)->str; >+ if (!lvm_list_empty(&dev->aliases)) { >+ oldpath = lvm_list_item(dev->aliases.n, struct str_list)->str; > prefer_old = _compare_paths(path, oldpath); > log_debug("%s: Aliased to %s in device cache%s", > path, oldpath, prefer_old ? "" : " (preferred name)"); >@@ -204,9 +204,9 @@ > log_debug("%s: Added to device cache", path); > > if (prefer_old) >- list_add(&dev->aliases, &sl->list); >+ lvm_list_add(&dev->aliases, &sl->list); > else >- list_add_h(&dev->aliases, &sl->list); >+ lvm_list_add_h(&dev->aliases, &sl->list); > > return 1; > } >@@ -224,7 +224,7 @@ > (uint32_t) d))) { > /* create new device */ > if (!(dev = _dev_create(d))) { >- stack; >+ STACK; > return 0; > } > >@@ -295,7 +295,7 @@ > } > > if (!(path = _join(dir, dirent[n]->d_name))) { >- stack; >+ STACK; > return 0; > } > >@@ -343,7 +343,7 @@ > } > > if (!_insert_dev(path, info.st_rdev)) { >- stack; >+ STACK; > return 0; > } > >@@ -355,13 +355,13 @@ > > static void _full_scan(void) > { >- struct list *dh; >+ struct lvm_list *dh; > > if (_cache.has_scanned) > return; > >- list_iterate(dh, &_cache.dirs) { >- struct dir_list *dl = list_item(dh, struct dir_list); >+ lvm_list_iterate(dh, &_cache.dirs) { >+ struct dir_list *dl = lvm_list_item(dh, struct dir_list); > _insert_dir(dl->dir); > }; > >@@ -388,12 +388,12 @@ > _cache.names = NULL; > > if (!(_cache.mem = pool_create(10 * 1024))) { >- stack; >+ STACK; > return 0; > } > > if (!(_cache.names = hash_create(128))) { >- stack; >+ STACK; > pool_destroy(_cache.mem); > _cache.mem = 0; > return 0; >@@ -404,7 +404,7 @@ > goto bad; > } > >- list_init(&_cache.dirs); >+ lvm_list_init(&_cache.dirs); > > return 1; > >@@ -441,7 +441,7 @@ > > _cache.devices = NULL; > _cache.has_scanned = 0; >- list_init(&_cache.dirs); >+ lvm_list_init(&_cache.dirs); > } > > int dev_cache_add_dir(const char *path) >@@ -466,7 +466,7 @@ > } > > strcpy(dl->dir, path); >- list_add(&_cache.dirs, &dl->list); >+ lvm_list_add(&_cache.dirs, &dl->list); > return 1; > } > >@@ -480,7 +480,7 @@ > const char *name; > int r; > >- while ((r = stat(name = list_item(dev->aliases.n, >+ while ((r = stat(name = lvm_list_item(dev->aliases.n, > struct str_list)->str, &buf)) || > (buf.st_rdev != dev->dev)) { > if (r < 0) { >@@ -504,8 +504,8 @@ > /* Leave list alone if there isn't an alternative name */ > /* so dev_name will always find something to return. */ > /* Otherwise add the name to the correct device. */ >- if (list_size(&dev->aliases) > 1) { >- list_del(dev->aliases.n); >+ if (lvm_list_size(&dev->aliases) > 1) { >+ lvm_list_del(dev->aliases.n); > if (!r) > _insert(name, 0); > continue; >diff -ruN LVM2.2.00.15.orig/lib/device/dev-io.c LVM2.2.00.15/lib/device/dev-io.c >--- LVM2.2.00.15.orig/lib/device/dev-io.c 2004-04-16 18:43:29.000000000 +0000 >+++ LVM2.2.00.15/lib/device/dev-io.c 2004-07-03 19:39:30.543556440 +0000 >@@ -157,7 +157,7 @@ > > if (!(where->dev->flags & DEV_REGULAR) && > !_get_block_size(where->dev, &block_size)) { >- stack; >+ STACK; > return 0; > } > >@@ -187,7 +187,7 @@ > /* channel the io through the bounce buffer */ > if (!_io(&widened, bounce, 0)) { > if (!should_write) { >- stack; >+ STACK; > return 0; > } > /* FIXME pre-extend the file */ >@@ -285,7 +285,7 @@ > if (dev->flags & DEV_REGULAR) > name = dev_name(dev); > else if (!(name = dev_name_confirmed(dev, quiet))) { >- stack; >+ STACK; > return 0; > } > >@@ -325,7 +325,7 @@ > dev->end = lseek(dev->fd, (off_t) 0, SEEK_END); > } > >- list_add(&_open_devices, &dev->open_list); >+ lvm_list_add(&_open_devices, &dev->open_list); > log_debug("Opened %s", dev_name(dev)); > > return 1; >@@ -354,12 +354,12 @@ > if (close(dev->fd)) > log_sys_error("close", dev_name(dev)); > dev->fd = -1; >- list_del(&dev->open_list); >+ lvm_list_del(&dev->open_list); > > log_debug("Closed %s", dev_name(dev)); > > if (dev->flags & DEV_ALLOCED) { >- dbg_free((void *) list_item(dev->aliases.n, struct str_list)-> >+ dbg_free((void *) lvm_list_item(dev->aliases.n, struct str_list)-> > str); > dbg_free(dev->aliases.n); > dbg_free(dev); >@@ -398,11 +398,11 @@ > > void dev_close_all(void) > { >- struct list *doh, *doht; >+ struct lvm_list *doh, *doht; > struct device *dev; > >- list_iterate_safe(doh, doht, &_open_devices) { >- dev = list_struct_base(doh, struct device, open_list); >+ lvm_list_iterate_safe(doh, doht, &_open_devices) { >+ dev = lvm_list_struct_base(doh, struct device, open_list); > if (dev->open_count < 1) > _close(dev); > } >@@ -465,7 +465,7 @@ > char buffer[4096]; > > if (!dev_open(dev)) { >- stack; >+ STACK; > return 0; > } > >@@ -493,7 +493,7 @@ > dev->flags |= DEV_ACCESSED_W; > > if (!dev_close(dev)) >- stack; >+ STACK; > > /* FIXME: Always display error */ > return (len == 0); >diff -ruN LVM2.2.00.15.orig/lib/device/device.h LVM2.2.00.15/lib/device/device.h >--- LVM2.2.00.15.orig/lib/device/device.h 2004-03-30 19:35:38.000000000 +0000 >+++ LVM2.2.00.15/lib/device/device.h 2004-07-03 19:36:55.339151096 +0000 >@@ -28,7 +28,7 @@ > * pointer comparisons are valid. > */ > struct device { >- struct list aliases; /* struct str_list from lvm-types.h */ >+ struct lvm_list aliases; /* struct str_list from lvm-types.h */ > dev_t dev; > > /* private */ >@@ -36,13 +36,13 @@ > int open_count; > uint32_t flags; > uint64_t end; >- struct list open_list; >+ struct lvm_list open_list; > > char pvid[ID_LEN + 1]; > }; > > struct device_list { >- struct list list; >+ struct lvm_list list; > struct device *dev; > }; > >@@ -82,7 +82,7 @@ > > static inline const char *dev_name(const struct device *dev) > { >- return (dev) ? list_item(dev->aliases.n, struct str_list)->str : >+ return (dev) ? lvm_list_item(dev->aliases.n, struct str_list)->str : > "unknown device"; > } > >diff -ruN LVM2.2.00.15.orig/lib/display/display.c LVM2.2.00.15/lib/display/display.c >--- LVM2.2.00.15.orig/lib/display/display.c 2004-03-30 19:35:38.000000000 +0000 >+++ LVM2.2.00.15/lib/display/display.c 2004-07-03 19:40:12.972106320 +0000 >@@ -224,7 +224,7 @@ > return; > > if (!id_write_format(&pv->id, uuid, sizeof(uuid))) { >- stack; >+ STACK; > return; > } > >@@ -255,7 +255,7 @@ > return; > > if (!id_write_format(&pv->id, uuid, sizeof(uuid))) { >- stack; >+ STACK; > return; > } > >@@ -313,7 +313,7 @@ > return 0; > > if (!id_write_format(&pv->id, uuid, sizeof(uuid))) { >- stack; >+ STACK; > return 0; > } > >@@ -356,11 +356,11 @@ > int inkernel, snap_active; > char uuid[64]; > struct snapshot *snap = NULL; >- struct list *slh, *snaplist; >+ struct lvm_list *slh, *snaplist; > float snap_percent; /* fused, fsize; */ > > if (!id_write_format(&lv->lvid.id[1], uuid, sizeof(uuid))) { >- stack; >+ STACK; > return 0; > } > >@@ -381,8 +381,8 @@ > log_print("LV snapshot status source of"); > > snaplist = find_snapshots(lv); >- list_iterate(slh, snaplist) { >- snap = list_item(slh, struct snapshot_list)->snapshot; >+ lvm_list_iterate(slh, snaplist) { >+ snap = lvm_list_item(slh, struct snapshot_list)->snapshot; > snap_active = lv_snapshot_percent(snap->cow, > &snap_percent); > if (!snap_active || snap_percent < 0 || >@@ -429,7 +429,7 @@ > log_print("Allocated LE %u", lv->allocated_le); > **********/ > >- log_print("Segments %u", list_size(&lv->segments)); >+ log_print("Segments %u", lvm_list_size(&lv->segments)); > > /********* FIXME Stripes & stripesize for each segment > log_print("Stripe size (KByte) %u", lv->stripesize / 2); >@@ -507,13 +507,13 @@ > int lvdisplay_segments(struct logical_volume *lv) > { > uint32_t s; >- struct list *segh; >+ struct lvm_list *segh; > struct lv_segment *seg; > > log_print("--- Segments ---"); > >- list_iterate(segh, &lv->segments) { >- seg = list_item(segh, struct lv_segment); >+ lvm_list_iterate(segh, &lv->segments) { >+ seg = lvm_list_item(segh, struct lv_segment); > > log_print("Logical extent %u to %u:", > seg->le, seg->le + seg->len - 1); >@@ -570,7 +570,7 @@ > char uuid[64]; > > if (vg->status & PARTIAL_VG) >- active_pvs = list_size(&vg->pvs); >+ active_pvs = lvm_list_size(&vg->pvs); > else > active_pvs = vg->pv_count; > >@@ -580,7 +580,7 @@ > log_print("Format %s", vg->fid->fmt->name); > if (vg->fid->fmt->features & FMT_MDAS) { > log_print("Metadata Areas %d", >- list_size(&vg->fid->metadata_areas)); >+ lvm_list_size(&vg->fid->metadata_areas)); > log_print("Metadata Sequence No %d", vg->seqno); > } > access = vg->status & (LVM_READ | LVM_WRITE); >@@ -642,7 +642,7 @@ > 2), SIZE_SHORT)); > > if (!id_write_format(&vg->id, uuid, sizeof(uuid))) { >- stack; >+ STACK; > return; > } > >@@ -659,7 +659,7 @@ > char uuid[64]; > > if (vg->status & PARTIAL_VG) >- active_pvs = list_size(&vg->pvs); >+ active_pvs = lvm_list_size(&vg->pvs); > else > active_pvs = vg->pv_count; > >@@ -678,7 +678,7 @@ > } > > if (!id_write_format(&vg->id, uuid, sizeof(uuid))) { >- stack; >+ STACK; > return; > } > >diff -ruN LVM2.2.00.15.orig/lib/filters/filter-composite.c LVM2.2.00.15/lib/filters/filter-composite.c >--- LVM2.2.00.15.orig/lib/filters/filter-composite.c 2004-03-30 19:35:38.000000000 +0000 >+++ LVM2.2.00.15/lib/filters/filter-composite.c 2004-07-03 18:33:26.361203760 +0000 >@@ -51,7 +51,7 @@ > struct dev_filter **filters_copy, *cf; > > if (!filters) { >- stack; >+ STACK; > return NULL; > } > >diff -ruN LVM2.2.00.15.orig/lib/filters/filter-md.c LVM2.2.00.15/lib/filters/filter-md.c >--- LVM2.2.00.15.orig/lib/filters/filter-md.c 2004-04-16 16:12:04.000000000 +0000 >+++ LVM2.2.00.15/lib/filters/filter-md.c 2004-07-03 18:33:27.357052368 +0000 >@@ -32,7 +32,7 @@ > uint32_t md_magic; > > if (!dev_get_size(dev, &size)) { >- stack; >+ STACK; > return 0; > } > >@@ -44,7 +44,7 @@ > return 1; > > if (!dev_open(dev)) { >- stack; >+ STACK; > return 0; > } > >@@ -56,13 +56,13 @@ > log_debug("%s: Skipping md component device", > dev_name(dev)); > if (!dev_close(dev)) >- stack; >+ STACK; > return 0; > } > } > > if (!dev_close(dev)) >- stack; >+ STACK; > > return 1; > } >diff -ruN LVM2.2.00.15.orig/lib/filters/filter-persistent.c LVM2.2.00.15/lib/filters/filter-persistent.c >--- LVM2.2.00.15.orig/lib/filters/filter-persistent.c 2004-03-30 19:35:38.000000000 +0000 >+++ LVM2.2.00.15/lib/filters/filter-persistent.c 2004-07-03 19:42:30.195245232 +0000 >@@ -42,7 +42,7 @@ > hash_destroy(pf->devices); > > if (!(pf->devices = hash_create(128))) { >- stack; >+ STACK; > return 0; > } > >@@ -100,12 +100,12 @@ > struct config_tree *cft; > > if (!(cft = create_config_tree())) { >- stack; >+ STACK; > return 0; > } > > if (!read_config_file(cft, pf->file)) { >- stack; >+ STACK; > goto out; > } > >@@ -202,14 +202,14 @@ > struct pfilter *pf = (struct pfilter *) f->private; > void *l = hash_lookup(pf->devices, dev_name(dev)); > struct str_list *sl; >- struct list *ah; >+ struct lvm_list *ah; > > if (!l) { > l = pf->real->passes_filter(pf->real, dev) ? > PF_GOOD_DEVICE : PF_BAD_DEVICE; > >- list_iterate(ah, &dev->aliases) { >- sl = list_item(ah, struct str_list); >+ lvm_list_iterate(ah, &dev->aliases) { >+ sl = lvm_list_item(ah, struct str_list); > hash_insert(pf->devices, sl->str, l); > } > } >@@ -239,13 +239,13 @@ > struct dev_filter *f = NULL; > > if (!(pf = dbg_malloc(sizeof(*pf)))) { >- stack; >+ STACK; > return NULL; > } > memset(pf, 0, sizeof(*pf)); > > if (!(pf->file = dbg_malloc(strlen(file) + 1))) { >- stack; >+ STACK; > goto bad; > } > strcpy(pf->file, file); >@@ -257,7 +257,7 @@ > } > > if (!(f = dbg_malloc(sizeof(*f)))) { >- stack; >+ STACK; > goto bad; > } > >diff -ruN LVM2.2.00.15.orig/lib/filters/filter-regex.c LVM2.2.00.15/lib/filters/filter-regex.c >--- LVM2.2.00.15.orig/lib/filters/filter-regex.c 2004-03-30 19:35:38.000000000 +0000 >+++ LVM2.2.00.15/lib/filters/filter-regex.c 2004-07-03 19:42:56.237286240 +0000 >@@ -75,7 +75,7 @@ > * copy the regex > */ > if (!(r = pool_strdup(mem, pat))) { >- stack; >+ STACK; > return 0; > } > >@@ -102,7 +102,7 @@ > int i, r = 0; > > if (!(scratch = pool_create(1024))) { >- stack; >+ STACK; > return 0; > } > >@@ -123,7 +123,7 @@ > * allocate space for them > */ > if (!(regex = pool_alloc(scratch, sizeof(*regex) * count))) { >- stack; >+ STACK; > goto out; > } > >@@ -148,7 +148,7 @@ > */ > if (!(rf->engine = matcher_create(rf->mem, (const char **) regex, > count))) >- stack; >+ STACK; > r = 1; > > out: >@@ -158,13 +158,13 @@ > > static int _accept_p(struct dev_filter *f, struct device *dev) > { >- struct list *ah; >+ struct lvm_list *ah; > int m, first = 1, rejected = 0; > struct rfilter *rf = (struct rfilter *) f->private; > struct str_list *sl; > >- list_iterate(ah, &dev->aliases) { >- sl = list_item(ah, struct str_list); >+ lvm_list_iterate(ah, &dev->aliases) { >+ sl = lvm_list_item(ah, struct str_list); > m = matcher_run(rf->engine, sl->str); > > if (m >= 0) { >@@ -173,8 +173,8 @@ > if (!first) { > log_debug("%s: New preferred name", > sl->str); >- list_del(&sl->list); >- list_add_h(&dev->aliases, &sl->list); >+ lvm_list_del(&sl->list); >+ lvm_list_add_h(&dev->aliases, &sl->list); > } > > return 1; >@@ -206,24 +206,24 @@ > struct dev_filter *f; > > if (!mem) { >- stack; >+ STACK; > return NULL; > } > > if (!(rf = pool_alloc(mem, sizeof(*rf)))) { >- stack; >+ STACK; > goto bad; > } > > rf->mem = mem; > > if (!_build_matcher(rf, patterns)) { >- stack; >+ STACK; > goto bad; > } > > if (!(f = pool_zalloc(mem, sizeof(*f)))) { >- stack; >+ STACK; > goto bad; > } > >diff -ruN LVM2.2.00.15.orig/lib/filters/filter-sysfs.c LVM2.2.00.15/lib/filters/filter-sysfs.c >--- LVM2.2.00.15.orig/lib/filters/filter-sysfs.c 2004-04-06 16:47:59.000000000 +0000 >+++ LVM2.2.00.15/lib/filters/filter-sysfs.c 2004-07-03 18:40:21.560083936 +0000 >@@ -264,7 +264,7 @@ > } > > if (!(f = pool_zalloc(mem, sizeof(*f)))) { >- stack; >+ STACK; > goto bad; > } > >diff -ruN LVM2.2.00.15.orig/lib/filters/filter.c LVM2.2.00.15/lib/filters/filter.c >--- LVM2.2.00.15.orig/lib/filters/filter.c 2004-04-14 17:33:51.000000000 +0000 >+++ LVM2.2.00.15/lib/filters/filter.c 2004-07-03 18:33:30.144628592 +0000 >@@ -212,7 +212,7 @@ > f->destroy = lvm_type_filter_destroy; > > if (!(f->private = _scan_proc_dev(proc, cn))) { >- stack; >+ STACK; > return NULL; > } > >diff -ruN LVM2.2.00.15.orig/lib/format1/disk-rep.c LVM2.2.00.15/lib/format1/disk-rep.c >--- LVM2.2.00.15.orig/lib/format1/disk-rep.c 2004-03-30 19:35:39.000000000 +0000 >+++ LVM2.2.00.15/lib/format1/disk-rep.c 2004-07-03 19:46:36.599786048 +0000 >@@ -22,7 +22,7 @@ > > #include <fcntl.h> > >-#define fail do {stack; return 0;} while(0) >+#define fail do {STACK; return 0;} while(0) > #define xx16(v) disk->v = xlate16(disk->v) > #define xx32(v) disk->v = xlate32(disk->v) > #define xx64(v) disk->v = xlate64(disk->v) >@@ -210,7 +210,7 @@ > memcpy(ul->uuid, buffer, NAME_LEN); > ul->uuid[NAME_LEN - 1] = '\0'; > >- list_add(&data->uuids, &ul->list); >+ lvm_list_add(&data->uuids, &ul->list); > > pos += NAME_LEN; > num_read++; >@@ -245,7 +245,7 @@ > continue; > > read++; >- list_add(&data->lvds, &ll->list); >+ lvm_list_add(&data->lvds, &ll->list); > } > > return 1; >@@ -298,17 +298,17 @@ > struct lvmcache_info *info; > > if (!dl) { >- stack; >+ STACK; > return NULL; > } > > dl->dev = dev; > dl->mem = mem; >- list_init(&dl->uuids); >- list_init(&dl->lvds); >+ lvm_list_init(&dl->uuids); >+ lvm_list_init(&dl->lvds); > > if (!_read_pvd(dev, &dl->pvd)) { >- stack; >+ STACK; > goto bad; > } > >@@ -317,10 +317,10 @@ > > if (!(info = lvmcache_add(fmt->labeller, dl->pvd.pv_uuid, dev, > dl->pvd.vg_name, NULL))) >- stack; >+ STACK; > else { > info->device_size = xlate32(dl->pvd.pv_size) << SECTOR_SHIFT; >- list_init(&info->mdas); >+ lvm_list_init(&info->mdas); > info->status &= ~CACHE_INVALID; > } > >@@ -382,25 +382,25 @@ > struct disk_list *r; > > if (!dev_open(dev)) { >- stack; >+ STACK; > return NULL; > } > > r = __read_disk(fmt, dev, mem, vg_name); > > if (!dev_close(dev)) >- stack; >+ STACK; > > return r; > } > >-static void _add_pv_to_list(struct list *head, struct disk_list *data) >+static void _add_pv_to_list(struct lvm_list *head, struct disk_list *data) > { >- struct list *pvdh; >+ struct lvm_list *pvdh; > struct pv_disk *pvd; > >- list_iterate(pvdh, head) { >- pvd = &list_item(pvdh, struct disk_list)->pvd; >+ lvm_list_iterate(pvdh, head) { >+ pvd = &lvm_list_item(pvdh, struct disk_list)->pvd; > if (!strncmp(data->pvd.pv_uuid, pvd->pv_uuid, > sizeof(pvd->pv_uuid))) { > if (MAJOR(data->dev->dev) != md_major()) { >@@ -411,11 +411,11 @@ > } > log_very_verbose("Duplicate PV %s - using md %s", > pvd->pv_uuid, dev_name(data->dev)); >- list_del(pvdh); >+ lvm_list_del(pvdh); > break; > } > } >- list_add(head, &data->list); >+ lvm_list_add(head, &data->list); > } > > /* >@@ -425,19 +425,19 @@ > */ > int read_pvs_in_vg(const struct format_type *fmt, const char *vg_name, > struct dev_filter *filter, struct pool *mem, >- struct list *head) >+ struct lvm_list *head) > { > struct dev_iter *iter; > struct device *dev; > struct disk_list *data = NULL; >- struct list *vgih; >+ struct lvm_list *vgih; > struct lvmcache_vginfo *vginfo; > > /* Fast path if we already saw this VG and cached the list of PVs */ > if (vg_name && (vginfo = vginfo_from_vgname(vg_name)) && > vginfo->infos.n) { >- list_iterate(vgih, &vginfo->infos) { >- dev = list_item(vgih, struct lvmcache_info)->dev; >+ lvm_list_iterate(vgih, &vginfo->infos) { >+ dev = lvm_list_item(vgih, struct lvmcache_info)->dev; > if (dev && !(data = read_disk(fmt, dev, mem, vg_name))) > break; > _add_pv_to_list(head, data); >@@ -446,11 +446,11 @@ > /* Did we find the whole VG? */ > if (!vg_name || !*vg_name || > (data && *data->pvd.vg_name && >- list_size(head) == data->vgd.pv_cur)) >+ lvm_list_size(head) == data->vgd.pv_cur)) > return 1; > > /* Failed */ >- list_init(head); >+ lvm_list_init(head); > /* vgcache_del(vg_name); */ > } > >@@ -467,7 +467,7 @@ > } > dev_iter_destroy(iter); > >- if (list_empty(head)) >+ if (lvm_list_empty(head)) > return 0; > > return 1; >@@ -490,18 +490,18 @@ > static int _write_uuids(struct disk_list *data) > { > struct uuid_list *ul; >- struct list *uh; >+ struct lvm_list *uh; > uint64_t pos = data->pvd.pv_uuidlist_on_disk.base; > uint64_t end = pos + data->pvd.pv_uuidlist_on_disk.size; > >- list_iterate(uh, &data->uuids) { >+ lvm_list_iterate(uh, &data->uuids) { > if (pos >= end) { > log_error("Too many uuids to fit on %s", > dev_name(data->dev)); > return 0; > } > >- ul = list_item(uh, struct uuid_list); >+ ul = lvm_list_item(uh, struct uuid_list); > if (!dev_write(data->dev, pos, NAME_LEN, ul->uuid)) > fail; > >@@ -524,7 +524,7 @@ > > static int _write_lvs(struct disk_list *data) > { >- struct list *lvh; >+ struct lvm_list *lvh; > uint64_t pos, offset; > > pos = data->pvd.lv_on_disk.base; >@@ -535,8 +535,8 @@ > return 0; > } > >- list_iterate(lvh, &data->lvds) { >- struct lvd_list *ll = list_item(lvh, struct lvd_list); >+ lvm_list_iterate(lvh, &data->lvds) { >+ struct lvd_list *ll = lvm_list_item(lvh, struct lvd_list); > > offset = sizeof(struct lv_disk) * ll->lvd.lv_number; > if (offset + sizeof(struct lv_disk) > data->pvd.lv_on_disk.size) { >@@ -657,14 +657,14 @@ > int r; > > if (!dev_open(data->dev)) { >- stack; >+ STACK; > return 0; > } > > r = __write_all_pvd(fmt, data); > > if (!dev_close(data->dev)) >- stack; >+ STACK; > > return r; > } >@@ -674,13 +674,13 @@ > * little sanity checking, so make sure correct > * data is passed to here. > */ >-int write_disks(const struct format_type *fmt, struct list *pvs) >+int write_disks(const struct format_type *fmt, struct lvm_list *pvs) > { >- struct list *pvh; >+ struct lvm_list *pvh; > struct disk_list *dl; > >- list_iterate(pvh, pvs) { >- dl = list_item(pvh, struct disk_list); >+ lvm_list_iterate(pvh, pvs) { >+ dl = lvm_list_item(pvh, struct disk_list); > if (!(_write_all_pvd(fmt, dl))) > fail; > >diff -ruN LVM2.2.00.15.orig/lib/format1/disk-rep.h LVM2.2.00.15/lib/format1/disk-rep.h >--- LVM2.2.00.15.orig/lib/format1/disk-rep.h 2004-03-30 19:35:39.000000000 +0000 >+++ LVM2.2.00.15/lib/format1/disk-rep.h 2004-07-03 19:44:20.500476288 +0000 >@@ -148,24 +148,24 @@ > } __attribute__ ((packed)); > > struct uuid_list { >- struct list list; >+ struct lvm_list list; > char uuid[NAME_LEN]; > }; > > struct lvd_list { >- struct list list; >+ struct lvm_list list; > struct lv_disk lvd; > }; > > struct disk_list { >- struct list list; >+ struct lvm_list list; > struct pool *mem; > struct device *dev; > > struct pv_disk pvd; > struct vg_disk vgd; >- struct list uuids; >- struct list lvds; >+ struct lvm_list uuids; >+ struct lvm_list lvds; > struct pe_disk *extents; > }; > >@@ -195,9 +195,9 @@ > > int read_pvs_in_vg(const struct format_type *fmt, const char *vg_name, > struct dev_filter *filter, >- struct pool *mem, struct list *results); >+ struct pool *mem, struct lvm_list *results); > >-int write_disks(const struct format_type *fmt, struct list *pvds); >+int write_disks(const struct format_type *fmt, struct lvm_list *pvds); > > /* > * Functions to translate to between disk and in >@@ -217,32 +217,32 @@ > int import_lv(struct pool *mem, struct logical_volume *lv, struct lv_disk *lvd); > > int import_extents(struct pool *mem, struct volume_group *vg, >- struct list *pvds); >+ struct lvm_list *pvds); > int export_extents(struct disk_list *dl, uint32_t lv_num, > struct logical_volume *lv, struct physical_volume *pv); > > int import_pvs(const struct format_type *fmt, struct pool *mem, > struct volume_group *vg, >- struct list *pvds, struct list *results, int *count); >+ struct lvm_list *pvds, struct lvm_list *results, int *count); > >-int import_lvs(struct pool *mem, struct volume_group *vg, struct list *pvds); >+int import_lvs(struct pool *mem, struct volume_group *vg, struct lvm_list *pvds); > int export_lvs(struct disk_list *dl, struct volume_group *vg, > struct physical_volume *pv, const char *dev_dir); > > int import_snapshots(struct pool *mem, struct volume_group *vg, >- struct list *pvds); >+ struct lvm_list *pvds); > > int export_uuids(struct disk_list *dl, struct volume_group *vg); > >-void export_numbers(struct list *pvds, struct volume_group *vg); >+void export_numbers(struct lvm_list *pvds, struct volume_group *vg); > >-void export_pv_act(struct list *pvds); >+void export_pv_act(struct lvm_list *pvds); > void munge_exported_vg(struct pv_disk *pvd); > > /* blech */ > int get_free_vg_number(struct format_instance *fid, struct dev_filter *filter, > const char *candidate_vg, int *result); >-int export_vg_number(struct format_instance *fid, struct list *pvds, >+int export_vg_number(struct format_instance *fid, struct lvm_list *pvds, > const char *vg_name, struct dev_filter *filter); > > #endif >diff -ruN LVM2.2.00.15.orig/lib/format1/format1.c LVM2.2.00.15/lib/format1/format1.c >--- LVM2.2.00.15.orig/lib/format1/format1.c 2004-03-30 19:35:39.000000000 +0000 >+++ LVM2.2.00.15/lib/format1/format1.c 2004-07-03 19:51:41.315462224 +0000 >@@ -28,9 +28,9 @@ > #define FMT_LVM1_NAME "lvm1" > > /* VG consistency checks */ >-static int _check_vgs(struct list *pvs, int *partial) >+static int _check_vgs(struct lvm_list *pvs, int *partial) > { >- struct list *pvh, *t; >+ struct lvm_list *pvh, *t; > struct disk_list *dl = NULL; > struct disk_list *first = NULL; > >@@ -45,8 +45,8 @@ > * This means an active VG won't be affected if disks are inserted > * bearing an exported VG with the same name. > */ >- list_iterate(pvh, pvs) { >- dl = list_item(pvh, struct disk_list); >+ lvm_list_iterate(pvh, pvs) { >+ dl = lvm_list_item(pvh, struct disk_list); > > if (first_time) { > exported = dl->pvd.pv_status & VG_EXPORTED; >@@ -56,18 +56,18 @@ > > if (exported != (dl->pvd.pv_status & VG_EXPORTED)) { > /* Remove exported PVs */ >- list_iterate_safe(pvh, t, pvs) { >- dl = list_item(pvh, struct disk_list); >+ lvm_list_iterate_safe(pvh, t, pvs) { >+ dl = lvm_list_item(pvh, struct disk_list); > if (dl->pvd.pv_status & VG_EXPORTED) >- list_del(pvh); >+ lvm_list_del(pvh); > } > break; > } > } > > /* Remove any PVs with VG structs that differ from the first */ >- list_iterate_safe(pvh, t, pvs) { >- dl = list_item(pvh, struct disk_list); >+ lvm_list_iterate_safe(pvh, t, pvs) { >+ dl = lvm_list_item(pvh, struct disk_list); > > if (!first) > first = dl; >@@ -104,7 +104,7 @@ > dl->vgd.vgda, dl->vgd.pe_size, > dl->vgd.pe_total, dl->vgd.pe_allocated, > dl->vgd.pvg_total); >- list_del(pvh); >+ lvm_list_del(pvh); > if (partial_mode()) { > *partial = 1; > continue; >@@ -127,7 +127,7 @@ > } > > static struct volume_group *_build_vg(struct format_instance *fid, >- struct list *pvs) >+ struct lvm_list *pvs) > { > struct pool *mem = fid->fmt->cmd->mem; > struct volume_group *vg = pool_alloc(mem, sizeof(*vg)); >@@ -137,7 +137,7 @@ > if (!vg) > goto bad; > >- if (list_empty(pvs)) >+ if (lvm_list_empty(pvs)) > goto bad; > > memset(vg, 0, sizeof(*vg)); >@@ -145,15 +145,15 @@ > vg->cmd = fid->fmt->cmd; > vg->fid = fid; > vg->seqno = 0; >- list_init(&vg->pvs); >- list_init(&vg->lvs); >- list_init(&vg->snapshots); >- list_init(&vg->tags); >+ lvm_list_init(&vg->pvs); >+ lvm_list_init(&vg->lvs); >+ lvm_list_init(&vg->snapshots); >+ lvm_list_init(&vg->tags); > > if (!_check_vgs(pvs, &partial)) > goto bad; > >- dl = list_item(pvs->n, struct disk_list); >+ dl = lvm_list_item(pvs->n, struct disk_list); > > if (!import_vg(mem, vg, dl, partial)) > goto bad; >@@ -173,7 +173,7 @@ > return vg; > > bad: >- stack; >+ STACK; > pool_free(mem, vg); > return NULL; > } >@@ -183,12 +183,12 @@ > struct metadata_area *mda) > { > struct pool *mem = pool_create(1024 * 10); >- struct list pvs; >+ struct lvm_list pvs; > struct volume_group *vg = NULL; >- list_init(&pvs); >+ lvm_list_init(&pvs); > > if (!mem) { >- stack; >+ STACK; > return NULL; > } > >@@ -197,12 +197,12 @@ > > if (!read_pvs_in_vg > (fid->fmt, vg_name, fid->fmt->cmd->filter, mem, &pvs)) { >- stack; >+ STACK; > goto bad; > } > > if (!(vg = _build_vg(fid, &pvs))) { >- stack; >+ STACK; > goto bad; > } > >@@ -219,21 +219,21 @@ > struct disk_list *dl = pool_alloc(mem, sizeof(*dl)); > > if (!dl) { >- stack; >+ STACK; > return NULL; > } > > dl->mem = mem; > dl->dev = pv->dev; > >- list_init(&dl->uuids); >- list_init(&dl->lvds); >+ lvm_list_init(&dl->uuids); >+ lvm_list_init(&dl->lvds); > > if (!export_pv(fid->fmt->cmd, mem, vg, &dl->pvd, pv) || > !export_vg(&dl->vgd, vg) || > !export_uuids(dl, vg) || > !export_lvs(dl, vg, pv, dev_dir) || !calculate_layout(dl)) { >- stack; >+ STACK; > pool_free(mem, dl); > return NULL; > } >@@ -243,29 +243,29 @@ > > static int _flatten_vg(struct format_instance *fid, struct pool *mem, > struct volume_group *vg, >- struct list *pvds, const char *dev_dir, >+ struct lvm_list *pvds, const char *dev_dir, > struct dev_filter *filter) > { >- struct list *pvh; >+ struct lvm_list *pvh; > struct pv_list *pvl; > struct disk_list *data; > >- list_iterate(pvh, &vg->pvs) { >- pvl = list_item(pvh, struct pv_list); >+ lvm_list_iterate(pvh, &vg->pvs) { >+ pvl = lvm_list_item(pvh, struct pv_list); > > if (!(data = _flatten_pv(fid, mem, vg, pvl->pv, dev_dir))) { >- stack; >+ STACK; > return 0; > } > >- list_add(pvds, &data->list); >+ lvm_list_add(pvds, &data->list); > } > > export_numbers(pvds, vg); > export_pv_act(pvds); > > if (!export_vg_number(fid, pvds, vg->name, filter)) { >- stack; >+ STACK; > return 0; > } > >@@ -276,15 +276,15 @@ > struct metadata_area *mda) > { > struct pool *mem = pool_create(1024 * 10); >- struct list pvds; >+ struct lvm_list pvds; > int r = 0; > > if (!mem) { >- stack; >+ STACK; > return 0; > } > >- list_init(&pvds); >+ lvm_list_init(&pvds); > > r = (_flatten_vg(fid, mem, vg, &pvds, fid->fmt->cmd->dev_dir, > fid->fmt->cmd->filter) && >@@ -296,7 +296,7 @@ > } > > static int _pv_read(const struct format_type *fmt, const char *pv_name, >- struct physical_volume *pv, struct list *mdas) >+ struct physical_volume *pv, struct lvm_list *mdas) > { > struct pool *mem = pool_create(1024); > struct disk_list *dl; >@@ -306,22 +306,22 @@ > log_very_verbose("Reading physical volume data %s from disk", pv_name); > > if (!mem) { >- stack; >+ STACK; > return 0; > } > > if (!(dev = dev_cache_get(pv_name, fmt->cmd->filter))) { >- stack; >+ STACK; > goto out; > } > > if (!(dl = read_disk(fmt, dev, mem, NULL))) { >- stack; >+ STACK; > goto out; > } > > if (!import_pv(fmt->cmd->mem, dl->dev, NULL, pv, &dl->pvd)) { >- stack; >+ STACK; > goto out; > } > >@@ -338,7 +338,7 @@ > uint64_t pe_start, uint32_t extent_count, > uint32_t extent_size, > int pvmetadatacopies, >- uint64_t pvmetadatasize, struct list *mdas, >+ uint64_t pvmetadatasize, struct lvm_list *mdas, > struct physical_volume *pv, struct volume_group *vg) > { > if (pv->size > MAX_PV_SIZE) >@@ -358,7 +358,7 @@ > * This works out pe_start and pe_count. > */ > if (!calculate_extent_count(pv, extent_size, extent_count, pe_start)) { >- stack; >+ STACK; > return 0; > } > >@@ -395,45 +395,45 @@ > } > > static int _pv_write(const struct format_type *fmt, struct physical_volume *pv, >- struct list *mdas, int64_t sector) >+ struct lvm_list *mdas, int64_t sector) > { > struct pool *mem; > struct disk_list *dl; >- struct list pvs; >+ struct lvm_list pvs; > struct label *label; > struct lvmcache_info *info; > > if (!(info = lvmcache_add(fmt->labeller, (char *) &pv->id, pv->dev, > pv->vg_name, NULL))) { >- stack; >+ STACK; > return 0; > } > label = info->label; > info->device_size = pv->size << SECTOR_SHIFT; > info->fmt = fmt; > >- list_init(&info->mdas); >+ lvm_list_init(&info->mdas); > >- list_init(&pvs); >+ lvm_list_init(&pvs); > > /* Ensure any residual PE structure is gone */ > pv->pe_size = pv->pe_count = 0; > pv->pe_start = PE_ALIGN; > > if (!(mem = pool_create(1024))) { >- stack; >+ STACK; > return 0; > } > > if (!(dl = pool_alloc(mem, sizeof(*dl)))) { >- stack; >+ STACK; > goto bad; > } > dl->mem = mem; > dl->dev = pv->dev; > > if (!export_pv(fmt->cmd, mem, NULL, &dl->pvd, pv)) { >- stack; >+ STACK; > goto bad; > } > >@@ -443,9 +443,9 @@ > dl->pvd.pv_on_disk.size = PV_SIZE; > dl->pvd.pe_on_disk.base = PE_ALIGN << SECTOR_SHIFT; > >- list_add(&pvs, &dl->list); >+ lvm_list_add(&pvs, &dl->list); > if (!write_disks(fmt, &pvs)) { >- stack; >+ STACK; > goto bad; > } > >@@ -508,23 +508,23 @@ > struct metadata_area *mda; > > if (!(fid = pool_alloc(fmt->cmd->mem, sizeof(*fid)))) { >- stack; >+ STACK; > return NULL; > } > > fid->fmt = fmt; >- list_init(&fid->metadata_areas); >+ lvm_list_init(&fid->metadata_areas); > > /* Define a NULL metadata area */ > if (!(mda = pool_alloc(fmt->cmd->mem, sizeof(*mda)))) { >- stack; >+ STACK; > pool_free(fmt->cmd->mem, fid); > return NULL; > } > > mda->ops = &_metadata_format1_ops; > mda->metadata_locn = NULL; >- list_add(&fid->metadata_areas, &mda->list); >+ lvm_list_add(&fid->metadata_areas, &mda->list); > > return fid; > } >@@ -560,7 +560,7 @@ > struct format_type *fmt = dbg_malloc(sizeof(*fmt)); > > if (!fmt) { >- stack; >+ STACK; > return NULL; > } > >diff -ruN LVM2.2.00.15.orig/lib/format1/import-export.c LVM2.2.00.15/lib/format1/import-export.c >--- LVM2.2.00.15.orig/lib/format1/import-export.c 2004-03-30 19:35:39.000000000 +0000 >+++ LVM2.2.00.15/lib/format1/import-export.c 2004-07-03 19:54:18.315594576 +0000 >@@ -57,7 +57,7 @@ > > pv->dev = dev; > if (!(pv->vg_name = pool_strdup(mem, pvd->vg_name))) { >- stack; >+ STACK; > return 0; > } > >@@ -87,7 +87,7 @@ > pv->pe_count = pvd->pe_total; > pv->pe_alloc_count = pvd->pe_allocated; > >- list_init(&pv->tags); >+ lvm_list_init(&pv->tags); > > return 1; > } >@@ -117,7 +117,7 @@ > memcpy(pvd->pv_uuid, pv->id.uuid, ID_LEN); > > if (!_check_vg_name(pv->vg_name)) { >- stack; >+ STACK; > return 0; > } > >@@ -137,7 +137,7 @@ > strncmp(vg->system_id, EXPORTED_TAG, > sizeof(EXPORTED_TAG) - 1)) { > if (!_system_id(cmd, pvd->system_id, EXPORTED_TAG)) { >- stack; >+ STACK; > return 0; > } > } >@@ -154,7 +154,7 @@ > if (vg && !(vg->status & EXPORTED_VG) && *vg->system_id && > !strncmp(vg->system_id, EXPORTED_TAG, sizeof(EXPORTED_TAG) - 1)) { > if (!_system_id(cmd, pvd->system_id, IMPORTED_TAG)) { >- stack; >+ STACK; > return 0; > } > } >@@ -162,7 +162,7 @@ > /* Generate system_id if PV is in VG */ > if (!pvd->system_id || !*pvd->system_id) > if (!_system_id(cmd, pvd->system_id, "")) { >- stack; >+ STACK; > return 0; > } > >@@ -197,17 +197,17 @@ > memcpy(vg->id.uuid, vgd->vg_uuid, ID_LEN); > > if (!_check_vg_name(dl->pvd.vg_name)) { >- stack; >+ STACK; > return 0; > } > > if (!(vg->name = pool_strdup(mem, dl->pvd.vg_name))) { >- stack; >+ STACK; > return 0; > } > > if (!(vg->system_id = pool_alloc(mem, NAME_LEN))) { >- stack; >+ STACK; > return 0; > } > >@@ -284,7 +284,7 @@ > lvid_from_lvnum(&lv->lvid, &lv->vg->id, lvd->lv_number); > > if (!(lv->name = _create_lv_name(mem, lvd->lv_name))) { >- stack; >+ STACK; > return 0; > } > >@@ -321,8 +321,8 @@ > lv->size = lvd->lv_size; > lv->le_count = lvd->lv_allocated_le; > >- list_init(&lv->segments); >- list_init(&lv->tags); >+ lvm_list_init(&lv->segments); >+ lvm_list_init(&lv->tags); > > return 1; > } >@@ -354,9 +354,9 @@ > > lvd->lv_read_ahead = lv->read_ahead; > lvd->lv_stripes = >- list_item(lv->segments.n, struct lv_segment)->area_count; >+ lvm_list_item(lv->segments.n, struct lv_segment)->area_count; > lvd->lv_stripesize = >- list_item(lv->segments.n, struct lv_segment)->stripe_size; >+ lvm_list_item(lv->segments.n, struct lv_segment)->stripe_size; > > lvd->lv_size = lv->size; > lvd->lv_allocated_le = lv->le_count; >@@ -371,13 +371,13 @@ > int export_extents(struct disk_list *dl, uint32_t lv_num, > struct logical_volume *lv, struct physical_volume *pv) > { >- struct list *segh; >+ struct lvm_list *segh; > struct pe_disk *ped; > struct lv_segment *seg; > uint32_t pe, s; > >- list_iterate(segh, &lv->segments) { >- seg = list_item(segh, struct lv_segment); >+ lvm_list_iterate(segh, &lv->segments) { >+ seg = lvm_list_item(segh, struct lv_segment); > > for (s = 0; s < seg->area_count; s++) { > if (seg->type != SEG_STRIPED) { >@@ -407,30 +407,30 @@ > > int import_pvs(const struct format_type *fmt, struct pool *mem, > struct volume_group *vg, >- struct list *pvds, struct list *results, int *count) >+ struct lvm_list *pvds, struct lvm_list *results, int *count) > { >- struct list *pvdh; >+ struct lvm_list *pvdh; > struct disk_list *dl; > struct pv_list *pvl; > > *count = 0; >- list_iterate(pvdh, pvds) { >+ lvm_list_iterate(pvdh, pvds) { > >- dl = list_item(pvdh, struct disk_list); >+ dl = lvm_list_item(pvdh, struct disk_list); > > if (!(pvl = pool_zalloc(mem, sizeof(*pvl))) || > !(pvl->pv = pool_alloc(mem, sizeof(*pvl->pv)))) { >- stack; >+ STACK; > return 0; > } > > if (!import_pv(mem, dl->dev, vg, pvl->pv, &dl->pvd)) { >- stack; >+ STACK; > return 0; > } > > pvl->pv->fmt = fmt; >- list_add(results, &pvl->list); >+ lvm_list_add(results, &pvl->list); > (*count)++; > } > >@@ -446,39 +446,39 @@ > > if (!(ll = pool_zalloc(mem, sizeof(*ll))) || > !(ll->lv = pool_zalloc(mem, sizeof(*ll->lv)))) { >- stack; >+ STACK; > return NULL; > } > lv = ll->lv; > lv->vg = vg; > > if (!import_lv(mem, lv, lvd)) { >- stack; >+ STACK; > return NULL; > } > >- list_add(&vg->lvs, &ll->list); >+ lvm_list_add(&vg->lvs, &ll->list); > vg->lv_count++; > > return lv; > } > >-int import_lvs(struct pool *mem, struct volume_group *vg, struct list *pvds) >+int import_lvs(struct pool *mem, struct volume_group *vg, struct lvm_list *pvds) > { > struct disk_list *dl; > struct lvd_list *ll; > struct lv_disk *lvd; >- struct list *pvdh, *lvdh; >+ struct lvm_list *pvdh, *lvdh; > >- list_iterate(pvdh, pvds) { >- dl = list_item(pvdh, struct disk_list); >- list_iterate(lvdh, &dl->lvds) { >- ll = list_item(lvdh, struct lvd_list); >+ lvm_list_iterate(pvdh, pvds) { >+ dl = lvm_list_item(pvdh, struct disk_list); >+ lvm_list_iterate(lvdh, &dl->lvds) { >+ ll = lvm_list_item(lvdh, struct lvd_list); > lvd = &ll->lvd; > > if (!find_lv(vg, lvd->lv_name) && > !_add_lv(mem, vg, lvd)) { >- stack; >+ STACK; > return 0; > } > } >@@ -492,7 +492,7 @@ > struct physical_volume *pv, const char *dev_dir) > { > int r = 0; >- struct list *lvh, *sh; >+ struct lvm_list *lvh, *sh; > struct lv_list *ll; > struct lvd_list *lvdl; > size_t len; >@@ -500,12 +500,12 @@ > struct hash_table *lvd_hash; > > if (!_check_vg_name(vg->name)) { >- stack; >+ STACK; > return 0; > } > > if (!(lvd_hash = hash_create(32))) { >- stack; >+ STACK; > return 0; > } > >@@ -514,15 +514,15 @@ > */ > len = sizeof(struct pe_disk) * dl->pvd.pe_total; > if (!(dl->extents = pool_alloc(dl->mem, len))) { >- stack; >+ STACK; > goto out; > } > memset(dl->extents, 0, len); > >- list_iterate(lvh, &vg->lvs) { >- ll = list_item(lvh, struct lv_list); >+ lvm_list_iterate(lvh, &vg->lvs) { >+ ll = lvm_list_item(lvh, struct lv_list); > if (!(lvdl = pool_alloc(dl->mem, sizeof(*lvdl)))) { >- stack; >+ STACK; > goto out; > } > >@@ -533,16 +533,16 @@ > lvdl->lvd.lv_number = lv_num; > > if (!hash_insert(lvd_hash, ll->lv->name, &lvdl->lvd)) { >- stack; >+ STACK; > goto out; > } > > if (!export_extents(dl, lv_num + 1, ll->lv, pv)) { >- stack; >+ STACK; > goto out; > } > >- list_add(&dl->lvds, &lvdl->list); >+ lvm_list_add(&dl->lvds, &lvdl->list); > dl->pvd.lv_cur++; > } > >@@ -550,9 +550,9 @@ > * Now we need to run through the snapshots, exporting > * the SNAPSHOT_ORG flags etc. > */ >- list_iterate(sh, &vg->snapshots) { >+ lvm_list_iterate(sh, &vg->snapshots) { > struct lv_disk *org, *cow; >- struct snapshot *s = list_item(sh, >+ struct snapshot *s = lvm_list_item(sh, > struct snapshot_list)->snapshot; > > if (!(org = hash_lookup(lvd_hash, s->origin->name))) { >@@ -584,10 +584,10 @@ > * FIXME: More inefficient code. > */ > int import_snapshots(struct pool *mem, struct volume_group *vg, >- struct list *pvds) >+ struct lvm_list *pvds) > { > struct logical_volume *lvs[MAX_LV]; >- struct list *pvdh, *lvdh; >+ struct lvm_list *pvdh, *lvdh; > struct disk_list *dl; > struct lv_disk *lvd; > int lvnum; >@@ -595,11 +595,11 @@ > > /* build an index of lv numbers */ > memset(lvs, 0, sizeof(lvs)); >- list_iterate(pvdh, pvds) { >- dl = list_item(pvdh, struct disk_list); >+ lvm_list_iterate(pvdh, pvds) { >+ dl = lvm_list_item(pvdh, struct disk_list); > >- list_iterate(lvdh, &dl->lvds) { >- lvd = &(list_item(lvdh, struct lvd_list)->lvd); >+ lvm_list_iterate(lvdh, &dl->lvds) { >+ lvd = &(lvm_list_item(lvdh, struct lvd_list)->lvd); > > lvnum = lvd->lv_number; > >@@ -621,11 +621,11 @@ > /* > * Now iterate through yet again adding the snapshots. > */ >- list_iterate(pvdh, pvds) { >- dl = list_item(pvdh, struct disk_list); >+ lvm_list_iterate(pvdh, pvds) { >+ dl = lvm_list_item(pvdh, struct disk_list); > >- list_iterate(lvdh, &dl->lvds) { >- lvd = &(list_item(lvdh, struct lvd_list)->lvd); >+ lvm_list_iterate(lvdh, &dl->lvds) { >+ lvd = &(lvm_list_item(lvdh, struct lvd_list)->lvd); > > if (!(lvd->lv_access & LV_SNAPSHOT)) > continue; >@@ -658,19 +658,19 @@ > { > struct uuid_list *ul; > struct pv_list *pvl; >- struct list *pvh; >+ struct lvm_list *pvh; > >- list_iterate(pvh, &vg->pvs) { >- pvl = list_item(pvh, struct pv_list); >+ lvm_list_iterate(pvh, &vg->pvs) { >+ pvl = lvm_list_item(pvh, struct pv_list); > if (!(ul = pool_alloc(dl->mem, sizeof(*ul)))) { >- stack; >+ STACK; > return 0; > } > > memset(ul->uuid, 0, sizeof(ul->uuid)); > memcpy(ul->uuid, pvl->pv->id.uuid, ID_LEN); > >- list_add(&dl->uuids, &ul->list); >+ lvm_list_add(&dl->uuids, &ul->list); > } > return 1; > } >@@ -679,14 +679,14 @@ > * This calculates the nasty pv_number field > * used by LVM1. > */ >-void export_numbers(struct list *pvds, struct volume_group *vg) >+void export_numbers(struct lvm_list *pvds, struct volume_group *vg) > { >- struct list *pvdh; >+ struct lvm_list *pvdh; > struct disk_list *dl; > int pv_num = 1; > >- list_iterate(pvdh, pvds) { >- dl = list_item(pvdh, struct disk_list); >+ lvm_list_iterate(pvdh, pvds) { >+ dl = lvm_list_item(pvdh, struct disk_list); > dl->pvd.pv_number = pv_num++; > } > } >@@ -694,38 +694,38 @@ > /* > * Calculate vg_disk->pv_act. > */ >-void export_pv_act(struct list *pvds) >+void export_pv_act(struct lvm_list *pvds) > { >- struct list *pvdh; >+ struct lvm_list *pvdh; > struct disk_list *dl; > int act = 0; > >- list_iterate(pvdh, pvds) { >- dl = list_item(pvdh, struct disk_list); >+ lvm_list_iterate(pvdh, pvds) { >+ dl = lvm_list_item(pvdh, struct disk_list); > if (dl->pvd.pv_status & PV_ACTIVE) > act++; > } > >- list_iterate(pvdh, pvds) { >- dl = list_item(pvdh, struct disk_list); >+ lvm_list_iterate(pvdh, pvds) { >+ dl = lvm_list_item(pvdh, struct disk_list); > dl->vgd.pv_act = act; > } > } > >-int export_vg_number(struct format_instance *fid, struct list *pvds, >+int export_vg_number(struct format_instance *fid, struct lvm_list *pvds, > const char *vg_name, struct dev_filter *filter) > { >- struct list *pvdh; >+ struct lvm_list *pvdh; > struct disk_list *dl; > int vg_num; > > if (!get_free_vg_number(fid, filter, vg_name, &vg_num)) { >- stack; >+ STACK; > return 0; > } > >- list_iterate(pvdh, pvds) { >- dl = list_item(pvdh, struct disk_list); >+ lvm_list_iterate(pvdh, pvds) { >+ dl = lvm_list_item(pvdh, struct disk_list); > dl->vgd.vg_number = vg_num; > } > >diff -ruN LVM2.2.00.15.orig/lib/format1/import-extents.c LVM2.2.00.15/lib/format1/import-extents.c >--- LVM2.2.00.15.orig/lib/format1/import-extents.c 2004-03-30 19:35:39.000000000 +0000 >+++ LVM2.2.00.15/lib/format1/import-extents.c 2004-07-03 19:55:31.695439144 +0000 >@@ -46,7 +46,7 @@ > struct volume_group *vg) > { > struct hash_table *maps = hash_create(32); >- struct list *llh; >+ struct lvm_list *llh; > struct lv_list *ll; > struct lv_map *lvm; > >@@ -56,23 +56,23 @@ > return NULL; > } > >- list_iterate(llh, &vg->lvs) { >- ll = list_item(llh, struct lv_list); >+ lvm_list_iterate(llh, &vg->lvs) { >+ ll = lvm_list_item(llh, struct lv_list); > > if (!(lvm = pool_alloc(mem, sizeof(*lvm)))) { >- stack; >+ STACK; > goto bad; > } > > lvm->lv = ll->lv; > if (!(lvm->map = pool_zalloc(mem, sizeof(*lvm->map) > * ll->lv->le_count))) { >- stack; >+ STACK; > goto bad; > } > > if (!hash_insert(maps, ll->lv->name, lvm)) { >- stack; >+ STACK; > goto bad; > } > } >@@ -87,12 +87,12 @@ > static int _fill_lv_array(struct lv_map **lvs, > struct hash_table *maps, struct disk_list *dl) > { >- struct list *lvh; >+ struct lvm_list *lvh; > struct lv_map *lvm; > > memset(lvs, 0, sizeof(*lvs) * MAX_LV); >- list_iterate(lvh, &dl->lvds) { >- struct lvd_list *ll = list_item(lvh, struct lvd_list); >+ lvm_list_iterate(lvh, &dl->lvds) { >+ struct lvd_list *ll = lvm_list_item(lvh, struct lvd_list); > > if (!(lvm = hash_lookup(maps, strrchr(ll->lvd.lv_name, '/') > + 1))) { >@@ -112,23 +112,23 @@ > } > > static int _fill_maps(struct hash_table *maps, struct volume_group *vg, >- struct list *pvds) >+ struct lvm_list *pvds) > { >- struct list *pvdh; >+ struct lvm_list *pvdh; > struct disk_list *dl; > struct physical_volume *pv; > struct lv_map *lvms[MAX_LV], *lvm; > struct pe_disk *e; > uint32_t i, lv_num, le; > >- list_iterate(pvdh, pvds) { >- dl = list_item(pvdh, struct disk_list); >+ lvm_list_iterate(pvdh, pvds) { >+ dl = lvm_list_item(pvdh, struct disk_list); > pv = find_pv(vg, dl->dev); > e = dl->extents; > > /* build an array of lv's for this pv */ > if (!_fill_lv_array(lvms, maps, dl)) { >- stack; >+ STACK; > return 0; > } > >@@ -194,7 +194,7 @@ > lvm = (struct lv_map *) hash_get_data(maps, n); > > if (!_check_single_map(lvm)) { >- stack; >+ STACK; > return 0; > } > } >@@ -231,7 +231,7 @@ > > le += seg->len; > >- list_add(&lvm->lv->segments, &seg->list); >+ lvm_list_add(&lvm->lv->segments, &seg->list); > } > > return 1; >@@ -274,7 +274,7 @@ > > while (le < len) { > if (!(seg = alloc_lv_segment(mem, lvm->stripes))) { >- stack; >+ STACK; > return 0; > } > >@@ -306,7 +306,7 @@ > le += seg->len; > seg->len *= seg->area_count; > >- list_add(&lvm->lv->segments, &seg->list); >+ lvm_list_add(&lvm->lv->segments, &seg->list); > } > > return 1; >@@ -326,7 +326,7 @@ > for (n = hash_get_first(maps); n; n = hash_get_next(maps, n)) { > lvm = (struct lv_map *) hash_get_data(maps, n); > if (!_build_segments(mem, lvm)) { >- stack; >+ STACK; > return 0; > } > } >@@ -334,14 +334,14 @@ > return 1; > } > >-int import_extents(struct pool *mem, struct volume_group *vg, struct list *pvds) >+int import_extents(struct pool *mem, struct volume_group *vg, struct lvm_list *pvds) > { > int r = 0; > struct pool *scratch = pool_create(10 * 1024); > struct hash_table *maps; > > if (!scratch) { >- stack; >+ STACK; > return 0; > } > >@@ -356,7 +356,7 @@ > } > > if (!_check_maps_are_complete(maps) && !(vg->status & PARTIAL_VG)) { >- stack; >+ STACK; > goto out; > } > >diff -ruN LVM2.2.00.15.orig/lib/format1/layout.c LVM2.2.00.15/lib/format1/layout.c >--- LVM2.2.00.15.orig/lib/format1/layout.c 2004-03-30 19:35:39.000000000 +0000 >+++ LVM2.2.00.15/lib/format1/layout.c 2004-07-03 18:35:53.798789840 +0000 >@@ -121,7 +121,7 @@ > uint32_t end; > > if (!pvd) { >- stack; >+ STACK; > return 0; > } > >diff -ruN LVM2.2.00.15.orig/lib/format1/lvm1-label.c LVM2.2.00.15/lib/format1/lvm1-label.c >--- LVM2.2.00.15.orig/lib/format1/lvm1-label.c 2004-03-30 19:35:39.000000000 +0000 >+++ LVM2.2.00.15/lib/format1/lvm1-label.c 2004-07-03 19:56:45.666193880 +0000 >@@ -62,13 +62,13 @@ > > munge_exported_vg(pvd); > if (!(info = lvmcache_add(l, pvd->pv_uuid, dev, pvd->vg_name, NULL))) { >- stack; >+ STACK; > return 0; > } > *label = info->label; > > info->device_size = xlate32(pvd->pv_size) << SECTOR_SHIFT; >- list_init(&info->mdas); >+ lvm_list_init(&info->mdas); > > info->status &= ~CACHE_INVALID; > >diff -ruN LVM2.2.00.15.orig/lib/format1/vg_number.c LVM2.2.00.15/lib/format1/vg_number.c >--- LVM2.2.00.15.orig/lib/format1/vg_number.c 2004-03-30 19:35:39.000000000 +0000 >+++ LVM2.2.00.15/lib/format1/vg_number.c 2004-07-03 19:58:10.492298352 +0000 >@@ -27,28 +27,28 @@ > int get_free_vg_number(struct format_instance *fid, struct dev_filter *filter, > const char *candidate_vg, int *result) > { >- struct list *pvh; >- struct list all_pvs; >+ struct lvm_list *pvh; >+ struct lvm_list all_pvs; > struct disk_list *dl; > struct pool *mem = pool_create(10 * 1024); > int numbers[MAX_VG], i, r = 0; > >- list_init(&all_pvs); >+ lvm_list_init(&all_pvs); > > if (!mem) { >- stack; >+ STACK; > return 0; > } > > if (!read_pvs_in_vg(fid->fmt, NULL, filter, mem, &all_pvs)) { >- stack; >+ STACK; > goto out; > } > > memset(numbers, 0, sizeof(numbers)); > >- list_iterate(pvh, &all_pvs) { >- dl = list_item(pvh, struct disk_list); >+ lvm_list_iterate(pvh, &all_pvs) { >+ dl = lvm_list_item(pvh, struct disk_list); > if (!*dl->pvd.vg_name || !strcmp(dl->pvd.vg_name, candidate_vg)) > continue; > >diff -ruN LVM2.2.00.15.orig/lib/format_text/archive.c LVM2.2.00.15/lib/format_text/archive.c >--- LVM2.2.00.15.orig/lib/format_text/archive.c 2004-03-30 19:35:39.000000000 +0000 >+++ LVM2.2.00.15/lib/format_text/archive.c 2004-07-03 20:05:34.857744536 +0000 >@@ -50,7 +50,7 @@ > * with the least recent at the head. > */ > struct archive_file { >- struct list list; >+ struct lvm_list list; > > char *path; > int index; >@@ -89,27 +89,27 @@ > return 1; > } > >-static void _insert_file(struct list *head, struct archive_file *b) >+static void _insert_file(struct lvm_list *head, struct archive_file *b) > { >- struct list *bh; >+ struct lvm_list *bh; > struct archive_file *bf = NULL; > >- if (list_empty(head)) { >- list_add(head, &b->list); >+ if (lvm_list_empty(head)) { >+ lvm_list_add(head, &b->list); > return; > } > > /* index increases through list */ >- list_iterate(bh, head) { >- bf = list_item(bh, struct archive_file); >+ lvm_list_iterate(bh, head) { >+ bf = lvm_list_item(bh, struct archive_file); > > if (bf->index > b->index) { >- list_add(&bf->list, &b->list); >+ lvm_list_add(&bf->list, &b->list); > return; > } > } > >- list_add_h(&bf->list, &b->list); >+ lvm_list_add_h(&bf->list, &b->list); > } > > static char *_join(struct pool *mem, const char *dir, const char *name) >@@ -119,7 +119,7 @@ > !pool_grow_object(mem, "/", 1) || > !pool_grow_object(mem, name, strlen(name)) || > !pool_grow_object(mem, "\0", 1)) { >- stack; >+ STACK; > return NULL; > } > >@@ -129,21 +129,21 @@ > /* > * Returns a list of archive_files. > */ >-static struct list *_scan_archive(struct pool *mem, >+static struct lvm_list *_scan_archive(struct pool *mem, > const char *vgname, const char *dir) > { > int i, count, ix; > char vgname_found[64], *path; > struct dirent **dirent; > struct archive_file *af; >- struct list *results; >+ struct lvm_list *results; > > if (!(results = pool_alloc(mem, sizeof(*results)))) { >- stack; >+ STACK; > return NULL; > } > >- list_init(results); >+ lvm_list_init(results); > > /* Sort fails beyond 5-digit indexes */ > if ((count = scandir(dir, &dirent, NULL, alphasort)) < 0) { >@@ -166,7 +166,7 @@ > continue; > > if (!(path = _join(mem, dir, dirent[i]->d_name))) { >- stack; >+ STACK; > goto out; > } > >@@ -196,10 +196,10 @@ > return results; > } > >-static void _remove_expired(struct list *archives, uint32_t archives_size, >+static void _remove_expired(struct lvm_list *archives, uint32_t archives_size, > uint32_t retain_days, uint32_t min_archive) > { >- struct list *bh; >+ struct lvm_list *bh; > struct archive_file *bf; > struct stat sb; > time_t retain_time; >@@ -213,8 +213,8 @@ > retain_time = time(NULL) - (time_t) retain_days *SECS_PER_DAY; > > /* Assume list is ordered oldest first (by index) */ >- list_iterate(bh, archives) { >- bf = list_item(bh, struct archive_file); >+ lvm_list_iterate(bh, archives) { >+ bf = lvm_list_item(bh, struct archive_file); > > /* Get the mtime of the file and unlink if too old */ > if (stat(bf->path, &sb)) { >@@ -244,7 +244,7 @@ > struct archive_file *last; > FILE *fp = NULL; > char temp_file[PATH_MAX], archive_name[PATH_MAX]; >- struct list *archives; >+ struct lvm_list *archives; > > /* > * Write the vg out to a temporary file. >@@ -261,7 +261,7 @@ > } > > if (!text_vg_export_file(vg, desc, fp)) { >- stack; >+ STACK; > fclose(fp); > return 0; > } >@@ -276,10 +276,10 @@ > return 0; > } > >- if (list_empty(archives)) >+ if (lvm_list_empty(archives)) > ix = 0; > else { >- last = list_item(archives->p, struct archive_file); >+ last = lvm_list_item(archives->p, struct archive_file); > ix = last->index + 1; > } > >@@ -299,7 +299,7 @@ > if (!renamed) > log_error("Archive rename failed for %s", temp_file); > >- _remove_expired(archives, list_size(archives) + renamed, retain_days, >+ _remove_expired(archives, lvm_list_size(archives) + renamed, retain_days, > min_archive); > > return 1; >@@ -344,7 +344,7 @@ > > int archive_list(struct cmd_context *cmd, const char *dir, const char *vgname) > { >- struct list *archives, *ah; >+ struct lvm_list *archives, *ah; > struct archive_file *af; > > if (!(archives = _scan_archive(cmd->mem, vgname, dir))) { >@@ -352,11 +352,11 @@ > return 0; > } > >- if (list_empty(archives)) >+ if (lvm_list_empty(archives)) > log_print("No archives found in %s.", dir); > >- list_iterate(ah, archives) { >- af = list_item(ah, struct archive_file); >+ lvm_list_iterate(ah, archives) { >+ af = lvm_list_item(ah, struct archive_file); > > _display_archive(cmd, af); > } >@@ -371,7 +371,7 @@ > struct archive_file af; > > if (!(af.path = _join(cmd->mem, dir, vgname))) { >- stack; >+ STACK; > return 0; > } > >diff -ruN LVM2.2.00.15.orig/lib/format_text/export.c LVM2.2.00.15/lib/format_text/export.c >--- LVM2.2.00.15.orig/lib/format_text/export.c 2004-03-30 19:35:39.000000000 +0000 >+++ LVM2.2.00.15/lib/format_text/export.c 2004-07-03 20:07:03.180317464 +0000 >@@ -253,7 +253,7 @@ > return r; > } > >-#define _outf(args...) do {if (!_out(args)) {stack; return 0;}} while (0) >+#define _outf(args...) do {if (!_out(args)) {STACK; return 0;}} while (0) > > static int _print_header(struct formatter *f, > struct volume_group *vg, const char *desc) >@@ -282,7 +282,7 @@ > char buffer[4096]; > > if (!id_write_format(&vg->id, buffer, sizeof(buffer))) { >- stack; >+ STACK; > return 0; > } > >@@ -291,14 +291,14 @@ > _outf(f, "seqno = %u", vg->seqno); > > if (!print_flags(vg->status, VG_FLAGS, buffer, sizeof(buffer))) { >- stack; >+ STACK; > return 0; > } > _outf(f, "status = %s", buffer); > >- if (!list_empty(&vg->tags)) { >+ if (!lvm_list_empty(&vg->tags)) { > if (!print_tags(&vg->tags, buffer, sizeof(buffer))) { >- stack; >+ STACK; > return 0; > } > _outf(f, "tags = %s", buffer); >@@ -309,7 +309,7 @@ > > if (!_out_size(f, (uint64_t) vg->extent_size, "extent_size = %u", > vg->extent_size)) { >- stack; >+ STACK; > return 0; > } > _outf(f, "max_lv = %u", vg->max_lv); >@@ -331,7 +331,7 @@ > > static int _print_pvs(struct formatter *f, struct volume_group *vg) > { >- struct list *pvh; >+ struct lvm_list *pvh; > struct physical_volume *pv; > char buffer[4096]; > const char *name; >@@ -339,11 +339,11 @@ > _outf(f, "physical_volumes {"); > _inc_indent(f); > >- list_iterate(pvh, &vg->pvs) { >- pv = list_item(pvh, struct pv_list)->pv; >+ lvm_list_iterate(pvh, &vg->pvs) { >+ pv = lvm_list_item(pvh, struct pv_list)->pv; > > if (!(name = _get_pv_name(f, pv))) { >- stack; >+ STACK; > return 0; > } > >@@ -352,26 +352,26 @@ > _inc_indent(f); > > if (!id_write_format(&pv->id, buffer, sizeof(buffer))) { >- stack; >+ STACK; > return 0; > } > > _outf(f, "id = \"%s\"", buffer); > if (!_out_hint(f, "device = \"%s\"", dev_name(pv->dev))) { >- stack; >+ STACK; > return 0; > } > f->nl(f); > > if (!print_flags(pv->status, PV_FLAGS, buffer, sizeof(buffer))) { >- stack; >+ STACK; > return 0; > } > _outf(f, "status = %s", buffer); > >- if (!list_empty(&pv->tags)) { >+ if (!lvm_list_empty(&pv->tags)) { > if (!print_tags(&pv->tags, buffer, sizeof(buffer))) { >- stack; >+ STACK; > return 0; > } > _outf(f, "tags = %s", buffer); >@@ -380,7 +380,7 @@ > _outf(f, "pe_start = %" PRIu64, pv->pe_start); > if (!_out_size(f, vg->extent_size * (uint64_t) pv->pe_count, > "pe_count = %u", pv->pe_count)) { >- stack; >+ STACK; > return 0; > } > >@@ -407,16 +407,16 @@ > _outf(f, "start_extent = %u", seg->le); > if (!_out_size(f, (uint64_t) seg->len * vg->extent_size, > "extent_count = %u", seg->len)) { >- stack; >+ STACK; > return 0; > } > > f->nl(f); > _outf(f, "type = \"%s\"", get_segtype_string(seg->type)); > >- if (!list_empty(&seg->tags)) { >+ if (!lvm_list_empty(&seg->tags)) { > if (!print_tags(&seg->tags, buffer, sizeof(buffer))) { >- stack; >+ STACK; > return 0; > } > _outf(f, "tags = %s", buffer); >@@ -453,7 +453,7 @@ > case AREA_PV: > if (!(name = _get_pv_name(f, seg-> > area[s].u.pv.pv))) { >- stack; >+ STACK; > return 0; > } > >@@ -483,9 +483,9 @@ > static int _count_segments(struct logical_volume *lv) > { > int r = 0; >- struct list *segh; >+ struct lvm_list *segh; > >- list_iterate(segh, &lv->segments) >+ lvm_list_iterate(segh, &lv->segments) > r++; > > return r; >@@ -503,14 +503,14 @@ > _inc_indent(f); > > if (!id_write_format(&snap->id, buffer, sizeof(buffer))) { >- stack; >+ STACK; > return 0; > } > > _outf(f, "id = \"%s\"", buffer); > if (!print_flags(LVM_READ | LVM_WRITE | VISIBLE_LV, LV_FLAGS, > buffer, sizeof(buffer))) { >- stack; >+ STACK; > return 0; > } > >@@ -527,10 +527,10 @@ > seg.chunk_size = snap->chunk_size; > > /* Can't tag a snapshot independently of its origin */ >- list_init(&seg.tags); >+ lvm_list_init(&seg.tags); > > if (!_print_segment(f, snap->origin->vg, 1, &seg)) { >- stack; >+ STACK; > return 0; > } > >@@ -542,15 +542,15 @@ > > static int _print_snapshots(struct formatter *f, struct volume_group *vg) > { >- struct list *sh; >+ struct lvm_list *sh; > struct snapshot *s; > unsigned int count = 0; > >- list_iterate(sh, &vg->snapshots) { >- s = list_item(sh, struct snapshot_list)->snapshot; >+ lvm_list_iterate(sh, &vg->snapshots) { >+ s = lvm_list_item(sh, struct snapshot_list)->snapshot; > > if (!_print_snapshot(f, s, count++)) { >- stack; >+ STACK; > return 0; > } > } >@@ -560,7 +560,7 @@ > > static int _print_lvs(struct formatter *f, struct volume_group *vg) > { >- struct list *lvh; >+ struct lvm_list *lvh; > struct logical_volume *lv; > struct lv_segment *seg; > char buffer[4096]; >@@ -569,14 +569,14 @@ > /* > * Don't bother with an lv section if there are no lvs. > */ >- if (list_empty(&vg->lvs)) >+ if (lvm_list_empty(&vg->lvs)) > return 1; > > _outf(f, "logical_volumes {"); > _inc_indent(f); > >- list_iterate(lvh, &vg->lvs) { >- lv = list_item(lvh, struct lv_list)->lv; >+ lvm_list_iterate(lvh, &vg->lvs) { >+ lv = lvm_list_item(lvh, struct lv_list)->lv; > > f->nl(f); > _outf(f, "%s {", lv->name); >@@ -584,21 +584,21 @@ > > /* FIXME: Write full lvid */ > if (!id_write_format(&lv->lvid.id[1], buffer, sizeof(buffer))) { >- stack; >+ STACK; > return 0; > } > > _outf(f, "id = \"%s\"", buffer); > > if (!print_flags(lv->status, LV_FLAGS, buffer, sizeof(buffer))) { >- stack; >+ STACK; > return 0; > } > _outf(f, "status = %s", buffer); > >- if (!list_empty(&lv->tags)) { >+ if (!lvm_list_empty(&lv->tags)) { > if (!print_tags(&lv->tags, buffer, sizeof(buffer))) { >- stack; >+ STACK; > return 0; > } > _outf(f, "tags = %s", buffer); >@@ -617,9 +617,9 @@ > f->nl(f); > > seg_count = 1; >- list_iterate_items(seg, &lv->segments) { >+ lvm_list_iterate_items(seg, &lv->segments) { > if (!_print_segment(f, vg, seg_count++, seg)) { >- stack; >+ STACK; > return 0; > } > } >@@ -629,7 +629,7 @@ > } > > if (!_print_snapshots(f, vg)) { >- stack; >+ STACK; > return 0; > } > >@@ -647,36 +647,36 @@ > static int _build_pv_names(struct formatter *f, struct volume_group *vg) > { > int count = 0; >- struct list *pvh; >+ struct lvm_list *pvh; > struct physical_volume *pv; > char buffer[32], *name; > > if (!(f->mem = pool_create(512))) { >- stack; >+ STACK; > goto bad; > } > > if (!(f->pv_names = hash_create(128))) { >- stack; >+ STACK; > goto bad; > } > >- list_iterate(pvh, &vg->pvs) { >- pv = list_item(pvh, struct pv_list)->pv; >+ lvm_list_iterate(pvh, &vg->pvs) { >+ pv = lvm_list_item(pvh, struct pv_list)->pv; > > /* FIXME But skip if there's already an LV called pv%d ! */ > if (lvm_snprintf(buffer, sizeof(buffer), "pv%d", count++) < 0) { >- stack; >+ STACK; > goto bad; > } > > if (!(name = pool_strdup(f->mem, buffer))) { >- stack; >+ STACK; > goto bad; > } > > if (!hash_insert(f->pv_names, dev_name(pv->dev), name)) { >- stack; >+ STACK; > goto bad; > } > } >@@ -699,10 +699,10 @@ > int r = 0; > > if (!_build_pv_names(f, vg)) { >- stack; >+ STACK; > goto out; > } >-#define fail do {stack; goto out;} while(0) >+#define fail do {STACK; goto out;} while(0) > > if (f->header && !_print_header(f, vg, desc)) > fail; >@@ -751,7 +751,7 @@ > _init(); > > if (!(f = dbg_malloc(sizeof(*f)))) { >- stack; >+ STACK; > return 0; > } > >@@ -779,7 +779,7 @@ > _init(); > > if (!(f = dbg_malloc(sizeof(*f)))) { >- stack; >+ STACK; > return 0; > } > >@@ -792,7 +792,7 @@ > f->nl = &_nl_raw; > > if (!_text_vg_export(f, vg, desc)) { >- stack; >+ STACK; > r = 0; > goto out; > } >diff -ruN LVM2.2.00.15.orig/lib/format_text/flags.c LVM2.2.00.15/lib/format_text/flags.c >--- LVM2.2.00.15.orig/lib/format_text/flags.c 2004-03-30 19:35:39.000000000 +0000 >+++ LVM2.2.00.15/lib/format_text/flags.c 2004-07-03 18:35:53.948767040 +0000 >@@ -83,7 +83,7 @@ > struct flag *flags; > > if (!(flags = _get_flags(type))) { >- stack; >+ STACK; > return 0; > } > >@@ -124,7 +124,7 @@ > struct flag *flags; > > if (!(flags = _get_flags(type))) { >- stack; >+ STACK; > return 0; > } > >diff -ruN LVM2.2.00.15.orig/lib/format_text/format-text.c LVM2.2.00.15/lib/format_text/format-text.c >--- LVM2.2.00.15.orig/lib/format_text/format-text.c 2004-03-30 19:35:39.000000000 +0000 >+++ LVM2.2.00.15/lib/format_text/format-text.c 2004-07-03 20:11:07.201220648 +0000 >@@ -45,12 +45,12 @@ > void *context); > > struct dir_list { >- struct list list; >+ struct lvm_list list; > char dir[0]; > }; > > struct raw_list { >- struct list list; >+ struct lvm_list list; > struct device_area dev_area; > }; > >@@ -121,7 +121,7 @@ > } > > if (!dev_read(dev_area->dev, dev_area->start, MDA_HEADER_SIZE, mdah)) { >- stack; >+ STACK; > pool_free(fmt->cmd->mem, mdah); > return NULL; > } >@@ -169,7 +169,7 @@ > sizeof(mdah->checksum_xl))); > > if (!dev_write(dev, start_byte, MDA_HEADER_SIZE, mdah)) { >- stack; >+ STACK; > pool_free(fmt->cmd->mem, mdah); > return 0; > } >@@ -191,7 +191,7 @@ > while (rlocn->offset) { > if (!dev_read(dev_area->dev, dev_area->start + rlocn->offset, > sizeof(vgnamebuf), vgnamebuf)) { >- stack; >+ STACK; > return NULL; > } > if (!strncmp(vgnamebuf, vgname, len = strlen(vgname)) && >@@ -212,7 +212,7 @@ > struct mda_header *mdah; > > if (!(mdah = _raw_read_mda_header(fid->fmt, dev_area))) { >- stack; >+ STACK; > return NULL; > } > >@@ -225,7 +225,7 @@ > int r = 0; > > if (!dev_open(dev_area->dev)) { >- stack; >+ STACK; > return 0; > } > >@@ -233,7 +233,7 @@ > r = 1; > > if (!dev_close(dev_area->dev)) >- stack; >+ STACK; > > return r; > } >@@ -250,17 +250,17 @@ > uint32_t wrap = 0; > > if (!dev_open(area->dev)) { >- stack; >+ STACK; > return NULL; > } > > if (!(mdah = _raw_read_mda_header(fid->fmt, area))) { >- stack; >+ STACK; > goto out; > } > > if (!(rlocn = _vg_posn(fid, area, vgname))) { >- stack; >+ STACK; > goto out; > } > >@@ -280,7 +280,7 @@ > (off_t) (area->start + MDA_HEADER_SIZE), > wrap, calc_crc, rlocn->checksum, &when, > &desc))) { >- stack; >+ STACK; > goto out; > } > log_debug("Read %s metadata (%u) from %s at %" PRIu64 " size %" PRIu64, >@@ -289,7 +289,7 @@ > > out: > if (!dev_close(area->dev)) >- stack; >+ STACK; > > return vg; > } >@@ -310,7 +310,7 @@ > struct raw_locn *rlocn; > struct mda_header *mdah; > struct physical_volume *pv; >- struct list *pvh; >+ struct lvm_list *pvh; > int r = 0; > uint32_t new_wrap = 0, old_wrap = 0; > >@@ -319,8 +319,8 @@ > int found = 0; > > /* Ignore any mda on a PV outside the VG. vgsplit relies on this */ >- list_iterate(pvh, &vg->pvs) { >- pv = list_item(pvh, struct pv_list)->pv; >+ lvm_list_iterate(pvh, &vg->pvs) { >+ pv = lvm_list_item(pvh, struct pv_list)->pv; > if (pv->dev == mdac->area.dev) { > found = 1; > break; >@@ -331,12 +331,12 @@ > return 1; > > if (!dev_open(mdac->area.dev)) { >- stack; >+ STACK; > return 0; > } > > if (!(mdah = _raw_read_mda_header(fid->fmt, &mdac->area))) { >- stack; >+ STACK; > goto out; > } > >@@ -381,7 +381,7 @@ > /* Write text out, circularly */ > if (!dev_write(mdac->area.dev, mdac->area.start + mdac->rlocn.offset, > (size_t) (mdac->rlocn.size - new_wrap), buf)) { >- stack; >+ STACK; > goto out; > } > >@@ -394,7 +394,7 @@ > mdac->area.start + MDA_HEADER_SIZE, > (size_t) new_wrap, > buf + mdac->rlocn.size - new_wrap)) { >- stack; >+ STACK; > goto out; > } > } >@@ -411,7 +411,7 @@ > > out: > if (!r && !dev_close(mdac->area.dev)) >- stack; >+ STACK; > > return r; > } >@@ -423,13 +423,13 @@ > struct mda_header *mdah; > struct raw_locn *rlocn; > struct physical_volume *pv; >- struct list *pvh; >+ struct lvm_list *pvh; > int r = 0; > int found = 0; > > /* Ignore any mda on a PV outside the VG. vgsplit relies on this */ >- list_iterate(pvh, &vg->pvs) { >- pv = list_item(pvh, struct pv_list)->pv; >+ lvm_list_iterate(pvh, &vg->pvs) { >+ pv = lvm_list_item(pvh, struct pv_list)->pv; > if (pv->dev == mdac->area.dev) { > found = 1; > break; >@@ -440,7 +440,7 @@ > return 1; > > if (!(mdah = _raw_read_mda_header(fid->fmt, &mdac->area))) { >- stack; >+ STACK; > goto out; > } > >@@ -466,7 +466,7 @@ > > out: > if (!dev_close(mdac->area.dev)) >- stack; >+ STACK; > > return r; > } >@@ -477,12 +477,12 @@ > { > struct mda_context *mdac = (struct mda_context *) mda->metadata_locn; > struct physical_volume *pv; >- struct list *pvh; >+ struct lvm_list *pvh; > int found = 0; > > /* Ignore any mda on a PV outside the VG. vgsplit relies on this */ >- list_iterate(pvh, &vg->pvs) { >- pv = list_item(pvh, struct pv_list)->pv; >+ lvm_list_iterate(pvh, &vg->pvs) { >+ pv = lvm_list_item(pvh, struct pv_list)->pv; > if (pv->dev == mdac->area.dev) { > found = 1; > break; >@@ -493,7 +493,7 @@ > return 1; > > if (!dev_close(mdac->area.dev)) >- stack; >+ STACK; > > return 1; > } >@@ -507,12 +507,12 @@ > int r = 0; > > if (!dev_open(mdac->area.dev)) { >- stack; >+ STACK; > return 0; > } > > if (!(mdah = _raw_read_mda_header(fid->fmt, &mdac->area))) { >- stack; >+ STACK; > goto out; > } > >@@ -535,7 +535,7 @@ > > out: > if (!dev_close(mdac->area.dev)) >- stack; >+ STACK; > > return r; > } >@@ -549,7 +549,7 @@ > char *desc; > > if (!(vg = text_vg_import_file(fid, path_live, &when, &desc))) { >- stack; >+ STACK; > return NULL; > } > >@@ -733,7 +733,7 @@ > { > struct dirent *dirent; > struct dir_list *dl; >- struct list *dlh, *dir_list; >+ struct lvm_list *dlh, *dir_list; > char *tmp; > DIR *d; > struct volume_group *vg; >@@ -743,8 +743,8 @@ > > dir_list = &((struct mda_lists *) fmt->private)->dirs; > >- list_iterate(dlh, dir_list) { >- dl = list_item(dlh, struct dir_list); >+ lvm_list_iterate(dlh, dir_list) { >+ dl = lvm_list_item(dlh, struct dir_list); > if (!(d = opendir(dl->dir))) { > log_sys_error("opendir", dl->dir); > continue; >@@ -786,12 +786,12 @@ > int r = 0; > > if (!dev_open(dev_area->dev)) { >- stack; >+ STACK; > return 0; > } > > if (!(mdah = _raw_read_mda_header(fmt, dev_area))) { >- stack; >+ STACK; > goto out; > } > >@@ -800,7 +800,7 @@ > while (rlocn->offset) { > if (!dev_read(dev_area->dev, dev_area->start + rlocn->offset, > size, buf)) { >- stack; >+ STACK; > goto out; > } > len = 0; >@@ -811,7 +811,7 @@ > > /* Ignore this entry if the characters aren't permissible */ > if (!validate_name(buf)) { >- stack; >+ STACK; > goto out; > } > >@@ -824,7 +824,7 @@ > > out: > if (!dev_close(dev_area->dev)) >- stack; >+ STACK; > > return r; > } >@@ -832,7 +832,7 @@ > static int _scan_raw(const struct format_type *fmt) > { > struct raw_list *rl; >- struct list *rlh, *raw_list; >+ struct lvm_list *rlh, *raw_list; > char vgnamebuf[NAME_LEN + 2]; > struct volume_group *vg; > struct format_instance fid; >@@ -840,10 +840,10 @@ > raw_list = &((struct mda_lists *) fmt->private)->raws; > > fid.fmt = fmt; >- list_init(&fid.metadata_areas); >+ lvm_list_init(&fid.metadata_areas); > >- list_iterate(rlh, raw_list) { >- rl = list_item(rlh, struct raw_list); >+ lvm_list_iterate(rlh, raw_list) { >+ rl = lvm_list_item(rlh, struct raw_list); > > /* FIXME We're reading mdah twice here... */ > if (vgname_from_mda(fmt, &rl->dev_area, vgnamebuf, >@@ -867,7 +867,7 @@ > static int _mda_setup(const struct format_type *fmt, > uint64_t pe_start, uint64_t pe_end, > int pvmetadatacopies, >- uint64_t pvmetadatasize, struct list *mdas, >+ uint64_t pvmetadatasize, struct lvm_list *mdas, > struct physical_volume *pv, struct volume_group *vg) > { > uint64_t mda_adjustment, disk_size, alignment; >@@ -994,12 +994,12 @@ > /* Only for orphans */ > /* Set label_sector to -1 if rewriting existing label into same sector */ > static int _pv_write(const struct format_type *fmt, struct physical_volume *pv, >- struct list *mdas, int64_t label_sector) >+ struct lvm_list *mdas, int64_t label_sector) > { > struct label *label; > struct lvmcache_info *info; > struct mda_context *mdac; >- struct list *mdash; >+ struct lvm_list *mdash; > struct metadata_area *mda; > char buf[MDA_HEADER_SIZE]; > struct mda_header *mdah = (struct mda_header *) buf; >@@ -1009,7 +1009,7 @@ > > if (!(info = lvmcache_add(fmt->labeller, (char *) &pv->id, pv->dev, > ORPHAN, NULL))) { >- stack; >+ STACK; > return 0; > } > label = info->label; >@@ -1026,9 +1026,9 @@ > if (info->mdas.n) > del_mdas(&info->mdas); > else >- list_init(&info->mdas); >- list_iterate(mdash, mdas) { >- mda = list_item(mdash, struct metadata_area); >+ lvm_list_init(&info->mdas); >+ lvm_list_iterate(mdash, mdas) { >+ mda = lvm_list_item(mdash, struct metadata_area); > mdac = mda->metadata_locn; > log_debug("Creating metadata area on %s at sector %" > PRIu64 " size %" PRIu64 " sectors", >@@ -1040,19 +1040,19 @@ > } > /* FIXME Temporary until mda creation supported by tools */ > } else if (!info->mdas.n) { >- list_init(&info->mdas); >+ lvm_list_init(&info->mdas); > } > > if (info->das.n) > del_das(&info->das); > else >- list_init(&info->das); >+ lvm_list_init(&info->das); > > /* Set pe_start to first aligned sector after any metadata > * areas that begin before pe_start */ > pv->pe_start = PE_ALIGN; >- list_iterate(mdash, &info->mdas) { >- mda = list_item(mdash, struct metadata_area); >+ lvm_list_iterate(mdash, &info->mdas) { >+ mda = lvm_list_item(mdash, struct metadata_area); > mdac = (struct mda_context *) mda->metadata_locn; > if (pv->dev == mdac->area.dev && > (mdac->area.start < (pv->pe_start << SECTOR_SHIFT)) && >@@ -1068,25 +1068,25 @@ > if (!add_da > (fmt, NULL, &info->das, pv->pe_start << SECTOR_SHIFT, > UINT64_C(0))) { >- stack; >+ STACK; > return 0; > } > > if (!dev_open(pv->dev)) { >- stack; >+ STACK; > return 0; > } > >- list_iterate(mdash, &info->mdas) { >- mda = list_item(mdash, struct metadata_area); >+ lvm_list_iterate(mdash, &info->mdas) { >+ mda = lvm_list_item(mdash, struct metadata_area); > mdac = mda->metadata_locn; > memset(&buf, 0, sizeof(buf)); > mdah->size = mdac->area.size; > if (!_raw_write_mda_header(fmt, mdac->area.dev, > mdac->area.start, mdah)) { >- stack; >+ STACK; > if (!dev_close(pv->dev)) >- stack; >+ STACK; > return 0; > } > } >@@ -1094,7 +1094,7 @@ > label_write(pv->dev, label); > > if (!dev_close(pv->dev)) { >- stack; >+ STACK; > return 0; > } > >@@ -1105,7 +1105,7 @@ > const char *id, struct physical_volume *pv) > { > struct volume_group *vg; >- struct list *pvh; >+ struct lvm_list *pvh; > struct pv_list *pvl; > int consistent = 0; > >@@ -1119,8 +1119,8 @@ > log_error("Warning: Volume group %s is not consistent", > vg_name); > >- list_iterate(pvh, &vg->pvs) { >- pvl = list_item(pvh, struct pv_list); >+ lvm_list_iterate(pvh, &vg->pvs) { >+ pvl = lvm_list_item(pvh, struct pv_list); > if (id_equal(&pvl->pv->id, (const struct id *) id)) { > memcpy(pv, pvl->pv, sizeof(*pv)); > return 1; >@@ -1129,14 +1129,14 @@ > return 0; > } > >-static int _add_raw(struct list *raw_list, struct device_area *dev_area) >+static int _add_raw(struct lvm_list *raw_list, struct device_area *dev_area) > { > struct raw_list *rl; >- struct list *rlh; >+ struct lvm_list *rlh; > > /* Already present? */ >- list_iterate(rlh, raw_list) { >- rl = list_item(rlh, struct raw_list); >+ lvm_list_iterate(rlh, raw_list) { >+ rl = lvm_list_item(rlh, struct raw_list); > /* FIXME Check size/overlap consistency too */ > if (rl->dev_area.dev == dev_area->dev && > rl->dev_area.start == dev_area->start) >@@ -1148,30 +1148,30 @@ > return 0; > } > memcpy(&rl->dev_area, dev_area, sizeof(*dev_area)); >- list_add(raw_list, &rl->list); >+ lvm_list_add(raw_list, &rl->list); > > return 1; > } > > static int _pv_read(const struct format_type *fmt, const char *pv_name, >- struct physical_volume *pv, struct list *mdas) >+ struct physical_volume *pv, struct lvm_list *mdas) > { > struct label *label; > struct device *dev; > struct lvmcache_info *info; > struct metadata_area *mda, *mda_new; > struct mda_context *mdac, *mdac_new; >- struct list *mdah, *dah; >+ struct lvm_list *mdah, *dah; > struct data_area_list *da; > > if (!(dev = dev_cache_get(pv_name, fmt->cmd->filter))) { >- stack; >+ STACK; > return 0; > } > > /* FIXME Optimise out repeated reading when cache lock held */ > if (!(label_read(dev, &label))) { >- stack; >+ STACK; > return 0; > } > info = (struct lvmcache_info *) label->info; >@@ -1203,13 +1203,13 @@ > memcpy(&pv->id, &info->dev->pvid, sizeof(pv->id)); > > /* Currently only support exactly one data area */ >- if (list_size(&info->das) != 1) { >+ if (lvm_list_size(&info->das) != 1) { > log_error("Must be exactly one data area (found %d) on PV %s", >- list_size(&info->das), dev_name(dev)); >+ lvm_list_size(&info->das), dev_name(dev)); > return 0; > } >- list_iterate(dah, &info->das) { >- da = list_item(dah, struct data_area_list); >+ lvm_list_iterate(dah, &info->das) { >+ da = lvm_list_item(dah, struct data_area_list); > pv->pe_start = da->disk_locn.offset >> SECTOR_SHIFT; > } > >@@ -1217,8 +1217,8 @@ > return 1; > > /* Add copy of mdas to supplied list */ >- list_iterate(mdah, &info->mdas) { >- mda = list_item(mdah, struct metadata_area); >+ lvm_list_iterate(mdah, &info->mdas) { >+ mda = lvm_list_item(mdah, struct metadata_area); > mdac = (struct mda_context *) mda->metadata_locn; > if (!(mda_new = pool_alloc(fmt->cmd->mem, sizeof(*mda_new)))) { > log_error("metadata_area allocation failed"); >@@ -1231,7 +1231,7 @@ > memcpy(mda_new, mda, sizeof(*mda)); > memcpy(mdac_new, mdac, sizeof(*mdac)); > mda_new->metadata_locn = mdac_new; >- list_add(mdas, &mda_new->list); >+ lvm_list_add(mdas, &mda_new->list); > } > > return 1; >@@ -1242,22 +1242,22 @@ > return; > } > >-static void _free_dirs(struct list *dir_list) >+static void _free_dirs(struct lvm_list *dir_list) > { >- struct list *dl, *tmp; >+ struct lvm_list *dl, *tmp; > >- list_iterate_safe(dl, tmp, dir_list) { >- list_del(dl); >+ lvm_list_iterate_safe(dl, tmp, dir_list) { >+ lvm_list_del(dl); > dbg_free(dl); > } > } > >-static void _free_raws(struct list *raw_list) >+static void _free_raws(struct lvm_list *raw_list) > { >- struct list *rl, *tmp; >+ struct lvm_list *rl, *tmp; > >- list_iterate_safe(rl, tmp, raw_list) { >- list_del(rl); >+ lvm_list_iterate_safe(rl, tmp, raw_list) { >+ lvm_list_del(rl); > dbg_free(rl); > } > } >@@ -1300,12 +1300,12 @@ > uint64_t pe_start, uint32_t extent_count, > uint32_t extent_size, > int pvmetadatacopies, >- uint64_t pvmetadatasize, struct list *mdas, >+ uint64_t pvmetadatasize, struct lvm_list *mdas, > struct physical_volume *pv, struct volume_group *vg) > { > struct metadata_area *mda, *mda_new, *mda2; > struct mda_context *mdac, *mdac_new, *mdac2; >- struct list *pvmdas, *pvmdash, *mdash; >+ struct lvm_list *pvmdas, *pvmdash, *mdash; > struct lvmcache_info *info; > int found; > uint64_t pe_end = 0; >@@ -1320,8 +1320,8 @@ > /* Iterate through all mdas on this PV */ > if ((info = info_from_pvid(pv->dev->pvid))) { > pvmdas = &info->mdas; >- list_iterate(pvmdash, pvmdas) { >- mda = list_item(pvmdash, struct metadata_area); >+ lvm_list_iterate(pvmdash, pvmdas) { >+ mda = lvm_list_item(pvmdash, struct metadata_area); > mdac = > (struct mda_context *) mda->metadata_locn; > >@@ -1329,9 +1329,9 @@ > > /* Ensure it isn't already on list */ > found = 0; >- list_iterate(mdash, mdas) { >+ lvm_list_iterate(mdash, mdas) { > mda2 = >- list_item(mdash, >+ lvm_list_item(mdash, > struct metadata_area); > if (mda2->ops != > &_metadata_text_raw_ops) >@@ -1351,21 +1351,21 @@ > > if (!(mda_new = pool_alloc(fmt->cmd->mem, > sizeof(*mda_new)))) { >- stack; >+ STACK; > return 0; > } > > if (!(mdac_new = pool_alloc(fmt->cmd->mem, > sizeof(*mdac_new)))) > { >- stack; >+ STACK; > return 0; > } > /* FIXME multiple dev_areas inside area */ > memcpy(mda_new, mda, sizeof(*mda)); > memcpy(mdac_new, mdac, sizeof(*mdac)); > mda_new->metadata_locn = mdac_new; >- list_add(mdas, &mda_new->list); >+ lvm_list_add(mdas, &mda_new->list); > } > } > >@@ -1377,7 +1377,7 @@ > pe_end = pe_start + extent_count * extent_size - 1; > if (!_mda_setup(fmt, pe_start, pe_end, pvmetadatacopies, > pvmetadatasize, mdas, pv, vg)) { >- stack; >+ STACK; > return 0; > } > >@@ -1396,7 +1396,7 @@ > struct mda_context *mdac, *mdac_new; > struct dir_list *dl; > struct raw_list *rl; >- struct list *dlh, *dir_list, *rlh, *raw_list, *mdas, *mdash, *infoh; >+ struct lvm_list *dlh, *dir_list, *rlh, *raw_list, *mdas, *mdash, *infoh; > char path[PATH_MAX]; > struct lvmcache_vginfo *vginfo; > >@@ -1407,21 +1407,21 @@ > > fid->fmt = fmt; > >- list_init(&fid->metadata_areas); >+ lvm_list_init(&fid->metadata_areas); > > if (!vgname) { > if (!(mda = pool_alloc(fmt->cmd->mem, sizeof(*mda)))) { >- stack; >+ STACK; > return NULL; > } > mda->ops = &_metadata_text_file_backup_ops; > mda->metadata_locn = context; >- list_add(&fid->metadata_areas, &mda->list); >+ lvm_list_add(&fid->metadata_areas, &mda->list); > } else { > dir_list = &((struct mda_lists *) fmt->private)->dirs; > >- list_iterate(dlh, dir_list) { >- dl = list_item(dlh, struct dir_list); >+ lvm_list_iterate(dlh, dir_list) { >+ dl = lvm_list_item(dlh, struct dir_list); > if (lvm_snprintf(path, PATH_MAX, "%s/%s", > dl->dir, vgname) < 0) { > log_error("Name too long %s/%s", dl->dir, >@@ -1431,30 +1431,30 @@ > > context = create_text_context(fmt->cmd, path, NULL); > if (!(mda = pool_alloc(fmt->cmd->mem, sizeof(*mda)))) { >- stack; >+ STACK; > return NULL; > } > mda->ops = &_metadata_text_file_ops; > mda->metadata_locn = context; >- list_add(&fid->metadata_areas, &mda->list); >+ lvm_list_add(&fid->metadata_areas, &mda->list); > } > > raw_list = &((struct mda_lists *) fmt->private)->raws; > >- list_iterate(rlh, raw_list) { >- rl = list_item(rlh, struct raw_list); >+ lvm_list_iterate(rlh, raw_list) { >+ rl = lvm_list_item(rlh, struct raw_list); > > /* FIXME Cache this; rescan below if some missing */ > if (!_raw_holds_vgname(fid, &rl->dev_area, vgname)) > continue; > > if (!(mda = pool_alloc(fmt->cmd->mem, sizeof(*mda)))) { >- stack; >+ STACK; > return NULL; > } > > if (!(mdac = pool_alloc(fmt->cmd->mem, sizeof(*mdac)))) { >- stack; >+ STACK; > return NULL; > } > mda->metadata_locn = mdac; >@@ -1462,40 +1462,40 @@ > memcpy(&mdac->area, &rl->dev_area, sizeof(mdac->area)); > mda->ops = &_metadata_text_raw_ops; > /* FIXME MISTAKE? mda->metadata_locn = context; */ >- list_add(&fid->metadata_areas, &mda->list); >+ lvm_list_add(&fid->metadata_areas, &mda->list); > } > > /* Scan PVs in VG for any further MDAs */ > lvmcache_label_scan(fmt->cmd, 0); > if (!(vginfo = vginfo_from_vgname(vgname))) { >- stack; >+ STACK; > goto out; > } >- list_iterate(infoh, &vginfo->infos) { >- mdas = &(list_item(infoh, struct lvmcache_info)->mdas); >- list_iterate(mdash, mdas) { >- mda = list_item(mdash, struct metadata_area); >+ lvm_list_iterate(infoh, &vginfo->infos) { >+ mdas = &(lvm_list_item(infoh, struct lvmcache_info)->mdas); >+ lvm_list_iterate(mdash, mdas) { >+ mda = lvm_list_item(mdash, struct metadata_area); > mdac = > (struct mda_context *) mda->metadata_locn; > > /* FIXME Check it holds this VG */ > if (!(mda_new = pool_alloc(fmt->cmd->mem, > sizeof(*mda_new)))) { >- stack; >+ STACK; > return NULL; > } > > if (!(mdac_new = pool_alloc(fmt->cmd->mem, > sizeof(*mdac_new)))) > { >- stack; >+ STACK; > return NULL; > } > /* FIXME multiple dev_areas inside area */ > memcpy(mda_new, mda, sizeof(*mda)); > memcpy(mdac_new, mdac, sizeof(*mdac)); > mda_new->metadata_locn = mdac_new; >- list_add(&fid->metadata_areas, &mda_new->list); >+ lvm_list_add(&fid->metadata_areas, &mda_new->list); > } > } > /* FIXME Check raw metadata area count - rescan if required */ >@@ -1519,17 +1519,17 @@ > } > > if (!(tc = pool_alloc(cmd->mem, sizeof(*tc)))) { >- stack; >+ STACK; > return NULL; > } > > if (!(tc->path_live = pool_strdup(cmd->mem, path))) { >- stack; >+ STACK; > goto no_mem; > } > > if (!(tc->path_edit = pool_alloc(cmd->mem, strlen(path) + 5))) { >- stack; >+ STACK; > goto no_mem; > } > sprintf(tc->path_edit, "%s.tmp", path); >@@ -1538,7 +1538,7 @@ > desc = ""; > > if (!(tc->desc = pool_strdup(cmd->mem, desc))) { >- stack; >+ STACK; > goto no_mem; > } > >@@ -1563,18 +1563,18 @@ > destroy:_destroy > }; > >-static int _add_dir(const char *dir, struct list *dir_list) >+static int _add_dir(const char *dir, struct lvm_list *dir_list) > { > struct dir_list *dl; > > if (create_dir(dir)) { >- if (!(dl = dbg_malloc(sizeof(struct list) + strlen(dir) + 1))) { >+ if (!(dl = dbg_malloc(sizeof(struct lvm_list) + strlen(dir) + 1))) { > log_error("_add_dir allocation failed"); > return 0; > } > log_very_verbose("Adding text format metadata dir: %s", dir); > strcpy(dl->dir, dir); >- list_add(dir_list, &dl->list); >+ lvm_list_add(dir_list, &dl->list); > return 1; > } > >@@ -1582,7 +1582,7 @@ > } > > static int _get_config_disk_area(struct cmd_context *cmd, >- struct config_node *cn, struct list *raw_list) >+ struct config_node *cn, struct lvm_list *raw_list) > { > struct device_area dev_area; > char *id_str; >@@ -1641,7 +1641,7 @@ > struct mda_lists *mda_lists; > > if (!(fmt = dbg_malloc(sizeof(*fmt)))) { >- stack; >+ STACK; > return NULL; > } > >@@ -1656,8 +1656,8 @@ > return NULL; > } > >- list_init(&mda_lists->dirs); >- list_init(&mda_lists->raws); >+ lvm_list_init(&mda_lists->dirs); >+ lvm_list_init(&mda_lists->raws); > mda_lists->file_ops = &_metadata_text_file_ops; > mda_lists->raw_ops = &_metadata_text_raw_ops; > fmt->private = (void *) mda_lists; >diff -ruN LVM2.2.00.15.orig/lib/format_text/format-text.h LVM2.2.00.15/lib/format_text/format-text.h >--- LVM2.2.00.15.orig/lib/format_text/format-text.h 2004-03-30 19:35:39.000000000 +0000 >+++ LVM2.2.00.15/lib/format_text/format-text.h 2004-07-03 20:00:23.130134336 +0000 >@@ -47,13 +47,13 @@ > > int pvhdr_read(struct device *dev, char *buf); > >-int add_da(const struct format_type *fmt, struct pool *mem, struct list *das, >+int add_da(const struct format_type *fmt, struct pool *mem, struct lvm_list *das, > uint64_t start, uint64_t size); >-void del_das(struct list *das); >+void del_das(struct lvm_list *das); > >-int add_mda(const struct format_type *fmt, struct pool *mem, struct list *mdas, >+int add_mda(const struct format_type *fmt, struct pool *mem, struct lvm_list *mdas, > struct device *dev, uint64_t start, uint64_t size); >-void del_mdas(struct list *mdas); >+void del_mdas(struct lvm_list *mdas); > > int vgname_from_mda(const struct format_type *fmt, struct device_area *dev_area, > char *buf, uint32_t size); >diff -ruN LVM2.2.00.15.orig/lib/format_text/import-export.h LVM2.2.00.15/lib/format_text/import-export.h >--- LVM2.2.00.15.orig/lib/format_text/import-export.h 2004-03-30 19:35:39.000000000 +0000 >+++ LVM2.2.00.15/lib/format_text/import-export.h 2004-07-03 20:00:52.384686968 +0000 >@@ -55,8 +55,8 @@ > int print_flags(uint32_t status, int type, char *buffer, size_t size); > int read_flags(uint32_t *status, int type, struct config_value *cv); > >-int print_tags(struct list *tags, char *buffer, size_t size); >-int read_tags(struct pool *mem, struct list *tags, struct config_value *cv); >+int print_tags(struct lvm_list *tags, char *buffer, size_t size); >+int read_tags(struct pool *mem, struct lvm_list *tags, struct config_value *cv); > > int text_vg_export_file(struct volume_group *vg, const char *desc, FILE *fp); > int text_vg_export_raw(struct volume_group *vg, const char *desc, char *buf, >diff -ruN LVM2.2.00.15.orig/lib/format_text/import.c LVM2.2.00.15/lib/format_text/import.c >--- LVM2.2.00.15.orig/lib/format_text/import.c 2004-03-30 19:35:39.000000000 +0000 >+++ LVM2.2.00.15/lib/format_text/import.c 2004-07-03 18:38:05.873711400 +0000 >@@ -50,7 +50,7 @@ > *when = 0; > > if (!(cft = create_config_tree())) { >- stack; >+ STACK; > goto out; > } > >@@ -69,7 +69,7 @@ > continue; > > if (!(vg = (*vsn)->read_vg(fid, cft))) { >- stack; >+ STACK; > goto out; > } > >diff -ruN LVM2.2.00.15.orig/lib/format_text/import_vsn1.c LVM2.2.00.15/lib/format_text/import_vsn1.c >--- LVM2.2.00.15.orig/lib/format_text/import_vsn1.c 2004-03-30 19:35:39.000000000 +0000 >+++ LVM2.2.00.15/lib/format_text/import_vsn1.c 2004-07-03 20:12:59.058215800 +0000 >@@ -118,7 +118,7 @@ > > if (!(pvl = pool_zalloc(mem, sizeof(*pvl))) || > !(pvl->pv = pool_zalloc(mem, sizeof(*pvl->pv)))) { >- stack; >+ STACK; > return 0; > } > >@@ -129,7 +129,7 @@ > * the lv segments. > */ > if (!hash_insert(pv_hash, pvn->key, pv)) { >- stack; >+ STACK; > return 0; > } > >@@ -162,7 +162,7 @@ > } > > if (!(pv->vg_name = pool_strdup(mem, vg->name))) { >- stack; >+ STACK; > return 0; > } > >@@ -187,7 +187,7 @@ > return 0; > } > >- list_init(&pv->tags); >+ lvm_list_init(&pv->tags); > > /* Optional tags */ > if ((cn = find_config_node(pvn, "tags")) && >@@ -207,27 +207,27 @@ > pv->fmt = fid->fmt; > > vg->pv_count++; >- list_add(&vg->pvs, &pvl->list); >+ lvm_list_add(&vg->pvs, &pvl->list); > > return 1; > } > > static void _insert_segment(struct logical_volume *lv, struct lv_segment *seg) > { >- struct list *segh; >+ struct lvm_list *segh; > struct lv_segment *comp; > >- list_iterate(segh, &lv->segments) { >- comp = list_item(segh, struct lv_segment); >+ lvm_list_iterate(segh, &lv->segments) { >+ comp = lvm_list_item(segh, struct lv_segment); > > if (comp->le > seg->le) { >- list_add(&comp->list, &seg->list); >+ lvm_list_add(&comp->list, &seg->list); > return; > } > } > > lv->le_count += seg->len; >- list_add(&lv->segments, &seg->list); >+ lvm_list_add(&lv->segments, &seg->list); > } > > static int _read_segment(struct pool *mem, struct volume_group *vg, >@@ -358,7 +358,7 @@ > } > > if (!vg_add_snapshot(org, cow, 1, &lv->lvid.id[1], chunk_size)) { >- stack; >+ STACK; > return 0; > } > break; >@@ -476,7 +476,7 @@ > */ > if (!sn->v) { > if (!_read_segment(mem, vg, lv, sn, pv_hash)) { >- stack; >+ STACK; > return 0; > } > >@@ -504,7 +504,7 @@ > * Check there are no gaps or overlaps in the lv. > */ > if (!lv_check_segments(lv)) { >- stack; >+ STACK; > return 0; > } > >@@ -512,7 +512,7 @@ > * Merge segments in case someones been editing things by hand. > */ > if (!lv_merge_segments(lv)) { >- stack; >+ STACK; > return 0; > } > >@@ -529,14 +529,14 @@ > > if (!(lvl = pool_zalloc(mem, sizeof(*lvl))) || > !(lvl->lv = pool_zalloc(mem, sizeof(*lvl->lv)))) { >- stack; >+ STACK; > return 0; > } > > lv = lvl->lv; > > if (!(lv->name = pool_strdup(mem, lvn->key))) { >- stack; >+ STACK; > return 0; > } > >@@ -570,8 +570,8 @@ > if (!_read_int32(lvn, "read_ahead", &lv->read_ahead)) > lv->read_ahead = 0; > >- list_init(&lv->segments); >- list_init(&lv->tags); >+ lvm_list_init(&lv->segments); >+ lvm_list_init(&lv->tags); > > /* Optional tags */ > if ((cn = find_config_node(lvn, "tags")) && >@@ -583,7 +583,7 @@ > > lv->vg = vg; > vg->lv_count++; >- list_add(&vg->lvs, &lvl->list); >+ lvm_list_add(&vg->lvs, &lvl->list); > > return 1; > } >@@ -617,7 +617,7 @@ > memcpy(&lv->lvid.id[0], &lv->vg->id, sizeof(lv->lvid.id[0])); > > if (!_read_segments(mem, vg, lv, lvn, pv_hash)) { >- stack; >+ STACK; > return 0; > } > >@@ -640,7 +640,7 @@ > } > } else { > vg->lv_count--; >- list_del(&lvl->list); >+ lvm_list_del(&lvl->list); > } > > return 1; >@@ -665,7 +665,7 @@ > > for (n = n->child; n; n = n->sib) { > if (!fn(fid, mem, vg, n, vgn, pv_hash)) { >- stack; >+ STACK; > return 0; > } > } >@@ -690,7 +690,7 @@ > } > > if (!(vg = pool_zalloc(mem, sizeof(*vg)))) { >- stack; >+ STACK; > return NULL; > } > vg->cmd = fid->fmt->cmd; >@@ -700,12 +700,12 @@ > vg->fid = fid; > > if (!(vg->name = pool_strdup(mem, vgn->key))) { >- stack; >+ STACK; > goto bad; > } > > if (!(vg->system_id = pool_zalloc(mem, NAME_LEN))) { >- stack; >+ STACK; > goto bad; > } > >@@ -774,7 +774,7 @@ > goto bad; > } > >- list_init(&vg->pvs); >+ lvm_list_init(&vg->pvs); > if (!_read_sections(fid, "physical_volumes", _read_pv, mem, vg, > vgn, pv_hash, 0)) { > log_error("Couldn't find all physical volumes for volume " >@@ -782,9 +782,9 @@ > goto bad; > } > >- list_init(&vg->lvs); >- list_init(&vg->snapshots); >- list_init(&vg->tags); >+ lvm_list_init(&vg->lvs); >+ lvm_list_init(&vg->snapshots); >+ lvm_list_init(&vg->tags); > > /* Optional tags */ > if ((cn = find_config_node(vgn, "tags")) && >diff -ruN LVM2.2.00.15.orig/lib/format_text/layout.h LVM2.2.00.15/lib/format_text/layout.h >--- LVM2.2.00.15.orig/lib/format_text/layout.h 2004-03-30 19:35:39.000000000 +0000 >+++ LVM2.2.00.15/lib/format_text/layout.h 2004-07-03 20:01:31.169790736 +0000 >@@ -29,7 +29,7 @@ > > /* Data areas (holding PEs) */ > struct data_area_list { >- struct list list; >+ struct lvm_list list; > struct disk_locn disk_locn; > }; > >@@ -65,8 +65,8 @@ > } __attribute__ ((packed)); > > struct mda_lists { >- struct list dirs; >- struct list raws; >+ struct lvm_list dirs; >+ struct lvm_list raws; > struct metadata_area_ops *file_ops; > struct metadata_area_ops *raw_ops; > }; >diff -ruN LVM2.2.00.15.orig/lib/format_text/tags.c LVM2.2.00.15/lib/format_text/tags.c >--- LVM2.2.00.15.orig/lib/format_text/tags.c 2004-03-30 19:35:39.000000000 +0000 >+++ LVM2.2.00.15/lib/format_text/tags.c 2004-07-03 20:13:50.189442672 +0000 >@@ -20,40 +20,40 @@ > #include "str_list.h" > #include "lvm-string.h" > >-int print_tags(struct list *tags, char *buffer, size_t size) >+int print_tags(struct lvm_list *tags, char *buffer, size_t size) > { > struct str_list *sl; > int first = 1; > > if (!emit_to_buffer(&buffer, &size, "[")) { >- stack; >+ STACK; > return 0; > } > >- list_iterate_items(sl, tags) { >+ lvm_list_iterate_items(sl, tags) { > if (!first) { > if (!emit_to_buffer(&buffer, &size, ", ")) { >- stack; >+ STACK; > return 0; > } > } else > first = 0; > > if (!emit_to_buffer(&buffer, &size, "\"%s\"", sl->str)) { >- stack; >+ STACK; > return 0; > } > } > > if (!emit_to_buffer(&buffer, &size, "]")) { >- stack; >+ STACK; > return 0; > } > > return 1; > } > >-int read_tags(struct pool *mem, struct list *tags, struct config_value *cv) >+int read_tags(struct pool *mem, struct lvm_list *tags, struct config_value *cv) > { > if (cv->type == CFG_EMPTY_ARRAY) > return 1; >@@ -65,7 +65,7 @@ > } > > if (!str_list_add(mem, tags, pool_strdup(mem, cv->v.str))) { >- stack; >+ STACK; > return 0; > } > >diff -ruN LVM2.2.00.15.orig/lib/format_text/text_label.c LVM2.2.00.15/lib/format_text/text_label.c >--- LVM2.2.00.15.orig/lib/format_text/text_label.c 2004-03-30 19:35:39.000000000 +0000 >+++ LVM2.2.00.15/lib/format_text/text_label.c 2004-07-03 20:02:59.417375064 +0000 >@@ -38,7 +38,7 @@ > struct pv_header *pvhdr; > struct lvmcache_info *info; > struct disk_locn *pvh_dlocn_xl; >- struct list *mdash, *dash; >+ struct lvm_list *mdash, *dash; > struct metadata_area *mda; > struct mda_context *mdac; > struct data_area_list *da; >@@ -56,8 +56,8 @@ > pvh_dlocn_xl = &pvhdr->disk_areas_xl[0]; > > /* List of data areas (holding PEs) */ >- list_iterate(dash, &info->das) { >- da = list_item(dash, struct data_area_list); >+ lvm_list_iterate(dash, &info->das) { >+ da = lvm_list_item(dash, struct data_area_list); > > pvh_dlocn_xl->offset = xlate64(da->disk_locn.offset); > pvh_dlocn_xl->size = xlate64(da->disk_locn.size); >@@ -70,8 +70,8 @@ > pvh_dlocn_xl++; > > /* List of metadata area header locations */ >- list_iterate(mdash, &info->mdas) { >- mda = list_item(mdash, struct metadata_area); >+ lvm_list_iterate(mdash, &info->mdas) { >+ mda = lvm_list_item(mdash, struct metadata_area); > mdac = (struct mda_context *) mda->metadata_locn; > > if (mdac->area.dev != info->dev) >@@ -89,7 +89,7 @@ > return 1; > } > >-int add_da(const struct format_type *fmt, struct pool *mem, struct list *das, >+int add_da(const struct format_type *fmt, struct pool *mem, struct lvm_list *das, > uint64_t start, uint64_t size) > { > struct data_area_list *dal; >@@ -109,24 +109,24 @@ > dal->disk_locn.offset = start; > dal->disk_locn.size = size; > >- list_add(das, &dal->list); >+ lvm_list_add(das, &dal->list); > > return 1; > } > >-void del_das(struct list *das) >+void del_das(struct lvm_list *das) > { >- struct list *dah, *tmp; >+ struct lvm_list *dah, *tmp; > struct data_area_list *da; > >- list_iterate_safe(dah, tmp, das) { >- da = list_item(dah, struct data_area_list); >- list_del(&da->list); >+ lvm_list_iterate_safe(dah, tmp, das) { >+ da = lvm_list_item(dah, struct data_area_list); >+ lvm_list_del(&da->list); > dbg_free(da); > } > } > >-int add_mda(const struct format_type *fmt, struct pool *mem, struct list *mdas, >+int add_mda(const struct format_type *fmt, struct pool *mem, struct lvm_list *mdas, > struct device *dev, uint64_t start, uint64_t size) > { > /* FIXME List size restricted by pv_header SECTOR_SIZE */ >@@ -165,19 +165,19 @@ > mdac->area.size = size; > memset(&mdac->rlocn, 0, sizeof(mdac->rlocn)); > >- list_add(mdas, &mdal->list); >+ lvm_list_add(mdas, &mdal->list); > return 1; > } > >-void del_mdas(struct list *mdas) >+void del_mdas(struct lvm_list *mdas) > { >- struct list *mdah, *tmp; >+ struct lvm_list *mdah, *tmp; > struct metadata_area *mda; > >- list_iterate_safe(mdah, tmp, mdas) { >- mda = list_item(mdah, struct metadata_area); >+ lvm_list_iterate_safe(mdah, tmp, mdas) { >+ mda = lvm_list_item(mdah, struct metadata_area); > dbg_free(mda->metadata_locn); >- list_del(&mda->list); >+ lvm_list_del(&mda->list); > dbg_free(mda); > } > } >@@ -197,7 +197,7 @@ > struct lvmcache_info *info; > struct disk_locn *dlocn_xl; > uint64_t offset; >- struct list *mdah; >+ struct lvm_list *mdah; > struct metadata_area *mda; > char vgnamebuf[NAME_LEN + 2]; > struct mda_context *mdac; >@@ -212,11 +212,11 @@ > > if (info->das.n) > del_das(&info->das); >- list_init(&info->das); >+ lvm_list_init(&info->das); > > if (info->mdas.n) > del_mdas(&info->mdas); >- list_init(&info->mdas); >+ lvm_list_init(&info->mdas); > > /* Data areas holding the PEs */ > dlocn_xl = pvhdr->disk_areas_xl; >@@ -234,8 +234,8 @@ > dlocn_xl++; > } > >- list_iterate(mdah, &info->mdas) { >- mda = list_item(mdah, struct metadata_area); >+ lvm_list_iterate(mdah, &info->mdas) { >+ mda = lvm_list_item(mdah, struct metadata_area); > mdac = (struct mda_context *) mda->metadata_locn; > if (vgname_from_mda(info->fmt, &mdac->area, vgnamebuf, > sizeof(vgnamebuf))) { >diff -ruN LVM2.2.00.15.orig/lib/label/label.c LVM2.2.00.15/lib/label/label.c >--- LVM2.2.00.15.orig/lib/label/label.c 2004-03-30 19:35:39.000000000 +0000 >+++ LVM2.2.00.15/lib/label/label.c 2004-07-03 20:14:37.712218112 +0000 >@@ -30,13 +30,13 @@ > * Internal labeller struct. > */ > struct labeller_i { >- struct list list; >+ struct lvm_list list; > > struct labeller *l; > char name[0]; > }; > >-static struct list _labellers; >+static struct lvm_list _labellers; > > static struct labeller_i *_alloc_li(const char *name, struct labeller *l) > { >@@ -63,18 +63,18 @@ > > int label_init(void) > { >- list_init(&_labellers); >+ lvm_list_init(&_labellers); > return 1; > } > > void label_exit(void) > { >- struct list *c, *n; >+ struct lvm_list *c, *n; > struct labeller_i *li; > > for (c = _labellers.n; c != &_labellers; c = n) { > n = c->n; >- li = list_item(c, struct labeller_i); >+ li = lvm_list_item(c, struct labeller_i); > li->l->ops->destroy(li->l); > _free_li(li); > } >@@ -85,21 +85,21 @@ > struct labeller_i *li; > > if (!(li = _alloc_li(name, handler))) { >- stack; >+ STACK; > return 0; > } > >- list_add(&_labellers, &li->list); >+ lvm_list_add(&_labellers, &li->list); > return 1; > } > > struct labeller *label_get_handler(const char *name) > { >- struct list *lih; >+ struct lvm_list *lih; > struct labeller_i *li; > >- list_iterate(lih, &_labellers) { >- li = list_item(lih, struct labeller_i); >+ lvm_list_iterate(lih, &_labellers) { >+ li = lvm_list_item(lih, struct labeller_i); > if (!strcmp(li->name, name)) > return li->l; > } >@@ -110,7 +110,7 @@ > static struct labeller *_find_labeller(struct device *dev, char *buf, > uint64_t *label_sector) > { >- struct list *lih; >+ struct lvm_list *lih; > struct labeller_i *li; > struct labeller *r = NULL; > struct label_header *lh; >@@ -119,7 +119,7 @@ > char readbuf[LABEL_SCAN_SIZE]; > > if (!dev_open(dev)) { >- stack; >+ STACK; > return NULL; > } > >@@ -158,8 +158,8 @@ > continue; > } > >- list_iterate(lih, &_labellers) { >- li = list_item(lih, struct labeller_i); >+ lvm_list_iterate(lih, &_labellers) { >+ li = lvm_list_item(lih, struct labeller_i); > if (li->l->ops->can_handle(li->l, (char *) lh, sector)) { > log_very_verbose("%s: %s label detected", > dev_name(dev), li->name); >@@ -184,7 +184,7 @@ > > out: > if (!dev_close(dev)) >- stack; >+ STACK; > > return r; > } >@@ -197,7 +197,7 @@ > int r = 1; > uint64_t sector; > int wipe; >- struct list *lih; >+ struct lvm_list *lih; > struct labeller_i *li; > struct label_header *lh; > >@@ -206,7 +206,7 @@ > log_very_verbose("Scanning for labels to wipe from %s", dev_name(dev)); > > if (!dev_open(dev)) { >- stack; >+ STACK; > return 0; > } > >@@ -233,8 +233,8 @@ > if (xlate64(lh->sector_xl) == sector) > wipe = 1; > } else { >- list_iterate(lih, &_labellers) { >- li = list_item(lih, struct labeller_i); >+ lvm_list_iterate(lih, &_labellers) { >+ li = lvm_list_item(lih, struct labeller_i); > if (li->l->ops->can_handle(li->l, (char *) lh, > sector)) { > wipe = 1; >@@ -258,7 +258,7 @@ > > out: > if (!dev_close(dev)) >- stack; >+ STACK; > > return r; > } >@@ -272,7 +272,7 @@ > int r; > > if (!(l = _find_labeller(dev, buf, §or))) { >- stack; >+ STACK; > return 0; > } > >@@ -307,7 +307,7 @@ > lh->offset_xl = xlate32(sizeof(*lh)); > > if (!label->labeller->ops->write(label, buf)) { >- stack; >+ STACK; > return 0; > } > >@@ -315,7 +315,7 @@ > ((void *) &lh->offset_xl - (void *) lh))); > > if (!dev_open(dev)) { >- stack; >+ STACK; > return 0; > } > >@@ -327,7 +327,7 @@ > } > > if (!dev_close(dev)) >- stack; >+ STACK; > > return r; > } >@@ -339,7 +339,7 @@ > uint64_t sector; > > if (!(l = _find_labeller(dev, buf, §or))) { >- stack; >+ STACK; > return 0; > } > >diff -ruN LVM2.2.00.15.orig/lib/locking/external_locking.c LVM2.2.00.15/lib/locking/external_locking.c >--- LVM2.2.00.15.orig/lib/locking/external_locking.c 2004-03-30 19:35:39.000000000 +0000 >+++ LVM2.2.00.15/lib/locking/external_locking.c 2004-07-03 18:38:05.995692856 +0000 >@@ -64,7 +64,7 @@ > DEFAULT_LOCKING_LIB); > > if (!(_locking_lib = load_shared_library(cft, libname, "locking"))) { >- stack; >+ STACK; > return 0; > } > >diff -ruN LVM2.2.00.15.orig/lib/locking/file_locking.c LVM2.2.00.15/lib/locking/file_locking.c >--- LVM2.2.00.15.orig/lib/locking/file_locking.c 2004-03-30 19:35:39.000000000 +0000 >+++ LVM2.2.00.15/lib/locking/file_locking.c 2004-07-03 20:15:34.716552136 +0000 >@@ -31,12 +31,12 @@ > #include <signal.h> > > struct lock_list { >- struct list list; >+ struct lvm_list list; > int lf; > char *res; > }; > >-static struct list _lock_list; >+static struct lvm_list _lock_list; > static char _lock_dir[NAME_LEN]; > > static sig_t _oldhandler; >@@ -46,15 +46,15 @@ > static int _release_lock(const char *file, int unlock) > { > struct lock_list *ll; >- struct list *llh, *llt; >+ struct lvm_list *llh, *llt; > > struct stat buf1, buf2; > >- list_iterate_safe(llh, llt, &_lock_list) { >- ll = list_item(llh, struct lock_list); >+ lvm_list_iterate_safe(llh, llt, &_lock_list) { >+ ll = lvm_list_item(llh, struct lock_list); > > if (!file || !strcmp(ll->res, file)) { >- list_del(llh); >+ lvm_list_del(llh); > if (unlock) { > log_very_verbose("Unlocking %s", ll->res); > if (flock(ll->lf, LOCK_NB | LOCK_UN)) >@@ -189,7 +189,7 @@ > break; > } while (!(flags & LCK_NONBLOCK)); > >- list_add(&_lock_list, &ll->list); >+ lvm_list_add(&_lock_list, &ll->list); > return 1; > > err: >@@ -279,7 +279,7 @@ > if ((access(_lock_dir, R_OK | W_OK | X_OK) == -1) && (errno == EROFS)) > return 0; > >- list_init(&_lock_list); >+ lvm_list_init(&_lock_list); > > if (sigfillset(&_intsigset) || sigfillset(&_fullsigset)) { > log_sys_error("sigfillset", "init_file_locking"); >diff -ruN LVM2.2.00.15.orig/lib/locking/locking.c LVM2.2.00.15/lib/locking/locking.c >--- LVM2.2.00.15.orig/lib/locking/locking.c 2004-03-30 19:35:39.000000000 +0000 >+++ LVM2.2.00.15/lib/locking/locking.c 2004-07-03 20:16:14.562494632 +0000 >@@ -252,13 +252,13 @@ > } > > /* Unlock list of LVs */ >-int unlock_lvs(struct cmd_context *cmd, struct list *lvs) >+int unlock_lvs(struct cmd_context *cmd, struct lvm_list *lvs) > { >- struct list *lvh; >+ struct lvm_list *lvh; > struct logical_volume *lv; > >- list_iterate(lvh, lvs) { >- lv = list_item(lvh, struct lv_list)->lv; >+ lvm_list_iterate(lvh, lvs) { >+ lv = lvm_list_item(lvh, struct lv_list)->lv; > unlock_lv(cmd, lv->lvid.s); > } > >@@ -266,17 +266,17 @@ > } > > /* Lock a list of LVs */ >-int lock_lvs(struct cmd_context *cmd, struct list *lvs, int flags) >+int lock_lvs(struct cmd_context *cmd, struct lvm_list *lvs, int flags) > { >- struct list *lvh; >+ struct lvm_list *lvh; > struct logical_volume *lv; > >- list_iterate(lvh, lvs) { >- lv = list_item(lvh, struct lv_list)->lv; >+ lvm_list_iterate(lvh, lvs) { >+ lv = lvm_list_item(lvh, struct lv_list)->lv; > if (!lock_vol(cmd, lv->lvid.s, flags)) { > log_error("Failed to suspend %s", lv->name); >- list_uniterate(lvh, lvs, lvh) { >- lv = list_item(lvh, struct lv_list)->lv; >+ lvm_list_uniterate(lvh, lvs, lvh) { >+ lv = lvm_list_item(lvh, struct lv_list)->lv; > unlock_lv(cmd, lv->lvid.s); > } > >diff -ruN LVM2.2.00.15.orig/lib/locking/locking.h LVM2.2.00.15/lib/locking/locking.h >--- LVM2.2.00.15.orig/lib/locking/locking.h 2004-03-30 19:35:39.000000000 +0000 >+++ LVM2.2.00.15/lib/locking/locking.h 2004-07-03 20:16:43.974023400 +0000 >@@ -82,6 +82,6 @@ > #define unlock_vg(cmd, vol) lock_vol(cmd, vol, LCK_VG_UNLOCK) > > /* Process list of LVs */ >-int lock_lvs(struct cmd_context *cmd, struct list *lvs, int flags); >-int unlock_lvs(struct cmd_context *cmd, struct list *lvs); >+int lock_lvs(struct cmd_context *cmd, struct lvm_list *lvs, int flags); >+int unlock_lvs(struct cmd_context *cmd, struct lvm_list *lvs); > >diff -ruN LVM2.2.00.15.orig/lib/log/log.h LVM2.2.00.15/lib/log/log.h >--- LVM2.2.00.15.orig/lib/log/log.h 2004-03-30 19:35:39.000000000 +0000 >+++ LVM2.2.00.15/lib/log/log.h 2004-07-03 18:41:15.507882624 +0000 >@@ -28,7 +28,7 @@ > * In addition, messages will be logged to file or syslog if they > * are more serious than the log level specified with the log/debug_level > * parameter in the configuration file. These messages get the file >- * and line number prepended. 'stack' (without arguments) can be used >+ * and line number prepended. 'STACK' (without arguments) can be used > * to log this information at debug level. > * > * log_sys_error and log_sys_very_verbose are for errors from system calls >@@ -100,7 +100,7 @@ > #define log_err(x...) plog(_LOG_ERR, x) > #define log_fatal(x...) plog(_LOG_FATAL, x) > >-#define stack log_debug("<backtrace>") /* Backtrace on error */ >+#define STACK log_debug("<backtrace>") /* Backtrace on error */ > > #define log_error(args...) log_err(args) > #define log_print(args...) log_warn(args) >diff -ruN LVM2.2.00.15.orig/lib/metadata/lv_manip.c LVM2.2.00.15/lib/metadata/lv_manip.c >--- LVM2.2.00.15.orig/lib/metadata/lv_manip.c 2004-03-30 19:35:40.000000000 +0000 >+++ LVM2.2.00.15/lib/metadata/lv_manip.c 2004-07-03 20:23:29.702343320 +0000 >@@ -65,11 +65,11 @@ > uint32_t len = sizeof(*seg) + (num_areas * sizeof(seg->area[0])); > > if (!(seg = pool_zalloc(mem, len))) { >- stack; >+ STACK; > return NULL; > } > >- list_init(&seg->tags); >+ lvm_list_init(&seg->tags); > > return seg; > } >@@ -114,7 +114,7 @@ > consume_pv_area(pva, area_len); > } > >- list_add(&lv->segments, &seg->list); >+ lvm_list_add(&lv->segments, &seg->list); > *ix += seg->len; > return 1; > } >@@ -134,11 +134,11 @@ > } > > static int _alloc_parallel(struct logical_volume *lv, >- struct list *pvms, uint32_t allocated, >+ struct lvm_list *pvms, uint32_t allocated, > uint32_t stripes, uint32_t stripe_size) > { > int r = 0; >- struct list *pvmh; >+ struct lvm_list *pvmh; > struct pv_area **areas; > unsigned int pv_count = 0, ix; > struct pv_map *pvm; >@@ -147,7 +147,7 @@ > > area_count = stripes; > >- list_iterate(pvmh, pvms) >+ lvm_list_iterate(pvmh, pvms) > pv_count++; > > /* allocate an array of pv_areas, one candidate per pv */ >@@ -160,13 +160,13 @@ > while (allocated != lv->le_count) { > > ix = 0; >- list_iterate(pvmh, pvms) { >- pvm = list_item(pvmh, struct pv_map); >+ lvm_list_iterate(pvmh, pvms) { >+ pvm = lvm_list_item(pvmh, struct pv_map); > >- if (list_empty(&pvm->areas)) >+ if (lvm_list_empty(&pvm->areas)) > continue; > >- areas[ix++] = list_item(pvm->areas.n, struct pv_area); >+ areas[ix++] = lvm_list_item(pvm->areas.n, struct pv_area); > } > > if (ix < area_count) { >@@ -181,7 +181,7 @@ > > if (!_alloc_parallel_area(lv, area_count, stripe_size, areas, > &allocated)) { >- stack; >+ STACK; > goto out; > } > } >@@ -225,7 +225,7 @@ > seg->area[0].u.pv.pv = map->pvl->pv; > seg->area[0].u.pv.pe = pva->start; > >- list_add(&lv->segments, &seg->list); >+ lvm_list_add(&lv->segments, &seg->list); > > consume_pv_area(pva, count); > *ix += count; >@@ -266,7 +266,7 @@ > seg->area[1].type = AREA_PV; > seg->area[1].u.pv.pv = map->pvl->pv; > seg->area[1].u.pv.pe = pva->start; >- list_add(&lv->segments, &seg->list); >+ lvm_list_add(&lv->segments, &seg->list); > > consume_pv_area(pva, count); > *ix += count; >@@ -283,25 +283,25 @@ > * FIXME: subsequent lvextends may not be contiguous. > */ > static int _alloc_contiguous(struct logical_volume *lv, >- struct list *pvms, uint32_t allocated) >+ struct lvm_list *pvms, uint32_t allocated) > { >- struct list *tmp1; >+ struct lvm_list *tmp1; > struct pv_map *pvm; > struct pv_area *pva; > >- list_iterate(tmp1, pvms) { >- pvm = list_item(tmp1, struct pv_map); >+ lvm_list_iterate(tmp1, pvms) { >+ pvm = lvm_list_item(tmp1, struct pv_map); > >- if (list_empty(&pvm->areas)) >+ if (lvm_list_empty(&pvm->areas)) > continue; > > /* first item in the list is the biggest */ >- pva = list_item(pvm->areas.n, struct pv_area); >+ pva = lvm_list_item(pvm->areas.n, struct pv_area); > if (pva->count < lv->le_count) > continue; > > if (!_alloc_linear_area(lv, &allocated, pvm, pva)) { >- stack; >+ STACK; > return 0; > } > >@@ -320,24 +320,24 @@ > > /* FIXME Contiguous depends on *segment* (i.e. stripe) not LV */ > static int _alloc_mirrored(struct logical_volume *lv, >- struct list *pvms, uint32_t allocated, >+ struct lvm_list *pvms, uint32_t allocated, > struct physical_volume *mirrored_pv, > uint32_t mirrored_pe) > { >- struct list *tmp1; >+ struct lvm_list *tmp1; > struct pv_map *pvm; > struct pv_area *pva; > uint32_t max_found = 0; > > /* Try each PV in turn */ >- list_iterate(tmp1, pvms) { >- pvm = list_item(tmp1, struct pv_map); >+ lvm_list_iterate(tmp1, pvms) { >+ pvm = lvm_list_item(tmp1, struct pv_map); > >- if (list_empty(&pvm->areas)) >+ if (lvm_list_empty(&pvm->areas)) > continue; > > /* first item in the list is the biggest */ >- pva = list_item(pvm->areas.n, struct pv_area); >+ pva = lvm_list_item(pvm->areas.n, struct pv_area); > if (pva->count < lv->le_count - allocated) { > max_found = pva->count; > continue; >@@ -345,7 +345,7 @@ > > if (!_alloc_mirrored_area(lv, &allocated, pvm, pva, > mirrored_pv, mirrored_pe)) { >- stack; >+ STACK; > return 0; > } > >@@ -367,17 +367,17 @@ > * is full. > */ > static int _alloc_next_free(struct logical_volume *lv, >- struct list *pvms, uint32_t allocated) >+ struct lvm_list *pvms, uint32_t allocated) > { >- struct list *tmp1, *tmp2; >+ struct lvm_list *tmp1, *tmp2; > struct pv_map *pvm; > struct pv_area *pva; > >- list_iterate(tmp1, pvms) { >- pvm = list_item(tmp1, struct pv_map); >+ lvm_list_iterate(tmp1, pvms) { >+ pvm = lvm_list_item(tmp1, struct pv_map); > >- list_iterate(tmp2, &pvm->areas) { >- pva = list_item(tmp2, struct pv_area); >+ lvm_list_iterate(tmp2, &pvm->areas) { >+ pva = lvm_list_item(tmp2, struct pv_area); > if (!_alloc_linear_area(lv, &allocated, pvm, pva) || > (allocated == lv->le_count)) > goto done; >@@ -399,18 +399,18 @@ > * Chooses a correct allocation policy. > */ > static int _allocate(struct volume_group *vg, struct logical_volume *lv, >- struct list *allocatable_pvs, uint32_t allocated, >+ struct lvm_list *allocatable_pvs, uint32_t allocated, > uint32_t stripes, uint32_t stripe_size, > struct physical_volume *mirrored_pv, uint32_t mirrored_pe, > uint32_t status) > { > int r = 0; > struct pool *scratch; >- struct list *pvms, *old_tail = lv->segments.p, *segh; >+ struct lvm_list *pvms, *old_tail = lv->segments.p, *segh; > struct lv_segment *seg; > > if (!(scratch = pool_create(1024))) { >- stack; >+ STACK; > return 0; > } > >@@ -446,7 +446,7 @@ > * counts in pv's. > */ > for (segh = lv->segments.p; segh != old_tail; segh = segh->p) { >- seg = list_item(segh, struct lv_segment); >+ seg = lvm_list_item(segh, struct lv_segment); > _get_extents(seg); > seg->status = status; > } >@@ -466,12 +466,12 @@ > static char *_generate_lv_name(struct volume_group *vg, const char *format, > char *buffer, size_t len) > { >- struct list *lvh; >+ struct lvm_list *lvh; > struct logical_volume *lv; > int high = -1, i; > >- list_iterate(lvh, &vg->lvs) { >- lv = (list_item(lvh, struct lv_list)->lv); >+ lvm_list_iterate(lvh, &vg->lvs) { >+ lv = (lvm_list_item(lvh, struct lv_list)->lv); > > if (sscanf(lv->name, format, &i) != 1) > continue; >@@ -538,18 +538,18 @@ > lv->minor = -1; > lv->size = UINT64_C(0); > lv->le_count = 0; >- list_init(&lv->segments); >- list_init(&lv->tags); >+ lvm_list_init(&lv->segments); >+ lvm_list_init(&lv->tags); > > if (fi->fmt->ops->lv_setup && !fi->fmt->ops->lv_setup(fi, lv)) { >- stack; >+ STACK; > if (ll) > pool_free(cmd->mem, ll); > return NULL; > } > > vg->lv_count++; >- list_add(&vg->lvs, &ll->list); >+ lvm_list_add(&vg->lvs, &ll->list); > > return lv; > } >@@ -562,7 +562,7 @@ > uint32_t stripe_size, > uint32_t extents, > struct volume_group *vg, >- struct list *allocatable_pvs) >+ struct lvm_list *allocatable_pvs) > { > struct logical_volume *lv; > >@@ -578,15 +578,15 @@ > return NULL; > } > >- if (stripes > list_size(allocatable_pvs)) { >+ if (stripes > lvm_list_size(allocatable_pvs)) { > log_error("Number of stripes (%u) must not exceed " > "number of physical volumes (%d)", stripes, >- list_size(allocatable_pvs)); >+ lvm_list_size(allocatable_pvs)); > return NULL; > } > > if (!(lv = lv_create_empty(fi, name, "lvol%d", status, alloc, vg))) { >- stack; >+ STACK; > return NULL; > } > >@@ -595,12 +595,12 @@ > > if (!_allocate(vg, lv, allocatable_pvs, 0u, stripes, stripe_size, > NULL, 0u, 0u)) { >- stack; >+ STACK; > return NULL; > } > > if (fi->fmt->ops->lv_setup && !fi->fmt->ops->lv_setup(fi, lv)) { >- stack; >+ STACK; > return NULL; > } > >@@ -610,20 +610,20 @@ > int lv_reduce(struct format_instance *fi, > struct logical_volume *lv, uint32_t extents) > { >- struct list *segh; >+ struct lvm_list *segh; > struct lv_segment *seg; > uint32_t count = extents; > int striped; > > for (segh = lv->segments.p; > (segh != &lv->segments) && count; segh = segh->p) { >- seg = list_item(segh, struct lv_segment); >+ seg = lvm_list_item(segh, struct lv_segment); > > if (seg->len <= count) { > /* remove this segment completely */ > count -= seg->len; > _put_extents(seg); >- list_del(segh); >+ lvm_list_del(segh); > } else { > /* reduce this segment */ > _put_extents(seg); >@@ -648,7 +648,7 @@ > lv->vg->free_count += extents; > > if (fi->fmt->ops->lv_setup && !fi->fmt->ops->lv_setup(fi, lv)) { >- stack; >+ STACK; > return 0; > } > >@@ -658,7 +658,7 @@ > int lv_extend(struct format_instance *fi, > struct logical_volume *lv, > uint32_t stripes, uint32_t stripe_size, >- uint32_t extents, struct list *allocatable_pvs) >+ uint32_t extents, struct lvm_list *allocatable_pvs) > { > uint32_t old_le_count = lv->le_count; > uint64_t old_size = lv->size; >@@ -670,7 +670,7 @@ > stripes, stripe_size, NULL, 0u, 0u)) { > lv->le_count = old_le_count; > lv->size = old_size; >- stack; >+ STACK; > return 0; > } > >@@ -681,7 +681,7 @@ > } > > if (fi->fmt->ops->lv_setup && !fi->fmt->ops->lv_setup(fi, lv)) { >- stack; >+ STACK; > return 0; > } > >@@ -692,7 +692,7 @@ > struct logical_volume *lv, > struct physical_volume *mirrored_pv, > uint32_t mirrored_pe, >- uint32_t extents, struct list *allocatable_pvs, >+ uint32_t extents, struct lvm_list *allocatable_pvs, > uint32_t status) > { > uint32_t old_le_count = lv->le_count; >@@ -705,12 +705,12 @@ > 1, extents, mirrored_pv, mirrored_pe, status)) { > lv->le_count = old_le_count; > lv->size = old_size; >- stack; >+ STACK; > return 0; > } > > if (fid->fmt->ops->lv_setup && !fid->fmt->ops->lv_setup(fid, lv)) { >- stack; >+ STACK; > return 0; > } > >@@ -719,23 +719,23 @@ > > int lv_remove(struct volume_group *vg, struct logical_volume *lv) > { >- struct list *segh; >+ struct lvm_list *segh; > struct lv_list *lvl; > > /* find the lv list */ > if (!(lvl = find_lv_in_vg(vg, lv->name))) { >- stack; >+ STACK; > return 0; > } > > /* iterate through the lv's segments freeing off the pe's */ >- list_iterate(segh, &lv->segments) >- _put_extents(list_item(segh, struct lv_segment)); >+ lvm_list_iterate(segh, &lv->segments) >+ _put_extents(lvm_list_item(segh, struct lv_segment)); > > vg->lv_count--; > vg->free_count += lv->le_count; > >- list_del(&lvl->list); >+ lvm_list_del(&lvl->list); > > return 1; > } >@@ -744,14 +744,14 @@ > { > int lvnum_used[MAX_RESTRICTED_LVS + 1]; > uint32_t i = 0; >- struct list *lvh; >+ struct lvm_list *lvh; > struct lv_list *lvl; > int lvnum; > > memset(&lvnum_used, 0, sizeof(lvnum_used)); > >- list_iterate(lvh, &lv->vg->lvs) { >- lvl = list_item(lvh, struct lv_list); >+ lvm_list_iterate(lvh, &lv->vg->lvs) { >+ lvl = lvm_list_item(lvh, struct lv_list); > lvnum = lvnum_from_lvid(&lvl->lv->lvid); > if (lvnum <= MAX_RESTRICTED_LVS) > lvnum_used[lvnum] = 1; >diff -ruN LVM2.2.00.15.orig/lib/metadata/merge.c LVM2.2.00.15/lib/metadata/merge.c >--- LVM2.2.00.15.orig/lib/metadata/merge.c 2004-03-30 19:35:40.000000000 +0000 >+++ LVM2.2.00.15/lib/metadata/merge.c 2004-07-03 20:24:20.127677504 +0000 >@@ -76,14 +76,14 @@ > > int lv_merge_segments(struct logical_volume *lv) > { >- struct list *segh, *t; >+ struct lvm_list *segh, *t; > struct lv_segment *current, *prev = NULL; > >- list_iterate_safe(segh, t, &lv->segments) { >- current = list_item(segh, struct lv_segment); >+ lvm_list_iterate_safe(segh, t, &lv->segments) { >+ current = lvm_list_item(segh, struct lv_segment); > > if (_merge(prev, current)) >- list_del(¤t->list); >+ lvm_list_del(¤t->list); > else > prev = current; > } >@@ -100,7 +100,7 @@ > uint32_t le = 0; > unsigned seg_count = 0; > >- list_iterate_items(seg, &lv->segments) { >+ lvm_list_iterate_items(seg, &lv->segments) { > seg_count++; > if (seg->le != le) { > log_error("LV %s invalid: segment %u should begin at " >@@ -176,7 +176,7 @@ > seg->area_len = offset; > > /* Add split off segment to the list _after_ the original one */ >- list_add_h(&seg->list, &split_seg->list); >+ lvm_list_add_h(&seg->list, &split_seg->list); > > return 1; > } >@@ -199,7 +199,7 @@ > return 1; > > if (!_lv_split_segment(lv, seg, le)) { >- stack; >+ STACK; > return 0; > } > >diff -ruN LVM2.2.00.15.orig/lib/metadata/metadata.c LVM2.2.00.15/lib/metadata/metadata.c >--- LVM2.2.00.15.orig/lib/metadata/metadata.c 2004-03-30 19:35:40.000000000 +0000 >+++ LVM2.2.00.15/lib/metadata/metadata.c 2004-07-03 20:27:45.963385720 +0000 >@@ -28,7 +28,7 @@ > struct pv_list *pvl; > struct physical_volume *pv; > struct pool *mem = fid->fmt->cmd->mem; >- struct list mdas; >+ struct lvm_list mdas; > > log_verbose("Adding physical volume '%s' to volume group '%s'", > pv_name, vg->name); >@@ -38,7 +38,7 @@ > return 0; > } > >- list_init(&mdas); >+ lvm_list_init(&mdas); > if (!(pv = pv_read(fid->fmt->cmd, pv_name, &mdas, NULL))) { > log_error("%s not identified as an existing physical volume", > pv_name); >@@ -101,7 +101,7 @@ > > pvl->pv = pv; > >- list_add(&vg->pvs, &pvl->list); >+ lvm_list_add(&vg->pvs, &pvl->list); > vg->pv_count++; > vg->extent_count += pv->pe_count; > vg->free_count += pv->pe_count; >@@ -114,15 +114,15 @@ > { > struct pool *mem = cmd->mem; > struct physical_volume *pv; >- struct list *pvh; >+ struct lvm_list *pvh; > > if (!(vg->name = pool_strdup(mem, new_name))) { > log_error("vg->name allocation failed for '%s'", new_name); > return 0; > } > >- list_iterate(pvh, &vg->pvs) { >- pv = list_item(pvh, struct pv_list)->pv; >+ lvm_list_iterate(pvh, &vg->pvs) { >+ pv = lvm_list_item(pvh, struct pv_list)->pv; > if (!(pv->vg_name = pool_strdup(mem, new_name))) { > log_error("pv->vg_name allocation failed for '%s'", > dev_name(pv->dev)); >@@ -170,7 +170,7 @@ > int old_partial; > > if (!(vg = pool_zalloc(mem, sizeof(*vg)))) { >- stack; >+ STACK; > return NULL; > } > >@@ -194,7 +194,7 @@ > vg->cmd = cmd; > > if (!(vg->name = pool_strdup(mem, vg_name))) { >- stack; >+ STACK; > goto bad; > } > >@@ -212,15 +212,15 @@ > vg->max_pv = max_pv; > > vg->pv_count = 0; >- list_init(&vg->pvs); >+ lvm_list_init(&vg->pvs); > > vg->lv_count = 0; >- list_init(&vg->lvs); >+ lvm_list_init(&vg->lvs); > > vg->snapshot_count = 0; >- list_init(&vg->snapshots); >+ lvm_list_init(&vg->snapshots); > >- list_init(&vg->tags); >+ lvm_list_init(&vg->tags); > > if (!(vg->fid = cmd->fmt->ops->create_instance(cmd->fmt, vg_name, > NULL))) { >@@ -254,13 +254,13 @@ > uint32_t existing_extent_count, > uint32_t existing_extent_size, > int pvmetadatacopies, >- uint64_t pvmetadatasize, struct list *mdas) >+ uint64_t pvmetadatasize, struct lvm_list *mdas) > { > struct pool *mem = fmt->cmd->mem; > struct physical_volume *pv = pool_alloc(mem, sizeof(*pv)); > > if (!pv) { >- stack; >+ STACK; > return NULL; > } > >@@ -272,7 +272,7 @@ > pv->dev = dev; > > if (!(pv->vg_name = pool_zalloc(mem, NAME_LEN))) { >- stack; >+ STACK; > goto bad; > } > >@@ -304,7 +304,7 @@ > pv->pe_alloc_count = 0; > pv->fmt = fmt; > >- list_init(&pv->tags); >+ lvm_list_init(&pv->tags); > > if (!fmt->ops->pv_setup(fmt, pe_start, existing_extent_count, > existing_extent_size, >@@ -323,11 +323,11 @@ > > struct pv_list *find_pv_in_vg(struct volume_group *vg, const char *pv_name) > { >- struct list *pvh; >+ struct lvm_list *pvh; > struct pv_list *pvl; > >- list_iterate(pvh, &vg->pvs) { >- pvl = list_item(pvh, struct pv_list); >+ lvm_list_iterate(pvh, &vg->pvs) { >+ pvl = lvm_list_item(pvh, struct pv_list); > if (pvl->pv->dev == dev_cache_get(pv_name, vg->cmd->filter)) > return pvl; > } >@@ -337,10 +337,10 @@ > > int pv_is_in_vg(struct volume_group *vg, struct physical_volume *pv) > { >- struct list *pvh; >+ struct lvm_list *pvh; > >- list_iterate(pvh, &vg->pvs) { >- if (pv == list_item(pvh, struct pv_list)->pv) >+ lvm_list_iterate(pvh, &vg->pvs) { >+ if (pv == lvm_list_item(pvh, struct pv_list)->pv) > return 1; > } > >@@ -350,11 +350,11 @@ > struct physical_volume *find_pv_in_vg_by_uuid(struct volume_group *vg, > struct id *id) > { >- struct list *pvh; >+ struct lvm_list *pvh; > struct pv_list *pvl; > >- list_iterate(pvh, &vg->pvs) { >- pvl = list_item(pvh, struct pv_list); >+ lvm_list_iterate(pvh, &vg->pvs) { >+ pvl = lvm_list_item(pvh, struct pv_list); > if (id_equal(&pvl->pv->id, id)) > return pvl->pv; > } >@@ -364,7 +364,7 @@ > > struct lv_list *find_lv_in_vg(struct volume_group *vg, const char *lv_name) > { >- struct list *lvh; >+ struct lvm_list *lvh; > struct lv_list *lvl; > const char *ptr; > >@@ -374,8 +374,8 @@ > else > ptr = lv_name; > >- list_iterate(lvh, &vg->lvs) { >- lvl = list_item(lvh, struct lv_list); >+ lvm_list_iterate(lvh, &vg->lvs) { >+ lvl = lvm_list_item(lvh, struct lv_list); > if (!strcmp(lvl->lv->name, ptr)) > return lvl; > } >@@ -386,11 +386,11 @@ > struct lv_list *find_lv_in_vg_by_lvid(struct volume_group *vg, > const union lvid *lvid) > { >- struct list *lvh; >+ struct lvm_list *lvh; > struct lv_list *lvl; > >- list_iterate(lvh, &vg->lvs) { >- lvl = list_item(lvh, struct lv_list); >+ lvm_list_iterate(lvh, &vg->lvs) { >+ lvl = lvm_list_item(lvh, struct lv_list); > if (!strncmp(lvl->lv->lvid.s, lvid->s, sizeof(*lvid))) > return lvl; > } >@@ -406,11 +406,11 @@ > > struct physical_volume *find_pv(struct volume_group *vg, struct device *dev) > { >- struct list *pvh; >+ struct lvm_list *pvh; > struct physical_volume *pv; > >- list_iterate(pvh, &vg->pvs) { >- pv = list_item(pvh, struct pv_list)->pv; >+ lvm_list_iterate(pvh, &vg->pvs) { >+ pv = lvm_list_item(pvh, struct pv_list)->pv; > > if (dev == pv->dev) > return pv; >@@ -421,11 +421,11 @@ > /* Find segment at a given logical extent in an LV */ > struct lv_segment *find_seg_by_le(struct logical_volume *lv, uint32_t le) > { >- struct list *segh; >+ struct lvm_list *segh; > struct lv_segment *seg; > >- list_iterate(segh, &lv->segments) { >- seg = list_item(segh, struct lv_segment); >+ lvm_list_iterate(segh, &lv->segments) { >+ seg = lvm_list_item(segh, struct lv_segment); > if (le >= seg->le && le < seg->le + seg->len) > return seg; > } >@@ -435,16 +435,16 @@ > > int vg_remove(struct volume_group *vg) > { >- struct list *mdah; >+ struct lvm_list *mdah; > struct metadata_area *mda; > > /* FIXME Improve recovery situation? */ > /* Remove each copy of the metadata */ >- list_iterate(mdah, &vg->fid->metadata_areas) { >- mda = list_item(mdah, struct metadata_area); >+ lvm_list_iterate(mdah, &vg->fid->metadata_areas) { >+ mda = lvm_list_item(mdah, struct metadata_area); > if (mda->ops->vg_remove && > !mda->ops->vg_remove(vg->fid, vg, mda)) { >- stack; >+ STACK; > return 0; > } > } >@@ -458,7 +458,7 @@ > */ > int vg_write(struct volume_group *vg) > { >- struct list *mdah, *mdah2; >+ struct lvm_list *mdah, *mdah2; > struct metadata_area *mda; > > if (vg->status & PARTIAL_VG) { >@@ -467,7 +467,7 @@ > return 0; > } > >- if (list_empty(&vg->fid->metadata_areas)) { >+ if (lvm_list_empty(&vg->fid->metadata_areas)) { > log_error("Aborting vg_write: No metadata areas to write to!"); > return 0; > } >@@ -475,29 +475,29 @@ > vg->seqno++; > > /* Write to each copy of the metadata area */ >- list_iterate(mdah, &vg->fid->metadata_areas) { >- mda = list_item(mdah, struct metadata_area); >+ lvm_list_iterate(mdah, &vg->fid->metadata_areas) { >+ mda = lvm_list_item(mdah, struct metadata_area); > if (!mda->ops->vg_write) { > log_error("Format does not support writing volume" > "group metadata areas"); > /* Revert */ >- list_uniterate(mdah2, &vg->fid->metadata_areas, mdah) { >- mda = list_item(mdah2, struct metadata_area); >+ lvm_list_uniterate(mdah2, &vg->fid->metadata_areas, mdah) { >+ mda = lvm_list_item(mdah2, struct metadata_area); > if (mda->ops->vg_revert && > !mda->ops->vg_revert(vg->fid, vg, mda)) { >- stack; >+ STACK; > } > } > return 0; > } > if (!mda->ops->vg_write(vg->fid, vg, mda)) { >- stack; >+ STACK; > /* Revert */ >- list_uniterate(mdah2, &vg->fid->metadata_areas, mdah) { >- mda = list_item(mdah2, struct metadata_area); >+ lvm_list_uniterate(mdah2, &vg->fid->metadata_areas, mdah) { >+ mda = lvm_list_item(mdah2, struct metadata_area); > if (mda->ops->vg_revert && > !mda->ops->vg_revert(vg->fid, vg, mda)) { >- stack; >+ STACK; > } > } > return 0; >@@ -510,18 +510,18 @@ > /* Commit pending changes */ > int vg_commit(struct volume_group *vg) > { >- struct list *mdah; >+ struct lvm_list *mdah; > struct metadata_area *mda; > int cache_updated = 0; > int failed = 0; > > /* Commit to each copy of the metadata area */ >- list_iterate(mdah, &vg->fid->metadata_areas) { >- mda = list_item(mdah, struct metadata_area); >+ lvm_list_iterate(mdah, &vg->fid->metadata_areas) { >+ mda = lvm_list_item(mdah, struct metadata_area); > failed = 0; > if (mda->ops->vg_commit && > !mda->ops->vg_commit(vg->fid, vg, mda)) { >- stack; >+ STACK; > failed = 1; > } > /* Update cache first time we succeed */ >@@ -539,14 +539,14 @@ > /* Don't commit any pending changes */ > int vg_revert(struct volume_group *vg) > { >- struct list *mdah; >+ struct lvm_list *mdah; > struct metadata_area *mda; > >- list_iterate(mdah, &vg->fid->metadata_areas) { >- mda = list_item(mdah, struct metadata_area); >+ lvm_list_iterate(mdah, &vg->fid->metadata_areas) { >+ mda = lvm_list_item(mdah, struct metadata_area); > if (mda->ops->vg_revert && > !mda->ops->vg_revert(vg->fid, vg, mda)) { >- stack; >+ STACK; > } > } > >@@ -557,14 +557,14 @@ > static struct volume_group *_vg_read_orphans(struct cmd_context *cmd) > { > struct lvmcache_vginfo *vginfo; >- struct list *ih; >+ struct lvm_list *ih; > struct device *dev; > struct pv_list *pvl; > struct volume_group *vg; > struct physical_volume *pv; > > if (!(vginfo = vginfo_from_vgname(ORPHAN))) { >- stack; >+ STACK; > return NULL; > } > >@@ -572,18 +572,18 @@ > log_error("vg allocation failed"); > return NULL; > } >- list_init(&vg->pvs); >- list_init(&vg->lvs); >- list_init(&vg->snapshots); >- list_init(&vg->tags); >+ lvm_list_init(&vg->pvs); >+ lvm_list_init(&vg->lvs); >+ lvm_list_init(&vg->snapshots); >+ lvm_list_init(&vg->tags); > vg->cmd = cmd; > if (!(vg->name = pool_strdup(cmd->mem, ORPHAN))) { > log_error("vg name allocation failed"); > return NULL; > } > >- list_iterate(ih, &vginfo->infos) { >- dev = list_item(ih, struct lvmcache_info)->dev; >+ lvm_list_iterate(ih, &vginfo->infos) { >+ dev = lvm_list_item(ih, struct lvmcache_info)->dev; > if (!(pv = pv_read(cmd, dev_name(dev), NULL, NULL))) { > continue; > } >@@ -592,7 +592,7 @@ > return NULL; > } > pvl->pv = pv; >- list_add(&vg->pvs, &pvl->list); >+ lvm_list_add(&vg->pvs, &pvl->list); > vg->pv_count++; > } > >@@ -612,7 +612,7 @@ > struct format_instance *fid; > const struct format_type *fmt; > struct volume_group *vg, *correct_vg = NULL; >- struct list *mdah; >+ struct lvm_list *mdah; > struct metadata_area *mda; > int inconsistent = 0; > >@@ -627,12 +627,12 @@ > lvmcache_label_scan(cmd, 0); > if (!(fmt = fmt_from_vgname(vgname))) { > if (memlock()) { >- stack; >+ STACK; > return NULL; > } > lvmcache_label_scan(cmd, 1); > if (!(fmt = fmt_from_vgname(vgname))) { >- stack; >+ STACK; > return NULL; > } > } >@@ -645,8 +645,8 @@ > } > > /* Ensure contents of all metadata areas match - else do recovery */ >- list_iterate(mdah, &fid->metadata_areas) { >- mda = list_item(mdah, struct metadata_area); >+ lvm_list_iterate(mdah, &fid->metadata_areas) { >+ mda = lvm_list_item(mdah, struct metadata_area); > if (!(vg = mda->ops->vg_read(fid, vgname, mda))) { > inconsistent = 1; > continue; >@@ -665,7 +665,7 @@ > > /* Failed to find VG */ > if (!correct_vg) { >- stack; >+ STACK; > return NULL; > } > >@@ -711,7 +711,7 @@ > struct volume_group *vg_read_by_vgid(struct cmd_context *cmd, const char *vgid) > { > const char *vgname; >- struct list *vgnames, *slh; >+ struct lvm_list *vgnames, *slh; > struct volume_group *vg; > struct lvmcache_vginfo *vginfo; > int consistent = 0; >@@ -744,8 +744,8 @@ > return NULL; > } > >- list_iterate(slh, vgnames) { >- vgname = list_item(slh, struct str_list)->str; >+ lvm_list_iterate(slh, vgnames) { >+ vgname = lvm_list_item(slh, struct str_list)->str; > if (!vgname || !*vgname) > continue; // FIXME Unnecessary? > consistent = 0; >@@ -793,7 +793,7 @@ > > /* FIXME Use label functions instead of PV functions */ > struct physical_volume *pv_read(struct cmd_context *cmd, const char *pv_name, >- struct list *mdas, uint64_t *label_sector) >+ struct lvm_list *mdas, uint64_t *label_sector) > { > struct physical_volume *pv; > struct label *label; >@@ -801,7 +801,7 @@ > struct device *dev; > > if (!(dev = dev_cache_get(pv_name, cmd->filter))) { >- stack; >+ STACK; > return 0; > } > >@@ -819,7 +819,7 @@ > return 0; > } > >- list_init(&pv->tags); >+ lvm_list_init(&pv->tags); > > /* FIXME Move more common code up here */ > if (!(info->fmt->ops->pv_read(info->fmt, pv_name, pv, mdas))) { >@@ -835,17 +835,17 @@ > } > > /* May return empty list */ >-struct list *get_vgs(struct cmd_context *cmd, int full_scan) >+struct lvm_list *get_vgs(struct cmd_context *cmd, int full_scan) > { > return lvmcache_get_vgnames(cmd, full_scan); > } > >-struct list *get_pvs(struct cmd_context *cmd) >+struct lvm_list *get_pvs(struct cmd_context *cmd) > { >- struct list *results; >+ struct lvm_list *results; > const char *vgname; >- struct list *pvh, *tmp; >- struct list *vgnames, *slh; >+ struct lvm_list *pvh, *tmp; >+ struct lvm_list *vgnames, *slh; > struct volume_group *vg; > int consistent = 0; > int old_partial; >@@ -858,7 +858,7 @@ > return NULL; > } > >- list_init(results); >+ lvm_list_init(results); > > /* Get list of VGs */ > if (!(vgnames = get_vgs(cmd, 0))) { >@@ -872,13 +872,13 @@ > old_pvmove = pvmove_mode(); > init_partial(1); > init_pvmove(1); >- list_iterate(slh, vgnames) { >- vgname = list_item(slh, struct str_list)->str; >+ lvm_list_iterate(slh, vgnames) { >+ vgname = lvm_list_item(slh, struct str_list)->str; > if (!vgname) > continue; /* FIXME Unnecessary? */ > consistent = 0; > if (!(vg = vg_read(cmd, vgname, &consistent))) { >- stack; >+ STACK; > continue; > } > if (!consistent) >@@ -886,8 +886,8 @@ > vgname); > > /* Move PVs onto results list */ >- list_iterate_safe(pvh, tmp, &vg->pvs) { >- list_add(results, pvh); >+ lvm_list_iterate_safe(pvh, tmp, &vg->pvs) { >+ lvm_list_add(results, pvh); > } > } > init_pvmove(old_pvmove); >@@ -897,7 +897,7 @@ > } > > int pv_write(struct cmd_context *cmd, struct physical_volume *pv, >- struct list *mdas, int64_t label_sector) >+ struct lvm_list *mdas, int64_t label_sector) > { > if (!pv->fmt->ops->pv_write) { > log_error("Format does not support writing physical volumes"); >@@ -911,7 +911,7 @@ > } > > if (!pv->fmt->ops->pv_write(pv->fmt, pv, mdas, label_sector)) { >- stack; >+ STACK; > return 0; > } > >diff -ruN LVM2.2.00.15.orig/lib/metadata/metadata.h LVM2.2.00.15/lib/metadata/metadata.h >--- LVM2.2.00.15.orig/lib/metadata/metadata.h 2004-03-30 19:35:40.000000000 +0000 >+++ LVM2.2.00.15/lib/metadata/metadata.h 2004-07-03 20:18:27.766244584 +0000 >@@ -89,7 +89,7 @@ > struct labeller; > > struct format_type { >- struct list list; >+ struct lvm_list list; > struct cmd_context *cmd; > struct format_handler *ops; > struct labeller *labeller; >@@ -115,7 +115,7 @@ > uint32_t pe_count; > uint32_t pe_alloc_count; > >- struct list tags; >+ struct lvm_list tags; > }; > > struct metadata_area; >@@ -151,14 +151,14 @@ > }; > > struct metadata_area { >- struct list list; >+ struct lvm_list list; > struct metadata_area_ops *ops; > void *metadata_locn; > }; > > struct format_instance { > const struct format_type *fmt; >- struct list metadata_areas; /* e.g. metadata locations */ >+ struct lvm_list metadata_areas; /* e.g. metadata locations */ > }; > > struct volume_group { >@@ -181,21 +181,21 @@ > > /* physical volumes */ > uint32_t pv_count; >- struct list pvs; >+ struct lvm_list pvs; > > /* logical volumes */ > uint32_t lv_count; >- struct list lvs; >+ struct lvm_list lvs; > > /* snapshots */ > uint32_t snapshot_count; >- struct list snapshots; >+ struct lvm_list snapshots; > >- struct list tags; >+ struct lvm_list tags; > }; > > struct lv_segment { >- struct list list; >+ struct lvm_list list; > struct logical_volume *lv; > > segment_type_t type; >@@ -213,7 +213,7 @@ > uint32_t chunk_size; > uint32_t extents_moved; > >- struct list tags; >+ struct lvm_list tags; > > /* There will be one area for each stripe */ > struct { >@@ -246,8 +246,8 @@ > uint64_t size; > uint32_t le_count; > >- struct list segments; >- struct list tags; >+ struct lvm_list segments; >+ struct lvm_list tags; > }; > > struct snapshot { >@@ -261,36 +261,36 @@ > }; > > struct name_list { >- struct list list; >+ struct lvm_list list; > char *name; > }; > > struct alloc_area { >- struct list list; >+ struct lvm_list list; > uint32_t start; /* PEs */ > uint32_t count; /* PEs */ > }; > > struct pv_list { >- struct list list; >+ struct lvm_list list; > struct physical_volume *pv; >- struct list *mdas; /* Metadata areas */ >- struct list *alloc_areas; /* Areas we may allocate from */ >+ struct lvm_list *mdas; /* Metadata areas */ >+ struct lvm_list *alloc_areas; /* Areas we may allocate from */ > }; > > struct lv_list { >- struct list list; >+ struct lvm_list list; > struct logical_volume *lv; > }; > > struct snapshot_list { >- struct list list; >+ struct lvm_list list; > > struct snapshot *snapshot; > }; > > struct mda_list { >- struct list list; >+ struct lvm_list list; > struct device_area mda; > }; > >@@ -307,7 +307,7 @@ > * Return PV with given path. > */ > int (*pv_read) (const struct format_type * fmt, const char *pv_name, >- struct physical_volume * pv, struct list * mdas); >+ struct physical_volume * pv, struct lvm_list * mdas); > > /* > * Tweak an already filled out a pv ready for importing into a >@@ -317,7 +317,7 @@ > uint64_t pe_start, uint32_t extent_count, > uint32_t extent_size, > int pvmetadatacopies, >- uint64_t pvmetadatasize, struct list * mdas, >+ uint64_t pvmetadatasize, struct lvm_list * mdas, > struct physical_volume * pv, struct volume_group * vg); > > /* >@@ -325,7 +325,7 @@ > * pv->vg_name must be null. > */ > int (*pv_write) (const struct format_type * fmt, >- struct physical_volume * pv, struct list * mdas, >+ struct physical_volume * pv, struct lvm_list * mdas, > int64_t label_sector); > > /* >@@ -369,14 +369,14 @@ > int *consistent); > struct volume_group *vg_read_by_vgid(struct cmd_context *cmd, const char *vgid); > struct physical_volume *pv_read(struct cmd_context *cmd, const char *pv_name, >- struct list *mdas, uint64_t *label_sector); >-struct list *get_pvs(struct cmd_context *cmd); >+ struct lvm_list *mdas, uint64_t *label_sector); >+struct lvm_list *get_pvs(struct cmd_context *cmd); > > /* Set full_scan to 1 to re-read every (filtered) device label */ >-struct list *get_vgs(struct cmd_context *cmd, int full_scan); >+struct lvm_list *get_vgs(struct cmd_context *cmd, int full_scan); > > int pv_write(struct cmd_context *cmd, struct physical_volume *pv, >- struct list *mdas, int64_t label_sector); >+ struct lvm_list *mdas, int64_t label_sector); > > /* pe_start and pe_end relate to any existing data so that new metadata > * areas can avoid overlap */ >@@ -388,7 +388,7 @@ > uint32_t existing_extent_count, > uint32_t existing_extent_size, > int pvmetadatacopies, >- uint64_t pvmetadatasize, struct list *mdas); >+ uint64_t pvmetadatasize, struct lvm_list *mdas); > > struct volume_group *vg_create(struct cmd_context *cmd, const char *name, > uint32_t extent_size, uint32_t max_pv, >@@ -411,7 +411,7 @@ > uint32_t stripe_size, > uint32_t extents, > struct volume_group *vg, >- struct list *allocatable_pvs); >+ struct lvm_list *allocatable_pvs); > > struct logical_volume *lv_create_empty(struct format_instance *fi, > const char *name, >@@ -428,13 +428,13 @@ > struct logical_volume *lv, > uint32_t stripes, > uint32_t stripe_size, >- uint32_t extents, struct list *allocatable_pvs); >+ uint32_t extents, struct lvm_list *allocatable_pvs); > > int lv_extend_mirror(struct format_instance *fid, > struct logical_volume *lv, > struct physical_volume *mirrored_pv, > uint32_t mirrored_pe, >- uint32_t extents, struct list *allocatable_pvs, >+ uint32_t extents, struct lvm_list *allocatable_pvs, > uint32_t status); > > /* lv must be part of vg->lvs */ >@@ -502,7 +502,7 @@ > > struct snapshot *find_cow(const struct logical_volume *lv); > struct snapshot *find_origin(const struct logical_volume *lv); >-struct list *find_snapshots(const struct logical_volume *lv); >+struct lvm_list *find_snapshots(const struct logical_volume *lv); > > int vg_add_snapshot(struct logical_volume *origin, > struct logical_volume *cow, >@@ -517,8 +517,8 @@ > struct logical_volume *lv_mirr, > struct physical_volume *pv, > struct logical_volume *lv, >- struct list *allocatable_pvs, >- struct list *lvs_changed); >+ struct lvm_list *allocatable_pvs, >+ struct lvm_list *lvs_changed); > int remove_pvmove_mirrors(struct volume_group *vg, > struct logical_volume *lv_mirr); > struct logical_volume *find_pvmove_lv(struct volume_group *vg, >@@ -527,7 +527,7 @@ > struct physical_volume *get_pvmove_pv_from_lv_mirr(struct logical_volume > *lv_mirr); > float pvmove_percent(struct logical_volume *lv_mirr); >-struct list *lvs_using_lv(struct cmd_context *cmd, struct volume_group *vg, >+struct lvm_list *lvs_using_lv(struct cmd_context *cmd, struct volume_group *vg, > struct logical_volume *lv); > > uint32_t find_free_lvnum(struct logical_volume *lv); >diff -ruN LVM2.2.00.15.orig/lib/metadata/mirror.c LVM2.2.00.15/lib/metadata/mirror.c >--- LVM2.2.00.15.orig/lib/metadata/mirror.c 2004-03-30 19:35:40.000000000 +0000 >+++ LVM2.2.00.15/lib/metadata/mirror.c 2004-07-03 20:20:14.303048528 +0000 >@@ -25,17 +25,17 @@ > struct logical_volume *lv_mirr, > struct physical_volume *pv, > struct logical_volume *lv, >- struct list *allocatable_pvs, >- struct list *lvs_changed) >+ struct lvm_list *allocatable_pvs, >+ struct lvm_list *lvs_changed) > { >- struct list *segh; >+ struct lvm_list *segh; > struct lv_segment *seg; > struct lv_list *lvl; > int lv_used = 0; > uint32_t s, start_le, extent_count = 0u; > >- list_iterate(segh, &lv->segments) { >- seg = list_item(segh, struct lv_segment); >+ lvm_list_iterate(segh, &lv->segments) { >+ seg = lvm_list_item(segh, struct lv_segment); > for (s = 0; s < seg->area_count; s++) { > if (seg->area[s].type != AREA_PV || > seg->area[s].u.pv.pv->dev != pv->dev) >@@ -47,7 +47,7 @@ > return 0; > } > lvl->lv = lv; >- list_add(lvs_changed, &lvl->list); >+ lvm_list_add(lvs_changed, &lvl->list); > lv_used = 1; > } > >@@ -80,18 +80,18 @@ > int remove_pvmove_mirrors(struct volume_group *vg, > struct logical_volume *lv_mirr) > { >- struct list *lvh, *segh; >+ struct lvm_list *lvh, *segh; > struct logical_volume *lv1; > struct lv_segment *seg, *mir_seg; > uint32_t s, c; > >- list_iterate(lvh, &vg->lvs) { >- lv1 = list_item(lvh, struct lv_list)->lv; >+ lvm_list_iterate(lvh, &vg->lvs) { >+ lv1 = lvm_list_item(lvh, struct lv_list)->lv; > if (lv1 == lv_mirr) > continue; > >- list_iterate(segh, &lv1->segments) { >- seg = list_item(segh, struct lv_segment); >+ lvm_list_iterate(segh, &lv1->segments) { >+ seg = lvm_list_item(segh, struct lv_segment); > for (s = 0; s < seg->area_count; s++) { > if (seg->area[s].type != AREA_LV || > seg->area[s].u.lv.lv != lv_mirr) >@@ -136,11 +136,11 @@ > struct physical_volume *get_pvmove_pv_from_lv_mirr(struct logical_volume > *lv_mirr) > { >- struct list *segh; >+ struct lvm_list *segh; > struct lv_segment *seg; > >- list_iterate(segh, &lv_mirr->segments) { >- seg = list_item(segh, struct lv_segment); >+ lvm_list_iterate(segh, &lv_mirr->segments) { >+ seg = lvm_list_item(segh, struct lv_segment); > if (seg->type != SEG_MIRRORED) > continue; > if (seg->area[0].type != AREA_PV) >@@ -153,12 +153,12 @@ > > struct physical_volume *get_pvmove_pv_from_lv(struct logical_volume *lv) > { >- struct list *segh; >+ struct lvm_list *segh; > struct lv_segment *seg; > uint32_t s; > >- list_iterate(segh, &lv->segments) { >- seg = list_item(segh, struct lv_segment); >+ lvm_list_iterate(segh, &lv->segments) { >+ seg = lvm_list_item(segh, struct lv_segment); > for (s = 0; s < seg->area_count; s++) { > if (seg->area[s].type != AREA_LV) > continue; >@@ -172,19 +172,19 @@ > struct logical_volume *find_pvmove_lv(struct volume_group *vg, > struct device *dev) > { >- struct list *lvh, *segh; >+ struct lvm_list *lvh, *segh; > struct logical_volume *lv; > struct lv_segment *seg; > > /* Loop through all LVs */ >- list_iterate(lvh, &vg->lvs) { >- lv = list_item(lvh, struct lv_list)->lv; >+ lvm_list_iterate(lvh, &vg->lvs) { >+ lv = lvm_list_item(lvh, struct lv_list)->lv; > > if (!(lv->status & PVMOVE)) > continue; > >- list_iterate(segh, &lv->segments) { >- seg = list_item(segh, struct lv_segment); >+ lvm_list_iterate(segh, &lv->segments) { >+ seg = lvm_list_item(segh, struct lv_segment); > if (seg->area[0].type != AREA_PV) > continue; > if (seg->area[0].u.pv.pv->dev != dev) >@@ -196,10 +196,10 @@ > return NULL; > } > >-struct list *lvs_using_lv(struct cmd_context *cmd, struct volume_group *vg, >+struct lvm_list *lvs_using_lv(struct cmd_context *cmd, struct volume_group *vg, > struct logical_volume *lv) > { >- struct list *lvh, *segh, *lvs; >+ struct lvm_list *lvh, *segh, *lvs; > struct logical_volume *lv1; > struct lv_list *lvl; > struct lv_segment *seg; >@@ -210,16 +210,16 @@ > return NULL; > } > >- list_init(lvs); >+ lvm_list_init(lvs); > > /* Loop through all LVs except the one supplied */ >- list_iterate(lvh, &vg->lvs) { >- lv1 = list_item(lvh, struct lv_list)->lv; >+ lvm_list_iterate(lvh, &vg->lvs) { >+ lv1 = lvm_list_item(lvh, struct lv_list)->lv; > if (lv1 == lv) > continue; > >- list_iterate(segh, &lv1->segments) { >- seg = list_item(segh, struct lv_segment); >+ lvm_list_iterate(segh, &lv1->segments) { >+ seg = lvm_list_item(segh, struct lv_segment); > for (s = 0; s < seg->area_count; s++) { > if (seg->area[s].type != AREA_LV || > seg->area[s].u.lv.lv != lv) >@@ -229,7 +229,7 @@ > return NULL; > } > lvl->lv = lv1; >- list_add(lvs, &lvl->list); >+ lvm_list_add(lvs, &lvl->list); > goto next_lv; > } > } >@@ -243,11 +243,11 @@ > float pvmove_percent(struct logical_volume *lv_mirr) > { > uint32_t numerator = 0u, denominator = 0u; >- struct list *segh; >+ struct lvm_list *segh; > struct lv_segment *seg; > >- list_iterate(segh, &lv_mirr->segments) { >- seg = list_item(segh, struct lv_segment); >+ lvm_list_iterate(segh, &lv_mirr->segments) { >+ seg = lvm_list_item(segh, struct lv_segment); > if (!(seg->status & PVMOVE)) > continue; > >diff -ruN LVM2.2.00.15.orig/lib/metadata/pv_map.c LVM2.2.00.15/lib/metadata/pv_map.c >--- LVM2.2.00.15.orig/lib/metadata/pv_map.c 2004-03-30 19:35:40.000000000 +0000 >+++ LVM2.2.00.15/lib/metadata/pv_map.c 2004-07-03 20:29:13.786034648 +0000 >@@ -17,32 +17,32 @@ > #include "pv_map.h" > #include "hash.h" > >-static int _create_maps(struct pool *mem, struct list *pvs, struct list *maps) >+static int _create_maps(struct pool *mem, struct lvm_list *pvs, struct lvm_list *maps) > { >- struct list *tmp; >+ struct lvm_list *tmp; > struct pv_map *pvm; > struct pv_list *pvl; > >- list_iterate(tmp, pvs) { >- pvl = list_item(tmp, struct pv_list); >+ lvm_list_iterate(tmp, pvs) { >+ pvl = lvm_list_item(tmp, struct pv_list); > > if (!(pvl->pv->status & ALLOCATABLE_PV)) > continue; > > if (!(pvm = pool_zalloc(mem, sizeof(*pvm)))) { >- stack; >+ STACK; > return 0; > } > > pvm->pvl = pvl; > if (!(pvm->allocated_extents = > bitset_create(mem, pvl->pv->pe_count))) { >- stack; >+ STACK; > return 0; > } > >- list_init(&pvm->areas); >- list_add(maps, &pvm->list); >+ lvm_list_init(&pvm->areas); >+ lvm_list_add(maps, &pvm->list); > } > > return 1; >@@ -73,9 +73,9 @@ > return 1; > } > >-static int _fill_bitsets(struct volume_group *vg, struct list *maps) >+static int _fill_bitsets(struct volume_group *vg, struct lvm_list *maps) > { >- struct list *lvh, *pvmh, *segh; >+ struct lvm_list *lvh, *pvmh, *segh; > struct logical_volume *lv; > struct pv_map *pvm; > uint32_t s, pe; >@@ -89,20 +89,20 @@ > } > > /* populate the hash table */ >- list_iterate(pvmh, maps) { >- pvm = list_item(pvmh, struct pv_map); >+ lvm_list_iterate(pvmh, maps) { >+ pvm = lvm_list_item(pvmh, struct pv_map); > if (!hash_insert(hash, dev_name(pvm->pvl->pv->dev), pvm)) { >- stack; >+ STACK; > goto out; > } > } > > /* iterate through all the lv's setting bit's for used pe's */ >- list_iterate(lvh, &vg->lvs) { >- lv = list_item(lvh, struct lv_list)->lv; >+ lvm_list_iterate(lvh, &vg->lvs) { >+ lv = lvm_list_item(lvh, struct lv_list)->lv; > >- list_iterate(segh, &lv->segments) { >- seg = list_item(segh, struct lv_segment); >+ lvm_list_iterate(segh, &lv->segments) { >+ seg = lvm_list_item(segh, struct lv_segment); > > for (s = 0u; s < seg->area_count; s++) { > for (pe = 0u; pe < seg->area_len; pe++) { >@@ -112,7 +112,7 @@ > seg->area[s].u.pv.pv, > seg->area[s].u.pv.pe > + pe)) { >- stack; >+ STACK; > goto out; > } > } >@@ -129,24 +129,24 @@ > /* > * Areas are maintained in size order. > */ >-static void _insert_area(struct list *head, struct pv_area *a) >+static void _insert_area(struct lvm_list *head, struct pv_area *a) > { >- struct list *pvah; >+ struct lvm_list *pvah; > struct pv_area *pva = NULL; > >- if (list_empty(head)) { >- list_add(head, &a->list); >+ if (lvm_list_empty(head)) { >+ lvm_list_add(head, &a->list); > return; > } > >- list_iterate(pvah, head) { >- pva = list_item(pvah, struct pv_area); >+ lvm_list_iterate(pvah, head) { >+ pva = lvm_list_item(pvah, struct pv_area); > > if (pva->count < a->count) > break; > } > >- list_add_h(&pva->list, &a->list); >+ lvm_list_add_h(&pva->list, &a->list); > } > > static int _create_single_area(struct pool *mem, struct pv_map *pvm, >@@ -169,7 +169,7 @@ > e++; > > if (!(pva = pool_zalloc(mem, sizeof(*pva)))) { >- stack; >+ STACK; > return 0; > } > >@@ -196,7 +196,7 @@ > pe = start; > while (pe <= end) > if (!_create_single_area(mem, pvm, end, &pe)) { >- stack; >+ STACK; > return 0; > } > >@@ -205,16 +205,16 @@ > > static int _create_allocatable_areas(struct pool *mem, struct pv_map *pvm) > { >- struct list *alloc_areas, *aah; >+ struct lvm_list *alloc_areas, *aah; > struct alloc_area *aa; > > alloc_areas = pvm->pvl->alloc_areas; > > if (alloc_areas) { >- list_iterate(aah, alloc_areas) { >- aa = list_item(aah, struct alloc_area); >+ lvm_list_iterate(aah, alloc_areas) { >+ aa = lvm_list_item(aah, struct alloc_area); > if (!_create_areas(mem, pvm, aa->start, aa->count)) { >- stack; >+ STACK; > return 0; > } > >@@ -223,7 +223,7 @@ > /* Use whole PV */ > if (!_create_areas(mem, pvm, UINT32_C(0), > pvm->pvl->pv->pe_count)) { >- stack; >+ STACK; > return 0; > } > } >@@ -231,17 +231,17 @@ > return 1; > } > >-static int _create_all_areas(struct pool *mem, struct list *maps, >- struct list *pvs) >+static int _create_all_areas(struct pool *mem, struct lvm_list *maps, >+ struct lvm_list *pvs) > { >- struct list *tmp; >+ struct lvm_list *tmp; > struct pv_map *pvm; > >- list_iterate(tmp, maps) { >- pvm = list_item(tmp, struct pv_map); >+ lvm_list_iterate(tmp, maps) { >+ pvm = lvm_list_item(tmp, struct pv_map); > > if (!_create_allocatable_areas(mem, pvm)) { >- stack; >+ STACK; > return 0; > } > } >@@ -249,17 +249,17 @@ > return 1; > } > >-struct list *create_pv_maps(struct pool *mem, struct volume_group *vg, >- struct list *pvs) >+struct lvm_list *create_pv_maps(struct pool *mem, struct volume_group *vg, >+ struct lvm_list *pvs) > { >- struct list *maps = pool_zalloc(mem, sizeof(*maps)); >+ struct lvm_list *maps = pool_zalloc(mem, sizeof(*maps)); > > if (!maps) { >- stack; >+ STACK; > return NULL; > } > >- list_init(maps); >+ lvm_list_init(maps); > > if (!_create_maps(mem, pvs, maps)) { > log_error("Couldn't create physical volume maps in %s", >@@ -287,7 +287,7 @@ > > void consume_pv_area(struct pv_area *pva, uint32_t to_go) > { >- list_del(&pva->list); >+ lvm_list_del(&pva->list); > > assert(to_go <= pva->count); > >diff -ruN LVM2.2.00.15.orig/lib/metadata/pv_map.h LVM2.2.00.15/lib/metadata/pv_map.h >--- LVM2.2.00.15.orig/lib/metadata/pv_map.h 2004-03-30 19:35:40.000000000 +0000 >+++ LVM2.2.00.15/lib/metadata/pv_map.h 2004-07-03 20:21:29.957547296 +0000 >@@ -33,19 +33,19 @@ > uint32_t start; > uint32_t count; > >- struct list list; >+ struct lvm_list list; > }; > > struct pv_map { > struct pv_list *pvl; > bitset_t allocated_extents; >- struct list areas; >+ struct lvm_list areas; > >- struct list list; >+ struct lvm_list list; > }; > >-struct list *create_pv_maps(struct pool *mem, >- struct volume_group *vg, struct list *pvs); >+struct lvm_list *create_pv_maps(struct pool *mem, >+ struct volume_group *vg, struct lvm_list *pvs); > > void consume_pv_area(struct pv_area *area, uint32_t to_go); > >diff -ruN LVM2.2.00.15.orig/lib/metadata/snapshot_manip.c LVM2.2.00.15/lib/metadata/snapshot_manip.c >--- LVM2.2.00.15.orig/lib/metadata/snapshot_manip.c 2004-03-30 19:35:40.000000000 +0000 >+++ LVM2.2.00.15/lib/metadata/snapshot_manip.c 2004-07-03 20:30:51.335204920 +0000 >@@ -19,11 +19,11 @@ > > int lv_is_origin(const struct logical_volume *lv) > { >- struct list *slh; >+ struct lvm_list *slh; > struct snapshot *s; > >- list_iterate(slh, &lv->vg->snapshots) { >- s = list_item(slh, struct snapshot_list)->snapshot; >+ lvm_list_iterate(slh, &lv->vg->snapshots) { >+ s = lvm_list_item(slh, struct snapshot_list)->snapshot; > if (s->origin == lv) > return 1; > } >@@ -33,11 +33,11 @@ > > int lv_is_cow(const struct logical_volume *lv) > { >- struct list *slh; >+ struct lvm_list *slh; > struct snapshot *s; > >- list_iterate(slh, &lv->vg->snapshots) { >- s = list_item(slh, struct snapshot_list)->snapshot; >+ lvm_list_iterate(slh, &lv->vg->snapshots) { >+ s = lvm_list_item(slh, struct snapshot_list)->snapshot; > if (s->cow == lv) > return 1; > } >@@ -47,11 +47,11 @@ > > struct snapshot *find_origin(const struct logical_volume *lv) > { >- struct list *slh; >+ struct lvm_list *slh; > struct snapshot *s; > >- list_iterate(slh, &lv->vg->snapshots) { >- s = list_item(slh, struct snapshot_list)->snapshot; >+ lvm_list_iterate(slh, &lv->vg->snapshots) { >+ s = lvm_list_item(slh, struct snapshot_list)->snapshot; > if (s->origin == lv) > return s; > } >@@ -61,11 +61,11 @@ > > struct snapshot *find_cow(const struct logical_volume *lv) > { >- struct list *slh; >+ struct lvm_list *slh; > struct snapshot *s; > >- list_iterate(slh, &lv->vg->snapshots) { >- s = list_item(slh, struct snapshot_list)->snapshot; >+ lvm_list_iterate(slh, &lv->vg->snapshots) { >+ s = lvm_list_item(slh, struct snapshot_list)->snapshot; > if (s->cow == lv) > return s; > } >@@ -73,10 +73,10 @@ > return NULL; > } > >-struct list *find_snapshots(const struct logical_volume *lv) >+struct lvm_list *find_snapshots(const struct logical_volume *lv) > { >- struct list *slh; >- struct list *snaplist; >+ struct lvm_list *slh; >+ struct lvm_list *snaplist; > struct snapshot *s; > struct snapshot_list *newsl; > struct pool *mem = lv->vg->cmd->mem; >@@ -86,10 +86,10 @@ > return NULL; > } > >- list_init(snaplist); >+ lvm_list_init(snaplist); > >- list_iterate(slh, &lv->vg->snapshots) { >- s = list_item(slh, struct snapshot_list)->snapshot; >+ lvm_list_iterate(slh, &lv->vg->snapshots) { >+ s = lvm_list_item(slh, struct snapshot_list)->snapshot; > if (!(s->origin == lv)) > continue; > if (!(newsl = pool_alloc(mem, sizeof(*newsl)))) { >@@ -98,7 +98,7 @@ > return NULL; > } > newsl->snapshot = s; >- list_add(snaplist, &newsl->list); >+ lvm_list_add(snaplist, &newsl->list); > } > > return snaplist; >@@ -121,7 +121,7 @@ > } > > if (!(s = pool_alloc(mem, sizeof(*s)))) { >- stack; >+ STACK; > return 0; > } > >@@ -138,14 +138,14 @@ > } > > if (!(sl = pool_alloc(mem, sizeof(*sl)))) { >- stack; >+ STACK; > pool_free(mem, s); > return 0; > } > > cow->status &= ~VISIBLE_LV; > sl->snapshot = s; >- list_add(&origin->vg->snapshots, &sl->list); >+ lvm_list_add(&origin->vg->snapshots, &sl->list); > origin->vg->snapshot_count++; > > return 1; >@@ -153,14 +153,14 @@ > > int vg_remove_snapshot(struct volume_group *vg, struct logical_volume *cow) > { >- struct list *slh; >+ struct lvm_list *slh; > struct snapshot_list *sl; > >- list_iterate(slh, &vg->snapshots) { >- sl = list_item(slh, struct snapshot_list); >+ lvm_list_iterate(slh, &vg->snapshots) { >+ sl = lvm_list_item(slh, struct snapshot_list); > > if (sl->snapshot->cow == cow) { >- list_del(slh); >+ lvm_list_del(slh); > vg->snapshot_count--; > return 1; > } >diff -ruN LVM2.2.00.15.orig/lib/regex/matcher.c LVM2.2.00.15/lib/regex/matcher.c >--- LVM2.2.00.15.orig/lib/regex/matcher.c 2004-03-30 19:35:40.000000000 +0000 >+++ LVM2.2.00.15/lib/regex/matcher.c 2004-07-03 18:38:06.196662304 +0000 >@@ -179,7 +179,7 @@ > struct state_queue *r = pool_alloc(mem, sizeof(*r)); > > if (!r) { >- stack; >+ STACK; > return NULL; > } > >@@ -200,12 +200,12 @@ > bitset_t bs = bitset_create(m->scratch, m->num_nodes), dfa_bits; > > if (!tt) { >- stack; >+ STACK; > return 0; > } > > if (!bs) { >- stack; >+ STACK; > return 0; > } > >@@ -279,12 +279,12 @@ > struct matcher *m; > > if (!scratch) { >- stack; >+ STACK; > return NULL; > } > > if (!(m = pool_alloc(mem, sizeof(*m)))) { >- stack; >+ STACK; > return NULL; > } > >@@ -297,7 +297,7 @@ > ptr = all = pool_alloc(scratch, len + 1); > > if (!all) { >- stack; >+ STACK; > goto bad; > } > >@@ -319,7 +319,7 @@ > m->nodes = pool_alloc(scratch, sizeof(*m->nodes) * m->num_nodes); > > if (!m->nodes) { >- stack; >+ STACK; > goto bad; > } > >diff -ruN LVM2.2.00.15.orig/lib/regex/parse_rx.c LVM2.2.00.15/lib/regex/parse_rx.c >--- LVM2.2.00.15.orig/lib/regex/parse_rx.c 2004-03-30 19:35:40.000000000 +0000 >+++ LVM2.2.00.15/lib/regex/parse_rx.c 2004-07-03 18:38:06.226657744 +0000 >@@ -226,7 +226,7 @@ > switch (ps->type) { > case 0: > if (!(n = _node(ps->mem, CHARSET, NULL, NULL))) { >- stack; >+ STACK; > return NULL; > } > >@@ -277,7 +277,7 @@ > } > > if (!n) { >- stack; >+ STACK; > return NULL; > } > >@@ -302,7 +302,7 @@ > return l; > > if (!(n = _node(ps->mem, CAT, l, r))) >- stack; >+ STACK; > > return n; > } >@@ -325,7 +325,7 @@ > } > > if (!(n = _node(ps->mem, OR, l, r))) >- stack; >+ STACK; > > return n; > } >@@ -337,7 +337,7 @@ > struct parse_sp *ps = pool_zalloc(mem, sizeof(*ps)); > > if (!ps) { >- stack; >+ STACK; > return NULL; > } > >diff -ruN LVM2.2.00.15.orig/lib/regex/ttree.c LVM2.2.00.15/lib/regex/ttree.c >--- LVM2.2.00.15.orig/lib/regex/ttree.c 2004-03-30 19:35:40.000000000 +0000 >+++ LVM2.2.00.15/lib/regex/ttree.c 2004-07-03 18:38:06.253653640 +0000 >@@ -88,7 +88,7 @@ > > while (count--) { > if (!(*c = _node(tt->mem, k))) { >- stack; >+ STACK; > return 0; > } > >@@ -108,7 +108,7 @@ > struct ttree *tt; > > if (!(tt = pool_zalloc(mem, sizeof(*tt)))) { >- stack; >+ STACK; > return NULL; > } > >diff -ruN LVM2.2.00.15.orig/lib/report/report.c LVM2.2.00.15/lib/report/report.c >--- LVM2.2.00.15.orig/lib/report/report.c 2004-03-30 19:35:40.000000000 +0000 >+++ LVM2.2.00.15/lib/report/report.c 2004-07-03 21:05:23.538182184 +0000 >@@ -53,10 +53,10 @@ > uint32_t keys_count; > > /* Ordered list of fields needed for this report */ >- struct list field_props; >+ struct lvm_list field_props; > > /* Rows of report data */ >- struct list rows; >+ struct lvm_list rows; > }; > > /* >@@ -72,7 +72,7 @@ > #define FLD_DESCENDING 0x00000080 > > struct field_properties { >- struct list list; >+ struct lvm_list list; > uint32_t field_num; > uint32_t sort_posn; > int width; >@@ -83,7 +83,7 @@ > * Report data > */ > struct field { >- struct list list; >+ struct lvm_list list; > struct field_properties *props; > > const char *report_string; /* Formatted ready for display */ >@@ -91,9 +91,9 @@ > }; > > struct row { >- struct list list; >+ struct lvm_list list; > struct report_handle *rh; >- struct list fields; /* Fields in display order */ >+ struct lvm_list fields; /* Fields in display order */ > struct field *(*sort_fields)[]; /* Fields in sort order */ > }; > >@@ -126,7 +126,7 @@ > static int _tags_disp(struct report_handle *rh, struct field *field, > const void *data) > { >- const struct list *tags = (const struct list *) data; >+ const struct lvm_list *tags = (const struct lvm_list *) data; > struct str_list *sl; > > if (!pool_begin_object(rh->mem, 256)) { >@@ -134,7 +134,7 @@ > return 0; > } > >- list_iterate_items(sl, tags) { >+ lvm_list_iterate_items(sl, tags) { > if (!pool_grow_object(rh->mem, sl->str, strlen(sl->str)) || > (sl->list.n != tags && !pool_grow_object(rh->mem, ",", 1))) { > log_error("pool_grow_object failed"); >@@ -355,11 +355,11 @@ > { > const struct logical_volume *lv = (const struct logical_volume *) data; > const char *name; >- struct list *segh; >+ struct lvm_list *segh; > struct lv_segment *seg; > >- list_iterate(segh, &lv->segments) { >- seg = list_item(segh, struct lv_segment); >+ lvm_list_iterate(segh, &lv->segments) { >+ seg = lvm_list_item(segh, struct lv_segment); > if (!(seg->status & PVMOVE)) > continue; > name = dev_name(seg->area[0].u.pv.pv->dev); >@@ -380,7 +380,7 @@ > uint64_t *sortval; > > if (!*(disp = display_size(rh->cmd, (uint64_t) size / 2, SIZE_UNIT))) { >- stack; >+ STACK; > return 0; > } > >@@ -408,7 +408,7 @@ > uint64_t *sortval; > > if (!*(disp = display_size(rh->cmd, size / 2, SIZE_UNIT))) { >- stack; >+ STACK; > return 0; > } > >@@ -528,7 +528,7 @@ > } > > if (!id_write_format((const struct id *) data, repstr, 40)) { >- stack; >+ STACK; > return 0; > } > >@@ -602,7 +602,7 @@ > const struct logical_volume *lv = (const struct logical_volume *) data; > uint32_t count; > >- count = list_size(&lv->segments); >+ count = lvm_list_size(&lv->segments); > > return _uint32_disp(rh, field, &count); > } >@@ -753,7 +753,7 @@ > && !strncmp(field, "snap_percent", len)) > fp->flags |= FLD_HIDDEN; > >- list_add(&rh->field_props, &fp->list); >+ lvm_list_add(&rh->field_props, &fp->list); > return 1; > } > } >@@ -764,11 +764,11 @@ > static int _add_sort_key(struct report_handle *rh, uint32_t field_num, > uint32_t flags) > { >- struct list *fh; >+ struct lvm_list *fh; > struct field_properties *fp, *found = NULL; > >- list_iterate(fh, &rh->field_props) { >- fp = list_item(fh, struct field_properties); >+ lvm_list_iterate(fh, &rh->field_props) { >+ fp = lvm_list_item(fh, struct field_properties); > > if (fp->field_num == field_num) { > found = fp; >@@ -788,7 +788,7 @@ > found->width = _fields[field_num].width; > found->flags = _fields[field_num].flags | FLD_HIDDEN; > >- list_add(&rh->field_props, &found->list); >+ lvm_list_add(&rh->field_props, &found->list); > } > > if (found->flags & FLD_SORT_KEY) { >@@ -910,8 +910,8 @@ > if (headings) > rh->flags |= RH_HEADINGS; > >- list_init(&rh->field_props); >- list_init(&rh->rows); >+ lvm_list_init(&rh->field_props); >+ lvm_list_init(&rh->rows); > > switch (rh->type) { > case PVS: >@@ -978,7 +978,7 @@ > struct lv_segment *seg) > { > struct report_handle *rh = handle; >- struct list *fh; >+ struct lvm_list *fh; > struct field_properties *fp; > struct row *row; > struct field *field; >@@ -1003,12 +1003,12 @@ > return 0; > } > >- list_init(&row->fields); >- list_add(&rh->rows, &row->list); >+ lvm_list_init(&row->fields); >+ lvm_list_add(&rh->rows, &row->list); > > /* For each field to be displayed, call its report_fn */ >- list_iterate(fh, &rh->field_props) { >- fp = list_item(fh, struct field_properties); >+ lvm_list_iterate(fh, &rh->field_props) { >+ fp = lvm_list_item(fh, struct field_properties); > > if (!(field = pool_zalloc(rh->mem, sizeof(*field)))) { > log_error("struct field allocation failed"); >@@ -1043,7 +1043,7 @@ > (field->props->flags & FLD_SORT_KEY)) { > (*row->sort_fields)[field->props->sort_posn] = field; > } >- list_add(&row->fields, &field->list); >+ lvm_list_add(&row->fields, &field->list); > } > > if (!(rh->flags & RH_BUFFERED)) >@@ -1058,7 +1058,7 @@ > static int _report_headings(void *handle) > { > struct report_handle *rh = handle; >- struct list *fh; >+ struct lvm_list *fh; > struct field_properties *fp; > > if (rh->flags & RH_HEADINGS_PRINTED) >@@ -1068,8 +1068,8 @@ > goto out; > > /* First heading line */ >- list_iterate(fh, &rh->field_props) { >- fp = list_item(fh, struct field_properties); >+ lvm_list_iterate(fh, &rh->field_props) { >+ fp = lvm_list_item(fh, struct field_properties); > if (fp->flags & FLD_HIDDEN) > continue; > if (rh->flags & RH_ALIGNED) >@@ -1077,7 +1077,7 @@ > _fields[fp->field_num].heading); > else > printf("%s", _fields[fp->field_num].heading); >- if (!list_end(&rh->field_props, fh)) >+ if (!lvm_list_end(&rh->field_props, fh)) > printf("%s", rh->separator); > } > printf("\n"); >@@ -1137,26 +1137,26 @@ > static int _sort_rows(struct report_handle *rh) > { > struct row *(*rows)[]; >- struct list *rowh; >+ struct lvm_list *rowh; > uint32_t count = 0; > struct row *row; > > if (!(rows = pool_alloc(rh->mem, sizeof(**rows) * >- list_size(&rh->rows)))) { >+ lvm_list_size(&rh->rows)))) { > log_error("sort array allocation failed"); > return 0; > } > >- list_iterate(rowh, &rh->rows) { >- row = list_item(rowh, struct row); >+ lvm_list_iterate(rowh, &rh->rows) { >+ row = lvm_list_item(rowh, struct row); > (*rows)[count++] = row; > } > > qsort(rows, count, sizeof(**rows), _row_compare); > >- list_init(&rh->rows); >+ lvm_list_init(&rh->rows); > while (count--) >- list_add_h(&rh->rows, &(*rows)[count]->list); >+ lvm_list_add_h(&rh->rows, &(*rows)[count]->list); > > return 1; > } >@@ -1167,11 +1167,11 @@ > int report_output(void *handle) > { > struct report_handle *rh = handle; >- struct list *fh, *rowh, *ftmp, *rtmp; >+ struct lvm_list *fh, *rowh, *ftmp, *rtmp; > struct row *row = NULL; > struct field *field; > >- if (list_empty(&rh->rows)) >+ if (lvm_list_empty(&rh->rows)) > return 1; > > /* Sort rows */ >@@ -1183,10 +1183,10 @@ > _report_headings(rh); > > /* Print and clear buffer */ >- list_iterate_safe(rowh, rtmp, &rh->rows) { >- row = list_item(rowh, struct row); >- list_iterate_safe(fh, ftmp, &row->fields) { >- field = list_item(fh, struct field); >+ lvm_list_iterate_safe(rowh, rtmp, &rh->rows) { >+ row = lvm_list_item(rowh, struct row); >+ lvm_list_iterate_safe(fh, ftmp, &row->fields) { >+ field = lvm_list_item(fh, struct field); > if (field->props->flags & FLD_HIDDEN) > continue; > if (!(rh->flags & RH_ALIGNED)) >@@ -1199,12 +1199,12 @@ > printf("%*.*s", field->props->width, > field->props->width, > field->report_string); >- if (!list_end(&row->fields, fh)) >+ if (!lvm_list_end(&row->fields, fh)) > printf("%s", rh->separator); >- list_del(&field->list); >+ lvm_list_del(&field->list); > } > printf("\n"); >- list_del(&row->list); >+ lvm_list_del(&row->list); > } > > if (row) >diff -ruN LVM2.2.00.15.orig/test/device/dev_cache_t.c LVM2.2.00.15/test/device/dev_cache_t.c >--- LVM2.2.00.15.orig/test/device/dev_cache_t.c 2004-03-30 19:35:41.000000000 +0000 >+++ LVM2.2.00.15/test/device/dev_cache_t.c 2004-07-03 20:36:03.277782440 +0000 >@@ -24,7 +24,7 @@ > int i; > struct device *dev; > struct dev_iter *iter; >- struct list_head *tmp; >+ struct lvm_list_head *tmp; > struct str_list *sl; > > if (argc < 2) { >@@ -55,8 +55,8 @@ > while ((dev = dev_iter_get(iter))) { > printf("%s", dev->name); > >- list_for_each(tmp, &dev->aliases) { >- sl = list_entry(tmp, struct str_list, list); >+ lvm_list_for_each(tmp, &dev->aliases) { >+ sl = lvm_list_entry(tmp, struct str_list, list); > printf(", %s", sl->str); > } > printf("\n"); >diff -ruN LVM2.2.00.15.orig/test/format1/get_pvs_t.c LVM2.2.00.15/test/format1/get_pvs_t.c >--- LVM2.2.00.15.orig/test/format1/get_pvs_t.c 2004-03-30 19:35:41.000000000 +0000 >+++ LVM2.2.00.15/test/format1/get_pvs_t.c 2004-07-03 20:36:36.285764464 +0000 >@@ -25,7 +25,7 @@ > int main(int argc, char **argv) > { > struct io_space *ios; >- struct list_head *pvs, *tmp; >+ struct lvm_list_head *pvs, *tmp; > struct pool *mem; > > init_log(stderr); >@@ -60,8 +60,8 @@ > exit(1); > } > >- list_for_each(tmp, pvs) { >- struct pv_list *pvl = list_entry(tmp, struct pv_list, list); >+ lvm_list_for_each(tmp, pvs) { >+ struct pv_list *pvl = lvm_list_entry(tmp, struct pv_list, list); > dump_pv(&pvl->pv, stdout); > } > >diff -ruN LVM2.2.00.15.orig/test/format1/get_vgs_t.c LVM2.2.00.15/test/format1/get_vgs_t.c >--- LVM2.2.00.15.orig/test/format1/get_vgs_t.c 2004-03-30 19:35:41.000000000 +0000 >+++ LVM2.2.00.15/test/format1/get_vgs_t.c 2004-07-03 20:37:10.336587952 +0000 >@@ -25,7 +25,7 @@ > int main(int argc, char **argv) > { > struct io_space *ios; >- struct list_head *vgs; >+ struct lvm_list_head *vgs; > struct pool *mem; > > init_log(stderr); >diff -ruN LVM2.2.00.15.orig/test/format1/pretty_print.c LVM2.2.00.15/test/format1/pretty_print.c >--- LVM2.2.00.15.orig/test/format1/pretty_print.c 2004-03-30 19:35:41.000000000 +0000 >+++ LVM2.2.00.15/test/format1/pretty_print.c 2004-07-03 20:38:02.423669512 +0000 >@@ -50,7 +50,7 @@ > > void dump_vg(struct volume_group *vg, FILE *fp) > { >- struct list_head *tmp; >+ struct lvm_list_head *tmp; > > fprintf(fp, "volume_group {\n"); > fprintf(fp, "\tname = '%s'\n", vg->name); >@@ -63,24 +63,24 @@ > fprintf(fp, "\tlv_count = %d\n", vg->lv_count); > fprintf(fp, "}\n\n"); > >- list_for_each(tmp, &vg->pvs) { >- struct pv_list *pvl = list_entry(tmp, struct pv_list, list); >+ lvm_list_for_each(tmp, &vg->pvs) { >+ struct pv_list *pvl = lvm_list_entry(tmp, struct pv_list, list); > dump_pv(&pvl->pv, fp); > } > >- list_for_each(tmp, &vg->lvs) { >- struct lv_list *lvl = list_entry(tmp, struct lv_list, list); >+ lvm_list_for_each(tmp, &vg->lvs) { >+ struct lv_list *lvl = lvm_list_entry(tmp, struct lv_list, list); > dump_lv(&lvl->lv, fp); > } > } > >-void dump_vg_names(struct list_head *vg_names, FILE *fp) >+void dump_vg_names(struct lvm_list_head *vg_names, FILE *fp) > { >- struct list_head *tmp; >+ struct lvm_list_head *tmp; > struct name_list *nl; > >- list_for_each(tmp, vg_names) { >- nl = list_entry(tmp, struct name_list, list); >+ lvm_list_for_each(tmp, vg_names) { >+ nl = lvm_list_entry(tmp, struct name_list, list); > fprintf(fp, "%s\n", nl->name); > } > } >diff -ruN LVM2.2.00.15.orig/tools/archiver.c LVM2.2.00.15/tools/archiver.c >--- LVM2.2.00.15.orig/tools/archiver.c 2004-03-30 19:35:42.000000000 +0000 >+++ LVM2.2.00.15/tools/archiver.c 2004-07-03 20:45:25.849258576 +0000 >@@ -68,14 +68,14 @@ > char *buffer; > > if (!(buffer = pool_zalloc(mem, strlen(line) + 32))) { >- stack; >+ STACK; > return NULL; > } > > if (snprintf(buffer, len, > "Created %s executing '%s'", > before ? "*before*" : "*after*", line) < 0) { >- stack; >+ STACK; > return NULL; > } > >@@ -87,7 +87,7 @@ > char *desc; > > if (!(desc = _build_desc(vg->cmd->mem, vg->cmd->cmd_line, 1))) { >- stack; >+ STACK; > return 0; > } > >@@ -163,7 +163,7 @@ > char *desc; > > if (!(desc = _build_desc(vg->cmd->mem, vg->cmd->cmd_line, 0))) { >- stack; >+ STACK; > return 0; > } > >@@ -233,9 +233,9 @@ > return NULL; > } > >- list_iterate_items(mda, &tf->metadata_areas) { >+ lvm_list_iterate_items(mda, &tf->metadata_areas) { > if (!(vg = mda->ops->vg_read(tf, vg_name, mda))) >- stack; >+ STACK; > break; > } > >@@ -263,7 +263,7 @@ > } > > /* Add any metadata areas on the PVs */ >- list_iterate_items(pvl, &vg->pvs) { >+ lvm_list_iterate_items(pvl, &vg->pvs) { > pv = pvl->pv; > if (!(info = info_from_pvid(pv->dev->pvid))) { > log_error("PV %s missing from cache", >@@ -285,7 +285,7 @@ > } > > if (!vg_write(vg) || !vg_commit(vg)) { >- stack; >+ STACK; > return 0; > } > >@@ -302,7 +302,7 @@ > * Read in the volume group from the text file. > */ > if (!(vg = backup_read_vg(cmd, vg_name, file))) { >- stack; >+ STACK; > return 0; > } > >@@ -340,14 +340,14 @@ > } > > /* Write and commit the metadata area */ >- list_iterate_items(mda, &tf->metadata_areas) { >+ lvm_list_iterate_items(mda, &tf->metadata_areas) { > if (!(r = mda->ops->vg_write(tf, vg, mda))) { >- stack; >+ STACK; > continue; > } > if (mda->ops->vg_commit && > !(r = mda->ops->vg_commit(tf, vg, mda))) { >- stack; >+ STACK; > } > } > >diff -ruN LVM2.2.00.15.orig/tools/lvchange.c LVM2.2.00.15/tools/lvchange.c >--- LVM2.2.00.15.orig/tools/lvchange.c 2004-03-30 19:35:42.000000000 +0000 >+++ LVM2.2.00.15/tools/lvchange.c 2004-07-03 18:39:41.748136272 +0000 >@@ -46,7 +46,7 @@ > > log_very_verbose("Updating logical volume \"%s\" on disk(s)", lv->name); > if (!vg_write(lv->vg)) { >- stack; >+ STACK; > return 0; > } > >@@ -150,7 +150,7 @@ > > log_very_verbose("Updating logical volume \"%s\" on disk(s)", lv->name); > if (!vg_write(lv->vg)) { >- stack; >+ STACK; > return 0; > } > >@@ -158,7 +158,7 @@ > > /* No need to suspend LV for this change */ > if (!vg_commit(lv->vg)) { >- stack; >+ STACK; > return 0; > } > >@@ -193,7 +193,7 @@ > > log_very_verbose("Updating logical volume \"%s\" on disk(s)", lv->name); > if (!vg_write(lv->vg)) { >- stack; >+ STACK; > return 0; > } > >@@ -270,7 +270,7 @@ > > log_very_verbose("Updating logical volume \"%s\" on disk(s)", lv->name); > if (!vg_write(lv->vg)) { >- stack; >+ STACK; > return 0; > } > >@@ -328,7 +328,7 @@ > > log_very_verbose("Updating logical volume \"%s\" on disk(s)", lv->name); > if (!vg_write(lv->vg)) { >- stack; >+ STACK; > return 0; > } > >@@ -336,7 +336,7 @@ > > /* No need to suspend LV for this change */ > if (!vg_commit(lv->vg)) { >- stack; >+ STACK; > return 0; > } > >diff -ruN LVM2.2.00.15.orig/tools/lvcreate.c LVM2.2.00.15/tools/lvcreate.c >--- LVM2.2.00.15.orig/tools/lvcreate.c 2004-03-30 19:35:42.000000000 +0000 >+++ LVM2.2.00.15/tools/lvcreate.c 2004-07-03 20:46:15.946642616 +0000 >@@ -368,7 +368,7 @@ > alloc_policy_t alloc = ALLOC_DEFAULT; > struct volume_group *vg; > struct logical_volume *lv, *org = NULL; >- struct list *pvh; >+ struct lvm_list *pvh; > const char *tag; > int consistent = 1; > >@@ -407,7 +407,7 @@ > if (lp->pv_count) { > if (!(pvh = create_pv_list(cmd->mem, vg, > lp->pv_count, lp->pvs))) { >- stack; >+ STACK; > return 0; > } > } else >@@ -507,14 +507,14 @@ > > /* store vg on disk(s) */ > if (!vg_write(vg)) { >- stack; >+ STACK; > return 0; > } > > backup(vg); > > if (!vg_commit(vg)) { >- stack; >+ STACK; > return 0; > } > >@@ -598,7 +598,7 @@ > } > > if (!_lvcreate(cmd, &lp)) { >- stack; >+ STACK; > goto out; > } > >diff -ruN LVM2.2.00.15.orig/tools/lvmcmdline.c LVM2.2.00.15/tools/lvmcmdline.c >--- LVM2.2.00.15.orig/tools/lvmcmdline.c 2004-04-08 15:23:23.000000000 +0000 >+++ LVM2.2.00.15/tools/lvmcmdline.c 2004-07-03 20:47:14.388758064 +0000 >@@ -91,7 +91,7 @@ > > format = a->value; > >- list_iterate_items(fmt, &cmd->formats) { >+ lvm_list_iterate_items(fmt, &cmd->formats) { > if (!strcasecmp(fmt->name, format) || > !strcasecmp(fmt->name + 3, format) || > (fmt->alias && !strcasecmp(fmt->alias, format))) { >@@ -911,7 +911,7 @@ > struct cmd_context *cmd; > > if (!(cmd = create_toolcontext(&the_args[0]))) { >- stack; >+ STACK; > return NULL; > } > >diff -ruN LVM2.2.00.15.orig/tools/lvremove.c LVM2.2.00.15/tools/lvremove.c >--- LVM2.2.00.15.orig/tools/lvremove.c 2004-03-30 19:35:42.000000000 +0000 >+++ LVM2.2.00.15/tools/lvremove.c 2004-07-03 18:39:41.854120160 +0000 >@@ -71,7 +71,7 @@ > if (lv_is_cow(lv)) { > log_verbose("Removing snapshot %s", lv->name); > if (!vg_remove_snapshot(lv->vg, lv)) { >- stack; >+ STACK; > return ECMD_FAILED; > } > } >diff -ruN LVM2.2.00.15.orig/tools/lvrename.c LVM2.2.00.15/tools/lvrename.c >--- LVM2.2.00.15.orig/tools/lvrename.c 2004-03-30 19:35:42.000000000 +0000 >+++ LVM2.2.00.15/tools/lvrename.c 2004-07-03 18:39:41.884115600 +0000 >@@ -143,7 +143,7 @@ > } > > if (!archive(lv->vg)) { >- stack; >+ STACK; > goto error; > } > >@@ -154,7 +154,7 @@ > > log_verbose("Writing out updated volume group"); > if (!vg_write(vg)) { >- stack; >+ STACK; > goto error; > } > >@@ -162,12 +162,12 @@ > > if (!lock_vol(cmd, lv->lvid.s, LCK_LV_SUSPEND | LCK_HOLD | > LCK_NONBLOCK)) { >- stack; >+ STACK; > goto error; > } > > if (!vg_commit(vg)) { >- stack; >+ STACK; > unlock_lv(cmd, lv->lvid.s); > goto error; > } >diff -ruN LVM2.2.00.15.orig/tools/lvresize.c LVM2.2.00.15/tools/lvresize.c >--- LVM2.2.00.15.orig/tools/lvresize.c 2004-03-30 19:35:42.000000000 +0000 >+++ LVM2.2.00.15/tools/lvresize.c 2004-07-03 20:47:51.509114912 +0000 >@@ -32,7 +32,7 @@ > const char *vg_name; > char *st, *lock_lvid; > const char *cmd_name; >- struct list *pvh; >+ struct lvm_list *pvh; > struct lv_list *lvl; > int opt = 0; > int consistent = 1; >@@ -195,7 +195,7 @@ > > /* If extending, find stripes, stripesize & size of last segment */ > if (extents > lv->le_count && !(stripes == 1 || (stripes > 1 && ssize))) { >- list_iterate_items(seg, &lv->segments) { >+ lvm_list_iterate_items(seg, &lv->segments) { > if (seg->type != SEG_STRIPED) > continue; > >@@ -240,7 +240,7 @@ > log_error("Ignoring stripes and stripesize arguments " > "when reducing"); > >- list_iterate_items(seg, &lv->segments) { >+ lvm_list_iterate_items(seg, &lv->segments) { > seg_extents = seg->len; > > if (seg->type == SEG_STRIPED) { >@@ -343,7 +343,7 @@ > if (resize == LV_EXTEND) { > if (!(pvh = argc ? create_pv_list(cmd->mem, vg, argc - opt, > argv + opt) : &vg->pvs)) { >- stack; >+ STACK; > goto error; > } > >@@ -362,7 +362,7 @@ > > /* store vg on disk(s) */ > if (!vg_write(vg)) { >- stack; >+ STACK; > goto error; > } > >@@ -381,7 +381,7 @@ > } > > if (!vg_commit(vg)) { >- stack; >+ STACK; > unlock_lv(cmd, lock_lvid); > goto error; > } >diff -ruN LVM2.2.00.15.orig/tools/pvchange.c LVM2.2.00.15/tools/pvchange.c >--- LVM2.2.00.15.orig/tools/pvchange.c 2004-03-30 19:35:43.000000000 +0000 >+++ LVM2.2.00.15/tools/pvchange.c 2004-07-03 20:40:03.466268240 +0000 >@@ -22,7 +22,7 @@ > { > struct volume_group *vg = NULL; > struct pv_list *pvl; >- struct list mdas; >+ struct lvm_list mdas; > uint64_t sector; > > const char *pv_name = dev_name(pv->dev); >@@ -209,10 +209,10 @@ > char *pv_name; > > struct pv_list *pvl; >- struct list *pvslist; >- struct list mdas; >+ struct lvm_list *pvslist; >+ struct lvm_list mdas; > >- list_init(&mdas); >+ lvm_list_init(&mdas); > > if (arg_count(cmd, allocatable_ARG) + arg_count(cmd, addtag_ARG) + > arg_count(cmd, deltag_ARG) + arg_count(cmd, uuid_ARG) != 1) { >@@ -251,7 +251,7 @@ > return ECMD_FAILED; > } > >- list_iterate_items(pvl, pvslist) { >+ lvm_list_iterate_items(pvl, pvslist) { > total++; > done += _pvchange_single(cmd, pvl->pv, NULL); > } >diff -ruN LVM2.2.00.15.orig/tools/pvcreate.c LVM2.2.00.15/tools/pvcreate.c >--- LVM2.2.00.15.orig/tools/pvcreate.c 2004-03-30 19:35:43.000000000 +0000 >+++ LVM2.2.00.15/tools/pvcreate.c 2004-07-03 20:40:31.858951896 +0000 >@@ -76,7 +76,7 @@ > const char *uuid = NULL; > uint64_t size = 0; > struct device *dev; >- struct list mdas; >+ struct lvm_list mdas; > int pvmetadatacopies; > uint64_t pvmetadatasize; > struct volume_group *vg; >@@ -153,7 +153,7 @@ > goto error; > } > >- list_init(&mdas); >+ lvm_list_init(&mdas); > if (!(pv = pv_create(cmd->fmt, dev, idp, size, pe_start, > extent_count, extent_size, > pvmetadatacopies, pvmetadatasize, &mdas))) { >diff -ruN LVM2.2.00.15.orig/tools/pvmove.c LVM2.2.00.15/tools/pvmove.c >--- LVM2.2.00.15.orig/tools/pvmove.c 2004-03-31 18:41:39.000000000 +0000 >+++ LVM2.2.00.15/tools/pvmove.c 2004-07-03 20:49:00.278660352 +0000 >@@ -154,36 +154,36 @@ > } > > /* Create list of PVs for allocation of replacement extents */ >-static struct list *_get_allocatable_pvs(struct cmd_context *cmd, int argc, >+static struct lvm_list *_get_allocatable_pvs(struct cmd_context *cmd, int argc, > char **argv, struct volume_group *vg, > struct physical_volume *pv) > { >- struct list *allocatable_pvs, *pvht, *pvh; >+ struct lvm_list *allocatable_pvs, *pvht, *pvh; > struct pv_list *pvl; > > if (argc) { > if (!(allocatable_pvs = create_pv_list(cmd->mem, vg, argc, > argv))) { >- stack; >+ STACK; > return NULL; > } > } else { > if (!(allocatable_pvs = clone_pv_list(cmd->mem, &vg->pvs))) { >- stack; >+ STACK; > return NULL; > } > } > > /* Don't allocate onto the PV we're clearing! */ > /* Remove PV if full */ >- list_iterate_safe(pvh, pvht, allocatable_pvs) { >- pvl = list_item(pvh, struct pv_list); >+ lvm_list_iterate_safe(pvh, pvht, allocatable_pvs) { >+ pvl = lvm_list_item(pvh, struct pv_list); > if ((pvl->pv->dev == pv->dev) || > (pvl->pv->pe_count == pvl->pv->pe_alloc_count)) >- list_del(&pvl->list); >+ lvm_list_del(&pvl->list); > } > >- if (list_empty(allocatable_pvs)) { >+ if (lvm_list_empty(allocatable_pvs)) { > log_error("No extents available for allocation"); > return NULL; > } >@@ -196,8 +196,8 @@ > struct volume_group *vg, > struct physical_volume *pv, > const char *lv_name, >- struct list *allocatable_pvs, >- struct list **lvs_changed) >+ struct lvm_list *allocatable_pvs, >+ struct lvm_list **lvs_changed) > { > struct logical_volume *lv_mirr, *lv; > struct lv_list *lvl; >@@ -217,10 +217,10 @@ > return NULL; > } > >- list_init(*lvs_changed); >+ lvm_list_init(*lvs_changed); > > /* Find segments to be moved and set up mirrors */ >- list_iterate_items(lvl, &vg->lvs) { >+ lvm_list_iterate_items(lvl, &vg->lvs) { > lv = lvl->lv; > if ((lv == lv_mirr) || (lv_name && strcmp(lv->name, lv_name))) > continue; >@@ -234,7 +234,7 @@ > } > if (!insert_pvmove_mirrors(cmd, lv_mirr, pv, lv, > allocatable_pvs, *lvs_changed)) { >- stack; >+ STACK; > return NULL; > } > } >@@ -249,7 +249,7 @@ > > static int _update_metadata(struct cmd_context *cmd, struct volume_group *vg, > struct logical_volume *lv_mirr, >- struct list *lvs_changed, int first_time) >+ struct lvm_list *lvs_changed, int first_time) > { > log_verbose("Updating volume group metadata"); > if (!vg_write(vg)) { >@@ -260,13 +260,13 @@ > backup(vg); > > if (!lock_lvs(cmd, lvs_changed, LCK_LV_SUSPEND | LCK_HOLD)) { >- stack; >+ STACK; > return 0; > } > > if (!first_time) { > if (!lock_vol(cmd, lv_mirr->lvid.s, LCK_LV_SUSPEND | LCK_HOLD)) { >- stack; >+ STACK; > unlock_lvs(cmd, lvs_changed); > vg_revert(vg); > return 0; >@@ -308,22 +308,22 @@ > { > const char *lv_name = NULL; > struct volume_group *vg; >- struct list *allocatable_pvs; >- struct list *lvs_changed; >+ struct lvm_list *allocatable_pvs; >+ struct lvm_list *lvs_changed; > struct physical_volume *pv; > struct logical_volume *lv_mirr; > int first_time = 1; > > /* Find PV (in VG) */ > if (!(pv = _find_pv_by_name(cmd, pv_name))) { >- stack; >+ STACK; > return EINVALID_CMD_LINE; > } > > if (arg_count(cmd, name_ARG)) { > if (!(lv_name = _extract_lvname(cmd, pv->vg_name, > arg_value(cmd, name_ARG)))) { >- stack; >+ STACK; > return EINVALID_CMD_LINE; > } > } >@@ -332,7 +332,7 @@ > log_verbose("Finding volume group \"%s\"", pv->vg_name); > > if (!(vg = _get_vg(cmd, pv->vg_name))) { >- stack; >+ STACK; > return ECMD_FAILED; > } > >@@ -361,28 +361,28 @@ > > if (!(allocatable_pvs = _get_allocatable_pvs(cmd, argc, argv, > vg, pv))) { >- stack; >+ STACK; > unlock_vg(cmd, pv->vg_name); > return ECMD_FAILED; > } > > if (!archive(vg)) { > unlock_vg(cmd, pv->vg_name); >- stack; >+ STACK; > return ECMD_FAILED; > } > > if (!(lv_mirr = _set_up_pvmove_lv(cmd, vg, pv, lv_name, > allocatable_pvs, > &lvs_changed))) { >- stack; >+ STACK; > unlock_vg(cmd, pv->vg_name); > return ECMD_FAILED; > } > } > > if (!lock_lvs(cmd, lvs_changed, LCK_LV_ACTIVATE)) { >- stack; >+ STACK; > unlock_vg(cmd, pv->vg_name); > return ECMD_FAILED; > } >@@ -390,7 +390,7 @@ > if (first_time) { > if (!_update_metadata > (cmd, vg, lv_mirr, lvs_changed, first_time)) { >- stack; >+ STACK; > unlock_vg(cmd, pv->vg_name); > return ECMD_FAILED; > } >@@ -403,7 +403,7 @@ > > static int _finish_pvmove(struct cmd_context *cmd, struct volume_group *vg, > struct logical_volume *lv_mirr, >- struct list *lvs_changed) >+ struct lvm_list *lvs_changed) > { > int r = 1; > >@@ -476,7 +476,7 @@ > const char *pv_name, struct pvmove_parms *parms, > int *finished) > { >- struct list *lvs_changed; >+ struct lvm_list *lvs_changed; > float segment_percent = 0.0, overall_percent = 0.0; > uint32_t event_nr = 0; > >@@ -596,7 +596,7 @@ > return ECMD_FAILED; > } > >- list_iterate_items(lvl, &vg->lvs) { >+ lvm_list_iterate_items(lvl, &vg->lvs) { > lv_mirr = lvl->lv; > if (!(lv_mirr->status & PVMOVE)) > continue; >@@ -673,7 +673,7 @@ > if (!arg_count(cmd, abort_ARG) && > (ret = _set_up_pvmove(cmd, pv_name, argc, argv)) != > ECMD_PROCESSED) { >- stack; >+ STACK; > return ret; > } > } >diff -ruN LVM2.2.00.15.orig/tools/pvscan.c LVM2.2.00.15/tools/pvscan.c >--- LVM2.2.00.15.orig/tools/pvscan.c 2004-03-30 19:35:43.000000000 +0000 >+++ LVM2.2.00.15/tools/pvscan.c 2004-07-03 20:49:32.730726888 +0000 >@@ -51,7 +51,7 @@ > > if (arg_count(cmd, uuid_ARG)) { > if (!id_write_format(&pv->id, uuid, sizeof(uuid))) { >- stack; >+ STACK; > return; > } > >@@ -103,7 +103,7 @@ > int new_pvs_found = 0; > int pvs_found = 0; > >- struct list *pvslist; >+ struct lvm_list *pvslist; > struct pv_list *pvl; > struct physical_volume *pv; > >@@ -135,13 +135,13 @@ > return ECMD_FAILED; > > /* eliminate exported/new if required */ >- list_iterate_items(pvl, pvslist) { >+ lvm_list_iterate_items(pvl, pvslist) { > pv = pvl->pv; > > if ((arg_count(cmd, exported_ARG) > && !(pv->status & EXPORTED_VG)) > || (arg_count(cmd, novolumegroup_ARG) && (*pv->vg_name))) { >- list_del(&pvl->list); >+ lvm_list_del(&pvl->list); > continue; > } > >@@ -167,7 +167,7 @@ > > /* find maximum pv name length */ > pv_max_name_len = vg_max_name_len = 0; >- list_iterate_items(pvl, pvslist) { >+ lvm_list_iterate_items(pvl, pvslist) { > pv = pvl->pv; > len = strlen(dev_name(pv->dev)); > if (pv_max_name_len < len) >@@ -179,7 +179,7 @@ > pv_max_name_len += 2; > vg_max_name_len += 2; > >- list_iterate_items(pvl, pvslist) >+ lvm_list_iterate_items(pvl, pvslist) > _pvscan_display_single(cmd, pvl->pv, NULL); > > if (!pvs_found) { >diff -ruN LVM2.2.00.15.orig/tools/toollib.c LVM2.2.00.15/tools/toollib.c >--- LVM2.2.00.15.orig/tools/toollib.c 2004-03-30 19:35:43.000000000 +0000 >+++ LVM2.2.00.15/tools/toollib.c 2004-07-03 20:52:48.844913000 +0000 >@@ -18,7 +18,7 @@ > #include <sys/stat.h> > > int process_each_lv_in_vg(struct cmd_context *cmd, struct volume_group *vg, >- struct list *arg_lvnames, struct list *tags, >+ struct lvm_list *arg_lvnames, struct lvm_list *tags, > void *handle, > int (*process_single) (struct cmd_context * cmd, > struct logical_volume * lv, >@@ -38,10 +38,10 @@ > return ECMD_FAILED; > } > >- if (tags && !list_empty(tags)) >+ if (tags && !lvm_list_empty(tags)) > tags_supplied = 1; > >- if (arg_lvnames && !list_empty(arg_lvnames)) >+ if (arg_lvnames && !lvm_list_empty(arg_lvnames)) > lvargs_supplied = 1; > > /* Process all LVs in this VG if no restrictions given */ >@@ -53,7 +53,7 @@ > str_list_match_list(tags, &vg->tags)) > process_all = 1; > >- list_iterate_items(lvl, &vg->lvs) { >+ lvm_list_iterate_items(lvl, &vg->lvs) { > /* Should we process this LV? */ > if (process_all) > process_lv = 1; >@@ -109,25 +109,25 @@ > int ret = 0; > int consistent; > >- struct list *slh, *tags_arg; >- struct list *vgnames; /* VGs to process */ >+ struct lvm_list *slh, *tags_arg; >+ struct lvm_list *vgnames; /* VGs to process */ > struct str_list *sll; > struct volume_group *vg; >- struct list tags, lvnames; >- struct list arg_lvnames; /* Cmdline vgname or vgname/lvname */ >+ struct lvm_list tags, lvnames; >+ struct lvm_list arg_lvnames; /* Cmdline vgname or vgname/lvname */ > char *vglv; > size_t vglv_sz; > > const char *vgname; > >- list_init(&tags); >- list_init(&arg_lvnames); >+ lvm_list_init(&tags); >+ lvm_list_init(&arg_lvnames); > > if (argc) { >- struct list arg_vgnames; >+ struct lvm_list arg_vgnames; > > log_verbose("Using logical volume(s) on command line"); >- list_init(&arg_vgnames); >+ lvm_list_init(&arg_vgnames); > > for (; opt < argc; opt++) { > const char *lv_name = argv[opt]; >@@ -219,16 +219,16 @@ > vgnames = &arg_vgnames; > } > >- if (!argc || !list_empty(&tags)) { >+ if (!argc || !lvm_list_empty(&tags)) { > log_verbose("Finding all logical volumes"); >- if (!(vgnames = get_vgs(cmd, 0)) || list_empty(vgnames)) { >+ if (!(vgnames = get_vgs(cmd, 0)) || lvm_list_empty(vgnames)) { > log_error("No volume groups found"); > return ECMD_FAILED; > } > } > >- list_iterate(slh, vgnames) { >- vgname = list_item(slh, struct str_list)->str; >+ lvm_list_iterate(slh, vgnames) { >+ vgname = lvm_list_item(slh, struct str_list)->str; > if (!vgname || !*vgname) > continue; /* FIXME Unnecessary? */ > if (!lock_vol(cmd, vgname, lock_type)) { >@@ -259,15 +259,15 @@ > } > > tags_arg = &tags; >- list_init(&lvnames); /* LVs to be processed in this VG */ >- list_iterate_items(sll, &arg_lvnames) { >+ lvm_list_init(&lvnames); /* LVs to be processed in this VG */ >+ lvm_list_iterate_items(sll, &arg_lvnames) { > const char *vg_name = sll->str; > const char *lv_name = strchr(vg_name, '/'); > > if ((!lv_name && !strcmp(vg_name, vgname))) { > /* Process all LVs in this VG */ > tags_arg = NULL; >- list_init(&lvnames); >+ lvm_list_init(&lvnames); > break; > } else if (!strncmp(vg_name, vgname, strlen(vgname)) && > strlen(vgname) == lv_name - vg_name) { >@@ -301,7 +301,7 @@ > int ret_max = 0; > int ret; > >- list_iterate_items(seg, &lv->segments) { >+ lvm_list_iterate_items(seg, &lv->segments) { > ret = process_single(cmd, seg, handle); > if (ret > ret_max) > ret_max = ret; >@@ -311,7 +311,7 @@ > } > > static int _process_one_vg(struct cmd_context *cmd, const char *vg_name, >- struct list *tags, struct list *arg_vgnames, >+ struct lvm_list *tags, struct lvm_list *arg_vgnames, > int lock_type, int consistent, void *handle, > int ret_max, > int (*process_single) (struct cmd_context * cmd, >@@ -330,7 +330,7 @@ > log_verbose("Finding volume group \"%s\"", vg_name); > vg = vg_read(cmd, vg_name, &consistent); > >- if (!list_empty(tags)) { >+ if (!lvm_list_empty(tags)) { > /* Only process if a tag matches or it's on arg_vgnames */ > if (!str_list_match_item(arg_vgnames, vg_name) && > !str_list_match_list(tags, &vg->tags)) { >@@ -359,14 +359,14 @@ > int ret_max = 0; > > struct str_list *sl; >- struct list *vgnames; >- struct list arg_vgnames, tags; >+ struct lvm_list *vgnames; >+ struct lvm_list arg_vgnames, tags; > > const char *vg_name; > char *dev_dir = cmd->dev_dir; > >- list_init(&tags); >- list_init(&arg_vgnames); >+ lvm_list_init(&tags); >+ lvm_list_init(&arg_vgnames); > > if (argc) { > log_verbose("Using volume group(s) on command line"); >@@ -410,15 +410,15 @@ > vgnames = &arg_vgnames; > } > >- if (!argc || !list_empty(&tags)) { >+ if (!argc || !lvm_list_empty(&tags)) { > log_verbose("Finding all volume groups"); >- if (!(vgnames = get_vgs(cmd, 0)) || list_empty(vgnames)) { >+ if (!(vgnames = get_vgs(cmd, 0)) || lvm_list_empty(vgnames)) { > log_error("No volume groups found"); > return ECMD_FAILED; > } > } > >- list_iterate_items(sl, vgnames) { >+ lvm_list_iterate_items(sl, vgnames) { > vg_name = sl->str; > if (!vg_name || !*vg_name) > continue; /* FIXME Unnecessary? */ >@@ -431,7 +431,7 @@ > } > > int process_each_pv_in_vg(struct cmd_context *cmd, struct volume_group *vg, >- struct list *tags, void *handle, >+ struct lvm_list *tags, void *handle, > int (*process_single) (struct cmd_context * cmd, > struct volume_group * vg, > struct physical_volume * pv, >@@ -441,8 +441,8 @@ > int ret = 0; > struct pv_list *pvl; > >- list_iterate_items(pvl, &vg->pvs) { >- if (tags && !list_empty(tags) && >+ lvm_list_iterate_items(pvl, &vg->pvs) { >+ if (tags && !lvm_list_empty(tags) && > !str_list_match_list(tags, &pvl->pv->tags)) > continue; > if ((ret = process_single(cmd, vg, pvl->pv, handle)) > ret_max) >@@ -465,13 +465,13 @@ > > struct pv_list *pvl; > struct physical_volume *pv; >- struct list *pvslist, *vgnames; >- struct list tags; >+ struct lvm_list *pvslist, *vgnames; >+ struct lvm_list tags; > struct str_list *sll; > char *tagname; > int consistent = 1; > >- list_init(&tags); >+ lvm_list_init(&tags); > > if (argc) { > log_verbose("Using physical volume(s) on command line"); >@@ -515,9 +515,9 @@ > if (ret > ret_max) > ret_max = ret; > } >- if (!list_empty(&tags) && (vgnames = get_vgs(cmd, 0)) && >- !list_empty(vgnames)) { >- list_iterate_items(sll, vgnames) { >+ if (!lvm_list_empty(&tags) && (vgnames = get_vgs(cmd, 0)) && >+ !lvm_list_empty(vgnames)) { >+ lvm_list_iterate_items(sll, vgnames) { > vg = vg_read(cmd, sll->str, &consistent); > if (!consistent) > continue; >@@ -541,7 +541,7 @@ > if (!(pvslist = get_pvs(cmd))) > return ECMD_FAILED; > >- list_iterate_items(pvl, pvslist) { >+ lvm_list_iterate_items(pvl, pvslist) { > ret = process_single(cmd, NULL, pvl->pv, > handle); > if (ret > ret_max) >@@ -639,7 +639,7 @@ > return pool_strdup(cmd->mem, vg_path); > } > >-static int _add_alloc_area(struct pool *mem, struct list *alloc_areas, >+static int _add_alloc_area(struct pool *mem, struct lvm_list *alloc_areas, > uint32_t start, uint32_t count) > { > struct alloc_area *aa; >@@ -648,7 +648,7 @@ > start, count); > > /* Ensure no overlap with existing areas */ >- list_iterate_items(aa, alloc_areas) { >+ lvm_list_iterate_items(aa, alloc_areas) { > if (((start < aa->start) && (start + count - 1 >= aa->start)) || > ((start >= aa->start) && > (aa->start + aa->count - 1) >= start)) { >@@ -667,12 +667,12 @@ > > aa->start = start; > aa->count = count; >- list_add(alloc_areas, &aa->list); >+ lvm_list_add(alloc_areas, &aa->list); > > return 1; > } > >-static int _parse_pes(struct pool *mem, char *c, struct list *alloc_areas, >+static int _parse_pes(struct pool *mem, char *c, struct lvm_list *alloc_areas, > uint32_t size) > { > char *endptr; >@@ -681,7 +681,7 @@ > /* Default to whole PV */ > if (!c) { > if (!_add_alloc_area(mem, alloc_areas, UINT32_C(0), size)) { >- stack; >+ STACK; > return 0; > } > return 1; >@@ -731,7 +731,7 @@ > } > > if (!_add_alloc_area(mem, alloc_areas, start, end - start + 1)) { >- stack; >+ STACK; > return 0; > } > >@@ -745,11 +745,11 @@ > } > > static void _create_pv_entry(struct pool *mem, struct pv_list *pvl, >- char *colon, struct list *r) >+ char *colon, struct lvm_list *r) > { > const char *pvname; > struct pv_list *new_pvl; >- struct list *alloc_areas; >+ struct lvm_list *alloc_areas; > > pvname = dev_name(pvl->pv->dev); > if (!(pvl->pv->status & ALLOCATABLE_PV)) { >@@ -774,24 +774,24 @@ > log_error("Allocation of alloc_areas list failed"); > return; > } >- list_init(alloc_areas); >+ lvm_list_init(alloc_areas); > > /* Specify which physical extents may be used for allocation */ > if (!_parse_pes(mem, colon, alloc_areas, pvl->pv->pe_count)) { >- stack; >+ STACK; > return; > } > new_pvl->alloc_areas = alloc_areas; > >- list_add(r, &new_pvl->list); >+ lvm_list_add(r, &new_pvl->list); > } > >-struct list *create_pv_list(struct pool *mem, >+struct lvm_list *create_pv_list(struct pool *mem, > struct volume_group *vg, int argc, char **argv) > { >- struct list *r; >+ struct lvm_list *r; > struct pv_list *pvl; >- struct list tags, arg_pvnames; >+ struct lvm_list tags, arg_pvnames; > const char *pvname = NULL; > char *colon, *tagname; > int i; >@@ -801,10 +801,10 @@ > log_error("Allocation of list failed"); > return NULL; > } >- list_init(r); >+ lvm_list_init(r); > >- list_init(&tags); >- list_init(&arg_pvnames); >+ lvm_list_init(&tags); >+ lvm_list_init(&arg_pvnames); > > for (i = 0; i < argc; i++) { > if (*argv[i] == '@') { >@@ -813,7 +813,7 @@ > log_error("Skipping invalid tag %s", tagname); > continue; > } >- list_iterate_items(pvl, &vg->pvs) { >+ lvm_list_iterate_items(pvl, &vg->pvs) { > if (str_list_match_item(&pvl->pv->tags, > tagname)) { > _create_pv_entry(mem, pvl, NULL, r); >@@ -841,18 +841,18 @@ > _create_pv_entry(mem, pvl, colon, r); > } > >- if (list_empty(r)) >+ if (lvm_list_empty(r)) > log_error("No specified PVs have space available"); > >- return list_empty(r) ? NULL : r; >+ return lvm_list_empty(r) ? NULL : r; > } > > > > >-struct list *clone_pv_list(struct pool *mem, struct list *pvsl) >+struct lvm_list *clone_pv_list(struct pool *mem, struct lvm_list *pvsl) > { >- struct list *r; >+ struct lvm_list *r; > struct pv_list *pvl, *new_pvl; > > /* Build up list of PVs */ >@@ -860,16 +860,16 @@ > log_error("Allocation of list failed"); > return NULL; > } >- list_init(r); >+ lvm_list_init(r); > >- list_iterate_items(pvl, pvsl) { >+ lvm_list_iterate_items(pvl, pvsl) { > if (!(new_pvl = pool_zalloc(mem, sizeof(*new_pvl)))) { > log_error("Unable to allocate physical volume list."); > return NULL; > } > > memcpy(new_pvl, pvl, sizeof(*new_pvl)); >- list_add(r, &new_pvl->list); >+ lvm_list_add(r, &new_pvl->list); > } > > return r; >diff -ruN LVM2.2.00.15.orig/tools/toollib.h LVM2.2.00.15/tools/toollib.h >--- LVM2.2.00.15.orig/tools/toollib.h 2004-03-30 19:35:43.000000000 +0000 >+++ LVM2.2.00.15/tools/toollib.h 2004-07-03 20:41:09.832179088 +0000 >@@ -54,14 +54,14 @@ > void *handle)); > > int process_each_pv_in_vg(struct cmd_context *cmd, struct volume_group *vg, >- struct list *tags, void *handle, >+ struct lvm_list *tags, void *handle, > int (*process_single) (struct cmd_context * cmd, > struct volume_group * vg, > struct physical_volume * pv, > void *handle)); > > int process_each_lv_in_vg(struct cmd_context *cmd, struct volume_group *vg, >- struct list *arg_lvnames, struct list *tags, >+ struct lvm_list *arg_lvnames, struct lvm_list *tags, > void *handle, > int (*process_single) (struct cmd_context * cmd, > struct logical_volume * lv, >@@ -74,9 +74,9 @@ > * Builds a list of pv's from the names in argv. Used in > * lvcreate/extend. > */ >-struct list *create_pv_list(struct pool *mem, >+struct lvm_list *create_pv_list(struct pool *mem, > struct volume_group *vg, int argc, char **argv); > >-struct list *clone_pv_list(struct pool *mem, struct list *pvs); >+struct lvm_list *clone_pv_list(struct pool *mem, struct lvm_list *pvs); > > #endif >diff -ruN LVM2.2.00.15.orig/tools/vgcfgbackup.c LVM2.2.00.15/tools/vgcfgbackup.c >--- LVM2.2.00.15.orig/tools/vgcfgbackup.c 2004-03-30 19:35:43.000000000 +0000 >+++ LVM2.2.00.15/tools/vgcfgbackup.c 2004-07-03 18:39:42.048090672 +0000 >@@ -34,14 +34,14 @@ > if (!consistent) { > log_error("No backup taken: specify filename with -f " > "to backup an inconsistent VG"); >- stack; >+ STACK; > return ECMD_FAILED; > } > > /* just use the normal backup code */ > backup_enable(1); /* force a backup */ > if (!backup(vg)) { >- stack; >+ STACK; > return ECMD_FAILED; > } > } >diff -ruN LVM2.2.00.15.orig/tools/vgchange.c LVM2.2.00.15/tools/vgchange.c >--- LVM2.2.00.15.orig/tools/vgchange.c 2004-03-30 19:35:44.000000000 +0000 >+++ LVM2.2.00.15/tools/vgchange.c 2004-07-03 20:41:59.845575896 +0000 >@@ -23,7 +23,7 @@ > struct physical_volume *pv; > int count = 0; > >- list_iterate_items(lvl, &vg->lvs) { >+ lvm_list_iterate_items(lvl, &vg->lvs) { > lv = lvl->lv; > > /* Only request activation of snapshot origin devices */ >@@ -214,7 +214,7 @@ > > id_create(&vg->id); > >- list_iterate_items(lvl, &vg->lvs) { >+ lvm_list_iterate_items(lvl, &vg->lvs) { > memcpy(&lvl->lv->lvid, &vg->id, sizeof(vg->id)); > } > >diff -ruN LVM2.2.00.15.orig/tools/vgconvert.c LVM2.2.00.15/tools/vgconvert.c >--- LVM2.2.00.15.orig/tools/vgconvert.c 2004-03-30 19:35:44.000000000 +0000 >+++ LVM2.2.00.15/tools/vgconvert.c 2004-07-03 20:42:24.036898256 +0000 >@@ -23,7 +23,7 @@ > struct logical_volume *lv; > struct lv_list *lvl; > uint64_t size = 0; >- struct list mdas; >+ struct lvm_list mdas; > int pvmetadatacopies = 0; > uint64_t pvmetadatasize = 0; > uint64_t pe_end = 0, pe_start = 0; >@@ -90,7 +90,7 @@ > > /* Attempt to change any LVIDs that are too big */ > if (cmd->fmt->features & FMT_RESTRICTED_LVIDS) { >- list_iterate_items(lvl, &vg->lvs) { >+ lvm_list_iterate_items(lvl, &vg->lvs) { > lv = lvl->lv; > if (lvnum_from_lvid(&lv->lvid) < MAX_RESTRICTED_LVS) > continue; >@@ -109,14 +109,14 @@ > if (active) > return ECMD_FAILED; > >- list_iterate_items(pvl, &vg->pvs) { >+ lvm_list_iterate_items(pvl, &vg->pvs) { > existing_pv = pvl->pv; > > pe_start = existing_pv->pe_start; > pe_end = existing_pv->pe_count * existing_pv->pe_size > + pe_start - 1; > >- list_init(&mdas); >+ lvm_list_init(&mdas); > if (!(pv = pv_create(cmd->fmt, existing_pv->dev, > &existing_pv->id, size, > pe_start, existing_pv->pe_count, >diff -ruN LVM2.2.00.15.orig/tools/vgmerge.c LVM2.2.00.15/tools/vgmerge.c >--- LVM2.2.00.15.orig/tools/vgmerge.c 2004-03-30 19:35:44.000000000 +0000 >+++ LVM2.2.00.15/tools/vgmerge.c 2004-07-03 20:43:26.400417560 +0000 >@@ -106,10 +106,10 @@ > } > > /* Check no conflicts with LV names */ >- list_iterate_items(lvl1, &vg_to->lvs) { >+ lvm_list_iterate_items(lvl1, &vg_to->lvs) { > char *name1 = lvl1->lv->name; > >- list_iterate_items(lvl2, &vg_from->lvs) { >+ lvm_list_iterate_items(lvl2, &vg_from->lvs) { > char *name2 = lvl2->lv->name; > > if (!strcmp(name1, name2)) { >@@ -128,30 +128,30 @@ > goto error; > > /* Merge volume groups */ >- while (!list_empty(&vg_from->pvs)) { >- struct list *pvh = vg_from->pvs.n; >+ while (!lvm_list_empty(&vg_from->pvs)) { >+ struct lvm_list *pvh = vg_from->pvs.n; > struct physical_volume *pv; > >- list_del(pvh); >- list_add(&vg_to->pvs, pvh); >+ lvm_list_del(pvh); >+ lvm_list_add(&vg_to->pvs, pvh); > >- pv = list_item(pvh, struct pv_list)->pv; >+ pv = lvm_list_item(pvh, struct pv_list)->pv; > pv->vg_name = pool_strdup(cmd->mem, vg_to->name); > } > vg_to->pv_count += vg_from->pv_count; > >- while (!list_empty(&vg_from->lvs)) { >- struct list *lvh = vg_from->lvs.n; >+ while (!lvm_list_empty(&vg_from->lvs)) { >+ struct lvm_list *lvh = vg_from->lvs.n; > >- list_del(lvh); >- list_add(&vg_to->lvs, lvh); >+ lvm_list_del(lvh); >+ lvm_list_add(&vg_to->lvs, lvh); > } > >- while (!list_empty(&vg_from->fid->metadata_areas)) { >- struct list *mdah = vg_from->fid->metadata_areas.n; >+ while (!lvm_list_empty(&vg_from->fid->metadata_areas)) { >+ struct lvm_list *mdah = vg_from->fid->metadata_areas.n; > >- list_del(mdah); >- list_add(&vg_to->fid->metadata_areas, mdah); >+ lvm_list_del(mdah); >+ lvm_list_add(&vg_to->fid->metadata_areas, mdah); > } > > vg_to->lv_count += vg_from->lv_count; >diff -ruN LVM2.2.00.15.orig/tools/vgreduce.c LVM2.2.00.15/tools/vgreduce.c >--- LVM2.2.00.15.orig/tools/vgreduce.c 2004-03-30 19:35:44.000000000 +0000 >+++ LVM2.2.00.15/tools/vgreduce.c 2004-07-03 20:54:00.043089232 +0000 >@@ -25,7 +25,7 @@ > } > > if (!id_write_format(&pvl->pv->id, uuid, sizeof(uuid))) { >- stack; >+ STACK; > return 0; > } > >@@ -41,7 +41,7 @@ > vg->extent_count -= pvl->pv->pe_count; > vg->pv_count--; > >- list_del(&pvl->list); >+ lvm_list_del(&pvl->list); > > return 1; > } >@@ -51,7 +51,7 @@ > { > struct snapshot *snap; > struct snapshot_list *snl; >- struct list *snaplist; >+ struct lvm_list *snaplist; > > log_verbose("%s/%s has missing extents: removing (including " > "dependencies)", lv->vg->name, lv->name); >@@ -83,21 +83,21 @@ > > /* Remove snapshot dependencies */ > if (!(snaplist = find_snapshots(lv))) { >- stack; >+ STACK; > return 0; > } > /* List may be empty */ >- list_iterate_items(snl, snaplist) { >+ lvm_list_iterate_items(snl, snaplist) { > *list_unsafe = 1; /* May remove caller's lvht! */ > snap = snl->snapshot; > if (!vg_remove_snapshot(lv->vg, snap->cow)) { >- stack; >+ STACK; > return 0; > } > log_verbose("Removing LV %s from VG %s", snap->cow->name, > lv->vg->name); > if (!lv_remove(lv->vg, snap->cow)) { >- stack; >+ STACK; > return 0; > } > } >@@ -105,7 +105,7 @@ > /* Remove the LV itself */ > log_verbose("Removing LV %s from VG %s", lv->name, lv->vg->name); > if (!lv_remove(lv->vg, lv)) { >- stack; >+ STACK; > return 0; > } > >@@ -114,8 +114,8 @@ > > static int _make_vg_consistent(struct cmd_context *cmd, struct volume_group *vg) > { >- struct list *pvh, *pvht; >- struct list *lvh, *lvht; >+ struct lvm_list *pvh, *pvht; >+ struct lvm_list *lvh, *lvht; > struct pv_list *pvl; > struct logical_volume *lv; > struct physical_volume *pv; >@@ -127,11 +127,11 @@ > restart_loop: > list_unsafe = 0; /* Set if we delete a different list-member */ > >- list_iterate_safe(lvh, lvht, &vg->lvs) { >- lv = list_item(lvh, struct lv_list)->lv; >+ lvm_list_iterate_safe(lvh, lvht, &vg->lvs) { >+ lv = lvm_list_item(lvh, struct lv_list)->lv; > > /* Are any segments of this LV on missing PVs? */ >- list_iterate_items(seg, &lv->segments) { >+ lvm_list_iterate_items(seg, &lv->segments) { > for (s = 0; s < seg->area_count; s++) { > if (seg->area[s].type != AREA_PV) > continue; >@@ -141,7 +141,7 @@ > pv = seg->area[s].u.pv.pv; > if (!pv || !pv->dev) { > if (!_remove_lv(cmd, lv, &list_unsafe)) { >- stack; >+ STACK; > return 0; > } > if (list_unsafe) >@@ -152,12 +152,12 @@ > } > > /* Remove missing PVs */ >- list_iterate_safe(pvh, pvht, &vg->pvs) { >- pvl = list_item(pvh, struct pv_list); >+ lvm_list_iterate_safe(pvh, pvht, &vg->pvs) { >+ pvl = lvm_list_item(pvh, struct pv_list); > if (pvl->pv->dev) > continue; > if (!_remove_pv(vg, pvl)) { >- stack; >+ STACK; > return 0; > } > } >@@ -191,7 +191,7 @@ > log_verbose("Removing \"%s\" from volume group \"%s\"", name, vg->name); > > if (pvl) >- list_del(&pvl->list); >+ lvm_list_del(&pvl->list); > > pv->vg_name = ORPHAN; > vg->pv_count--; >diff -ruN LVM2.2.00.15.orig/tools/vgremove.c LVM2.2.00.15/tools/vgremove.c >--- LVM2.2.00.15.orig/tools/vgremove.c 2004-03-30 19:35:44.000000000 +0000 >+++ LVM2.2.00.15/tools/vgremove.c 2004-07-03 20:43:56.463847224 +0000 >@@ -54,7 +54,7 @@ > } > > /* init physical volumes */ >- list_iterate_items(pvl, &vg->pvs) { >+ lvm_list_iterate_items(pvl, &vg->pvs) { > pv = pvl->pv; > log_verbose("Removing physical volume \"%s\" from " > "volume group \"%s\"", dev_name(pv->dev), vg_name); >diff -ruN LVM2.2.00.15.orig/tools/vgsplit.c LVM2.2.00.15/tools/vgsplit.c >--- LVM2.2.00.15.orig/tools/vgsplit.c 2004-03-30 19:35:44.000000000 +0000 >+++ LVM2.2.00.15/tools/vgsplit.c 2004-07-03 20:44:40.354174880 +0000 >@@ -27,13 +27,13 @@ > return 0; > } > >- list_del(&pvl->list); >- list_add(&vg_to->pvs, &pvl->list); >+ lvm_list_del(&pvl->list); >+ lvm_list_add(&vg_to->pvs, &pvl->list); > > vg_from->pv_count--; > vg_to->pv_count++; > >- pv = list_item(pvl, struct pv_list)->pv; >+ pv = lvm_list_item(pvl, struct pv_list)->pv; > > vg_from->extent_count -= pv->pe_count; > vg_to->extent_count += pv->pe_count; >@@ -46,20 +46,20 @@ > > static int _move_lvs(struct volume_group *vg_from, struct volume_group *vg_to) > { >- struct list *lvh, *lvht; >+ struct lvm_list *lvh, *lvht; > struct logical_volume *lv; > struct lv_segment *seg; > struct physical_volume *pv; > struct volume_group *vg_with; > unsigned int s; > >- list_iterate_safe(lvh, lvht, &vg_from->lvs) { >- lv = list_item(lvh, struct lv_list)->lv; >+ lvm_list_iterate_safe(lvh, lvht, &vg_from->lvs) { >+ lv = lvm_list_item(lvh, struct lv_list)->lv; > > /* Ensure all the PVs used by this LV remain in the same */ > /* VG as each other */ > vg_with = NULL; >- list_iterate_items(seg, &lv->segments) { >+ lvm_list_iterate_items(seg, &lv->segments) { > for (s = 0; s < seg->area_count; s++) { > /* FIXME Check AREA_LV too */ > if (seg->area[s].type != AREA_PV) >@@ -95,8 +95,8 @@ > continue; > > /* Move this LV */ >- list_del(lvh); >- list_add(&vg_to->lvs, lvh); >+ lvm_list_del(lvh); >+ lvm_list_add(&vg_to->lvs, lvh); > > vg_from->lv_count--; > vg_to->lv_count++; >@@ -111,7 +111,7 @@ > { > struct lv_list *lvl; > >- list_iterate_items(lvl, &vg->lvs) >+ lvm_list_iterate_items(lvl, &vg->lvs) > if (lv == lvl->lv) > return 1; > >@@ -121,12 +121,12 @@ > static int _move_snapshots(struct volume_group *vg_from, > struct volume_group *vg_to) > { >- struct list *slh, *slth; >+ struct lvm_list *slh, *slth; > struct snapshot *snap; > int cow_from, origin_from; > >- list_iterate_safe(slh, slth, &vg_from->snapshots) { >- snap = list_item(slh, struct snapshot_list)->snapshot; >+ lvm_list_iterate_safe(slh, slth, &vg_from->snapshots) { >+ snap = lvm_list_item(slh, struct snapshot_list)->snapshot; > cow_from = _lv_is_in_vg(vg_from, snap->cow); > origin_from = _lv_is_in_vg(vg_from, snap->origin); > if (cow_from && origin_from) >@@ -138,8 +138,8 @@ > vg_from->snapshot_count--; > vg_to->snapshot_count++; > >- list_del(slh); >- list_add(&vg_to->snapshots, slh); >+ lvm_list_del(slh); >+ lvm_list_add(&vg_to->snapshots, slh); > } > > return 1;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 56873
:
35295
| 35296