mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-02 01:18:26 +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 -
|
||||
================================
|
||||
Internal snapshot restructuring.
|
||||
Allow offline extension of snapshot volumes.
|
||||
Move from 2-step to 3-step on-disk metadata commit.
|
||||
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);
|
||||
_inc_indent(f);
|
||||
|
||||
if (!id_write_format(&snap->id, buffer, sizeof(buffer))) {
|
||||
if (!id_write_format(&snap->lvid.id[1], buffer, sizeof(buffer))) {
|
||||
stack;
|
||||
return 0;
|
||||
}
|
||||
|
@ -258,7 +258,7 @@ struct logical_volume {
|
||||
};
|
||||
|
||||
struct snapshot {
|
||||
struct id id;
|
||||
union lvid lvid;
|
||||
|
||||
int persistent; /* boolean */
|
||||
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);
|
||||
|
||||
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);
|
||||
|
||||
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 persistent, struct id *id, uint32_t extent_count,
|
||||
int persistent, union lvid *lvid, uint32_t extent_count,
|
||||
uint32_t chunk_size)
|
||||
{
|
||||
struct snapshot *s;
|
||||
@ -131,9 +131,9 @@ int vg_add_snapshot(struct logical_volume *origin, struct logical_volume *cow,
|
||||
s->origin = origin;
|
||||
s->cow = cow;
|
||||
|
||||
if (id)
|
||||
s->id = *id;
|
||||
else if (!id_create(&s->id)) {
|
||||
if (lvid)
|
||||
s->lvid = *lvid;
|
||||
else if (!lvid_create(&s->lvid, &origin->vg->id)) {
|
||||
log_error("Random UUID creation failed for snapshot %s.",
|
||||
cow->name);
|
||||
return 0;
|
||||
|
@ -70,7 +70,7 @@ static int _text_import(struct lv_segment *seg, const struct config_node *sn,
|
||||
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)) {
|
||||
stack;
|
||||
return 0;
|
||||
|
Loading…
Reference in New Issue
Block a user