1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-03 05:18:29 +03:00

o add find_cow function.

This commit is contained in:
Joe Thornber 2002-02-21 10:16:33 +00:00
parent 6633e1b863
commit 0e32e054df
2 changed files with 16 additions and 0 deletions

View File

@ -338,6 +338,8 @@ int lv_merge_segments(struct logical_volume *lv);
int lv_is_origin(struct logical_volume *lv);
int lv_is_cow(struct logical_volume *lv);
struct snapshot *find_cow(struct volume_group *vg, struct logical_volume *lv);
int vg_add_snapshot(struct volume_group *vg,
struct logical_volume *origin,
struct logical_volume *cow,

View File

@ -36,6 +36,20 @@ int lv_is_cow(struct logical_volume *lv)
return 0;
}
struct snapshot *find_cow(struct volume_group *vg, struct logical_volume *lv)
{
struct list *slh;
struct snapshot *s;
list_iterate (slh, &vg->snapshots) {
s = list_item(slh, struct snapshot_list)->snapshot;
if (s->cow == lv)
return s;
}
return NULL;
}
int vg_add_snapshot(struct volume_group *vg,
struct logical_volume *origin,
struct logical_volume *cow,