master - Removing locking layer from sync_local_dev_names
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=5e672df6aefd5b61129636994d8b5cdc05f651ea Commit: 5e672df6aefd5b61129636994d8b5cdc05f651ea Parent: 8266b7e951427de997b5b89d8ac8af8bf011c52e Author: David Teigland <[email protected]> AuthorDate: Fri Jun 8 12:15:22 2018 -0500 Committer: David Teigland <[email protected]> CommitterDate: Fri Jun 8 12:18:57 2018 -0500
Removing locking layer from sync_local_dev_names
the indirection is not needed without clvm
--- lib/locking/file_locking.c | 3 --- lib/locking/locking.c | 11 ++--------- lib/locking/locking.h | 7 +------ 3 files changed, 3 insertions(+), 18 deletions(-)
lib/locking/file_locking.c +0 -3
@@ -47,9 +47,6 @@ static int _file_lock_resource(struct cmd_context *cmd, const char *resource,switch (flags &LCK_SCOPE_MASK ) {case LCK_VG : -if (!strcmp (resource,VG_SYNC_NAMES )) -fs_unlock (); -/* LCK_CACHE does not require a real lock */ if (flags &LCK_CACHE )break ;
lib/locking/locking.c +2 -9
@@ -312,14 +312,7 @@ int locking_is_clustered(void)int sync_local_dev_names (struct cmd_context * cmd) {memlock_unlock (cmd); - -return lock_vol (cmd,VG_SYNC_NAMES ,LCK_VG_SYNC_LOCAL ,NULL ); -} - -int sync_dev_names (struct cmd_context * cmd) -{ -memlock_unlock (cmd); - -return lock_vol (cmd,VG_SYNC_NAMES ,LCK_VG_SYNC ,NULL ); +fs_unlock (); +return 1 ; }
lib/locking/locking.h +1 -6
@@ -129,7 +129,6 @@ int check_lvm1_vg_inactive(struct cmd_context *cmd, const char *vgname);*/ #define VG_ORPHANS "#orphans"#define VG_GLOBAL "#global" -#define VG_SYNC_NAMES "#sync_names"/* * Common combinations
@@ -147,16 +146,13 @@ int check_lvm1_vg_inactive(struct cmd_context *cmd, const char *vgname);#define LCK_VG_BACKUP (LCK_VG | LCK_CACHE) -#define LCK_VG_SYNC (LCK_NONE | LCK_CACHE) -#define LCK_VG_SYNC_LOCAL (LCK_NONE | LCK_CACHE | LCK_LOCAL) -#define LCK_MASK (LCK_TYPE_MASK | LCK_SCOPE_MASK)#define unlock_vg (cmd, vg, vol) \ do { \ if (vg && !lvmetad_vg_update_finish(vg)) \ stack; \ - if (is_real_vg(vol) && !sync_dev_names(cmd)) \ + if (is_real_vg(vol) && !sync_local_dev_names(cmd)) \ stack; \ if (!lock_vol(cmd, vol, LCK_VG_UNLOCK, NULL)) \ stack; \
@@ -171,7 +167,6 @@ int check_lvm1_vg_inactive(struct cmd_context *cmd, const char *vgname); lock_vol((vg)->cmd, (vg)->name, LCK_VG_DROP_CACHE, NULL)int sync_local_dev_names (struct cmd_context * cmd); -int sync_dev_names (struct cmd_context * cmd);/* Process list of LVs */ struct volume_group ;