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:
parent
6633e1b863
commit
0e32e054df
@ -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,
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user