mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-04 09:18:36 +03:00
store snapshot id as lvid internally
This commit is contained in:
parent
864de9cee1
commit
90395b8d53
@ -1,5 +1,6 @@
|
|||||||
Version 2.01.10 -
|
Version 2.01.10 -
|
||||||
================================
|
================================
|
||||||
|
Internal snapshot restructuring.
|
||||||
Allow offline extension of snapshot volumes.
|
Allow offline extension of snapshot volumes.
|
||||||
Move from 2-step to 3-step on-disk metadata commit.
|
Move from 2-step to 3-step on-disk metadata commit.
|
||||||
Scan ramdisks too and allow non-O_DIRECT fallback.
|
Scan ramdisks too and allow non-O_DIRECT fallback.
|
||||||
|
@ -488,7 +488,7 @@ static int _print_snapshot(struct formatter *f, struct snapshot *snap,
|
|||||||
outf(f, "snapshot%u {", count);
|
outf(f, "snapshot%u {", count);
|
||||||
_inc_indent(f);
|
_inc_indent(f);
|
||||||
|
|
||||||
if (!id_write_format(&snap->id, buffer, sizeof(buffer))) {
|
if (!id_write_format(&snap->lvid.id[1], buffer, sizeof(buffer))) {
|
||||||
stack;
|
stack;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -258,7 +258,7 @@ struct logical_volume {
|
|||||||
};
|
};
|
||||||
|
|
||||||
struct snapshot {
|
struct snapshot {
|
||||||
struct id id;
|
union lvid lvid;
|
||||||
|
|
||||||
int persistent; /* boolean */
|
int persistent; /* boolean */
|
||||||
uint32_t chunk_size; /* in 512 byte sectors */
|
uint32_t chunk_size; /* in 512 byte sectors */
|
||||||
@ -508,7 +508,7 @@ struct snapshot *find_origin(const struct logical_volume *lv);
|
|||||||
struct list *find_snapshots(const struct logical_volume *lv);
|
struct list *find_snapshots(const struct logical_volume *lv);
|
||||||
|
|
||||||
int vg_add_snapshot(struct logical_volume *origin, struct logical_volume *cow,
|
int vg_add_snapshot(struct logical_volume *origin, struct logical_volume *cow,
|
||||||
int persistent, struct id *id, uint32_t extent_count,
|
int persistent, union lvid *lvid, uint32_t extent_count,
|
||||||
uint32_t chunk_size);
|
uint32_t chunk_size);
|
||||||
|
|
||||||
int vg_remove_snapshot(struct volume_group *vg, struct logical_volume *cow);
|
int vg_remove_snapshot(struct volume_group *vg, struct logical_volume *cow);
|
||||||
|
@ -105,7 +105,7 @@ struct list *find_snapshots(const struct logical_volume *lv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int vg_add_snapshot(struct logical_volume *origin, struct logical_volume *cow,
|
int vg_add_snapshot(struct logical_volume *origin, struct logical_volume *cow,
|
||||||
int persistent, struct id *id, uint32_t extent_count,
|
int persistent, union lvid *lvid, uint32_t extent_count,
|
||||||
uint32_t chunk_size)
|
uint32_t chunk_size)
|
||||||
{
|
{
|
||||||
struct snapshot *s;
|
struct snapshot *s;
|
||||||
@ -131,9 +131,9 @@ int vg_add_snapshot(struct logical_volume *origin, struct logical_volume *cow,
|
|||||||
s->origin = origin;
|
s->origin = origin;
|
||||||
s->cow = cow;
|
s->cow = cow;
|
||||||
|
|
||||||
if (id)
|
if (lvid)
|
||||||
s->id = *id;
|
s->lvid = *lvid;
|
||||||
else if (!id_create(&s->id)) {
|
else if (!lvid_create(&s->lvid, &origin->vg->id)) {
|
||||||
log_error("Random UUID creation failed for snapshot %s.",
|
log_error("Random UUID creation failed for snapshot %s.",
|
||||||
cow->name);
|
cow->name);
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -70,7 +70,7 @@ static int _text_import(struct lv_segment *seg, const struct config_node *sn,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!vg_add_snapshot(org, cow, 1, &seg->lv->lvid.id[1], seg->len,
|
if (!vg_add_snapshot(org, cow, 1, &seg->lv->lvid, seg->len,
|
||||||
chunk_size)) {
|
chunk_size)) {
|
||||||
stack;
|
stack;
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user