diff options
author | Alasdair Kergon <agk@redhat.com> | 2009-04-25 01:17:59 +0000 |
---|---|---|
committer | Alasdair Kergon <agk@redhat.com> | 2009-04-25 01:17:59 +0000 |
commit | 87f42fda5eddb8c8fed00bb51ac4ec6619232b3e (patch) | |
tree | 0f84ddfef8da35a7c317b9197145fcb39ac2e990 /lib/metadata/snapshot_manip.c | |
parent | 7f54ef36dcd495ffd87690a3240d9987e7a04ca7 (diff) | |
download | lvm2-87f42fda5eddb8c8fed00bb51ac4ec6619232b3e.tar.gz lvm2-87f42fda5eddb8c8fed00bb51ac4ec6619232b3e.tar.xz lvm2-87f42fda5eddb8c8fed00bb51ac4ec6619232b3e.zip |
Add sparse devices: lvcreate -s --virtualoriginsize (hidden zero origin).
Add lvs origin_size field.
Fix linux configure --enable-debug to exclude -O2.
Still a few rough edges, but hopefully usable now:
lvcreate -s vg1 -L 100M --virtualoriginsize 1T
Diffstat (limited to 'lib/metadata/snapshot_manip.c')
-rw-r--r-- | lib/metadata/snapshot_manip.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/metadata/snapshot_manip.c b/lib/metadata/snapshot_manip.c index 39553820..1189dbdb 100644 --- a/lib/metadata/snapshot_manip.c +++ b/lib/metadata/snapshot_manip.c @@ -44,6 +44,12 @@ int lv_is_displayable(const struct logical_volume *lv) return (lv->status & VISIBLE_LV) || lv_is_cow(lv) ? 1 : 0; } +int lv_is_virtual_origin(const struct logical_volume *lv) +{ + return (lv->status & VIRTUAL_ORIGIN) ? 1 : 0; +} + + /* Given a cow LV, return the snapshot lv_segment that uses it */ struct lv_segment *find_cow(const struct logical_volume *lv) { @@ -105,6 +111,10 @@ int vg_add_snapshot(const char *name, struct logical_volume *origin, cow->status &= ~VISIBLE_LV; + /* FIXME Assumes an invisible origin belongs to a sparse device */ + if (!lv_is_visible(origin)) + origin->status |= VIRTUAL_ORIGIN; + dm_list_add(&origin->snapshot_segs, &seg->origin_list); return 1; |