Create backup_changed_vg() liblvm function to avoid clvmd needing vg_read().
PATCH 1/1 Create backup_changed_vg() liblvm function to avoid clvmd needing vg_read().
Should be no functional change and should apply cleanly on Petr's patch 13 from 1/22/09:
Date: Thu Jan 22 11:10:09 2009 +0100
Remove now-unused vg_lock_and_read.
Move guts of lvm_do_backup() function in clvmd into the library. This allows us to avoid having clvmd to require linking against vg_read() symbol.
Signed-off-by Dave Wysochanski <[email protected]>
--- daemons/clvmd/lvm-functions.c | 15 +++------------ lib/format_text/archiver.c | 17 +++++++++++++++++ lib/format_text/archiver.h | 2 ++ 3 files changed, 22 insertions(+), 12 deletions(-)
daemons/clvmd/lvm-functions.c +3 -12
@@ -706,19 +706,10 @@ void init_lvhash()/* Backups up the LVM metadata if it's changed */ void lvm_do_backup (const char *vgname) { -struct volume_group * vg; -int consistent =0 ; +DEBUGLOG ("Triggering backup of VG metadata for %s. suspended=%d\n" , + vgname, suspended); -DEBUGLOG ("Triggering backup of VG metadata for %s. suspended=%d\n" , vgname, suspended); - - vg =vg_read_internal (cmd, vgname,NULL /*vgid*/ , &consistent); -if (vg) { -if (consistent) -check_current_backup (vg); - } -else { -log_error ("Error backing up metadata, can't find VG for group %s" , vgname); - } +backup_changed_vg (cmd, vgname); }/* Called to initialise the LVM context of the daemon */
lib/format_text/archiver.c +17 -0
@@ -414,3 +414,20 @@ void check_current_backup(struct volume_group *vg)archive (vg);backup (vg); } + +/* Backups up the LVM metadata if it's changed */ +void backup_changed_vg (struct cmd_context *cmd,const char *vgname) +{ +struct volume_group * vg; +int consistent =0 ; + + vg =vg_read_internal (cmd, vgname,NULL /*vgid*/ , &consistent); +if (vg) { +if (consistent) +check_current_backup (vg); + } +else { +log_error ("Error backing up metadata, can't find VG for group %s" , vgname); + } +} +
lib/format_text/archiver.h +2 -0
@@ -59,4 +59,6 @@ int backup_to_file(const char *file, const char *desc, struct volume_group *vg);void check_current_backup (struct volume_group *vg); +void backup_changed_vg (struct cmd_context *cmd,const char *vgname); +#endif
Signature · 1 line
1.5.5.1