1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-02-27 01:57:55 +03:00

Update lvm_vg_write() to handle the deferred commit of lvm_vg_write().

Now that we've refactored the internal library functions that do the
vg_remove, we can handle the deferred commit of a lvm_vg_remove() inside
lvm_vg_write().  This makes the VG create/remove API more consistent in
terms of disk commits - they now both require an lvm_vg_write() to commit
the create or remove to disk.

Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>


Author: Dave Wysochanski <dwysocha@redhat.com>
This commit is contained in:
Dave Wysochanski 2009-09-02 21:40:10 +00:00
parent eaefa1ac5d
commit 202aea4dda
3 changed files with 6 additions and 7 deletions

View File

@ -1,5 +1,6 @@
Version 2.02.52 -
=================================
Update lvm_vg_remove to require lvm_vg_write to commit remove to disk.
Enforce an alphabetical lock ordering for vgname locks.
Refactor vgsplit, vgmerge, and vgrename to obey vgname ordering rules.
Implement write lock prioritisation for file locking and make it default.

View File

@ -394,8 +394,8 @@ int lvm_vg_write(vg_t vg);
/**
* Remove a VG from the system.
*
* This function commits the change to disk and does not require calling
* lvm_vg_write.
* This function removes a Volume Group object in memory, and requires
* calling lvm_vg_write to commit the removal to disk.
*
* \param vg
* VG handle obtained from lvm_vg_create or lvm_vg_open.

View File

@ -106,9 +106,9 @@ int lvm_vg_write(vg_t vg)
return -1;
if (dm_list_empty(&vg->pvs)) {
log_error("Volume group %s does not contain any "
"physical volumes.", vg->name);
return -1;
if (!vg_remove(vg))
return -1;
return 0;
}
if (! dm_list_empty(&vg->removed_pvs)) {
@ -156,8 +156,6 @@ int lvm_vg_remove(vg_t vg)
if (!vg_remove_check(vg))
return -1;
if (!vg_remove(vg))
return -1;
return 0;
}