master - liblvm: Moved additional pv resize code
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=50db109e2068d8d5645bd4117b6022acf4b7f8ba Commit: 50db109e2068d8d5645bd4117b6022acf4b7f8ba Parent: 40feaa7bbeaca9a89f9b8e87b684c457cd10aa57 Author: Tony Asleson <[email protected]> AuthorDate: Fri Jun 28 17:25:28 2013 -0400 Committer: Tony Asleson <[email protected]> CommitterDate: Tue Jul 2 14:24:34 2013 -0500
liblvm: Moved additional pv resize code
The pv resize code required that a lvm_vg_write be done to commit the change. When the method to add the ability to list all PVs, including ones that are not assocated with a VG we had no way for the user to make the change persistent. Thus additional resize code was move and now liblvm calls into a resize function that does indeed write the changes out, thus not requiring the user to explicitly write out he changes.
Signed-off-by Tony Asleson <[email protected]>
--- lib/metadata/metadata-exported.h | 8 ++- lib/metadata/metadata.c | 5 ++ lib/metadata/pv_manip.c | 115 +++++++++++++++++++++++++++++++++++++- liblvm/lvm_pv.c | 2 +- tools/pvresize.c | 112 +------------------------------------ 5 files changed, 127 insertions(+), 115 deletions(-)
lib/metadata/metadata-exported.h +6 -2
@@ -560,8 +560,12 @@ struct physical_volume *pv_create(const struct cmd_context *cmd,uint64_t pvmetadatasize, unsigned metadataignore, struct pvcreate_restorable_params *rp); -int pv_resize (struct physical_volume *pv,struct volume_group *vg, -uint64_t size); + +int pv_resize_single (struct cmd_context *cmd, +struct volume_group *vg, +struct physical_volume *pv, +const uint64_t new_size); +int pv_analyze (struct cmd_context *cmd,const char *pv_name,uint64_t label_sector);
lib/metadata/metadata.c +5 -0
@@ -3755,6 +3755,11 @@ static int _get_pvs(struct cmd_context *cmd, int warnings,*/ if (!vgslist) { pvl_copy->pv->vg =NULL ; + }else { +/* Make sure the vg mode indicates writeable */ +/* We should rework this function to take a parameter */ +/* so that we could control this ... */ + pvl_copy->pv->vg->open_mode ='w' ; } have_pv =1 ;dm_list_add (pvslist, &pvl_copy->list);
lib/metadata/pv_manip.c +113 -2
139 lines not on this page · raw message
liblvm/lvm_pv.c +1 -1
@@ -219,7 +219,7 @@ int lvm_pv_resize(const pv_t pv, uint64_t new_size)return -1 ; } -if (!pv_resize (pv, pv->vg, size)) { +if (!pv_resize_single (pv->vg->cmd, pv->vg, pv, size)) {log_error ("PV re-size failed!" );return -1 ; }else {
tools/pvresize.c +2 -110
130 lines not on this page · raw message