master - activation: Pass both ondisk and incore LV to suspend.
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=7d644443e0f496f1cc34a5b2a9c66e96b3160b97 Commit: 7d644443e0f496f1cc34a5b2a9c66e96b3160b97 Parent: 2cce2f67abf488eaed94902d415dd6f106c84229 Author: Petr Rockai <[email protected]> AuthorDate: Wed Mar 20 00:00:11 2013 +0100 Committer: Petr Rockai <[email protected]> CommitterDate: Mon Jun 10 17:26:38 2013 +0200
activation: Pass both ondisk and incore LV to suspend.
--- daemons/clvmd/lvm-functions.c | 2 +- lib/activate/activate.c | 71 +++++++++++++++++++++-------------------- lib/activate/activate.h | 2 +- lib/locking/file_locking.c | 2 +- lib/locking/no_locking.c | 4 +- 5 files changed, 41 insertions(+), 40 deletions(-)
daemons/clvmd/lvm-functions.c +1 -1
@@ -450,7 +450,7 @@ static int do_suspend_lv(char *resource, unsigned char command, unsigned char lo exclusive = (oldmode ==LCK_EXCL ) ?1 :0 ;/* Always call lv_suspend to read commited and precommited data */ -if (!lv_suspend_if_active (cmd, resource, origin_only, exclusive,NULL )) +if (!lv_suspend_if_active (cmd, resource, origin_only, exclusive,NULL ,NULL ))return EIO ;return 0 ;
lib/activate/activate.c +36 -35
186 lines not on this page · raw message
lib/activate/activate.h +1 -1
@@ -75,7 +75,7 @@ void activation_release(void);void activation_exit (void );/* int lv_suspend(struct cmd_context *cmd, const char *lvid_s); */ -int lv_suspend_if_active (struct cmd_context *cmd,const char *lvid_s,unsigned origin_only,unsigned exclusive,struct logical_volume *lv); +int lv_suspend_if_active (struct cmd_context *cmd,const char *lvid_s,unsigned origin_only,unsigned exclusive,struct logical_volume *lv_ondisk,struct logical_volume *lv_incore);int lv_resume (struct cmd_context *cmd,const char *lvid_s,unsigned origin_only,struct logical_volume *lv);int lv_resume_if_active (struct cmd_context *cmd,const char *lvid_s,unsigned origin_only,unsigned exclusive,unsigned revert,struct logical_volume *lv);
lib/locking/file_locking.c +1 -1
@@ -313,7 +313,7 @@ static int _file_lock_resource(struct cmd_context *cmd, const char *resource,break ;case LCK_WRITE :log_very_verbose ("Locking LV %s (W)%s" , resource, origin_only ?" without snapshots" :"" ); -if (!lv_suspend_if_active (cmd, resource, origin_only,0 ,lv_ondisk (lv))) +if (!lv_suspend_if_active (cmd, resource, origin_only,0 ,lv_ondisk (lv), lv))return 0 ;break ;case LCK_EXCL :
lib/locking/no_locking.c +2 -2
@@ -46,11 +46,11 @@ static int _no_lock_resource(struct cmd_context *cmd, const char *resource,case LCK_NULL :return lv_deactivate (cmd, resource,lv_ondisk (lv));case LCK_UNLOCK : -return lv_resume_if_active (cmd, resource, (flags &LCK_ORIGIN_ONLY ) ?1 :0 ,0 , (flags &LCK_REVERT ) ?1 :0 ,NULL ); +return lv_resume_if_active (cmd, resource, (flags &LCK_ORIGIN_ONLY ) ?1 :0 ,0 , (flags &LCK_REVERT ) ?1 :0 ,lv_ondisk (lv));case LCK_READ :return lv_activate_with_filter (cmd, resource,0 ,lv_ondisk (lv));case LCK_WRITE : -return lv_suspend_if_active (cmd, resource, (flags &LCK_ORIGIN_ONLY ) ?1 :0 ,0 , lv); +return lv_suspend_if_active (cmd, resource, (flags &LCK_ORIGIN_ONLY ) ?1 :0 ,0 ,lv_ondisk (lv), lv);case LCK_EXCL :return lv_activate_with_filter (cmd, resource,1 ,lv_ondisk (lv));default :