1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-18 10:04:20 +03:00

Maintain snapshot_count correctly.

This commit is contained in:
Alasdair Kergon 2002-12-05 22:30:39 +00:00
parent 3982f8136b
commit 8a95d67e26

View File

@ -137,6 +137,7 @@ int vg_add_snapshot(struct logical_volume *origin,
cow->status &= ~VISIBLE_LV; cow->status &= ~VISIBLE_LV;
sl->snapshot = s; sl->snapshot = s;
list_add(&origin->vg->snapshots, &sl->list); list_add(&origin->vg->snapshots, &sl->list);
origin->vg->snapshot_count++;
return 1; return 1;
} }
@ -151,6 +152,7 @@ int vg_remove_snapshot(struct volume_group *vg, struct logical_volume *cow)
if (sl->snapshot->cow == cow) { if (sl->snapshot->cow == cow) {
list_del(slh); list_del(slh);
vg->snapshot_count--;
return 1; return 1;
} }
} }