From: David Teigland Date: Fri, 8 Jun 2018 17:15:22 +0000 (-0500) Subject: Removing locking layer from sync_local_dev_names X-Git-Tag: v2_03_00~204 X-Git-Url: https://sourceware.org/git/?a=commitdiff_plain;h=5e672df6aefd5b61129636994d8b5cdc05f651ea;p=lvm2.git Removing locking layer from sync_local_dev_names the indirection is not needed without clvm --- diff --git a/lib/locking/file_locking.c b/lib/locking/file_locking.c index 0bded0e63..6b295e959 100644 --- a/lib/locking/file_locking.c +++ b/lib/locking/file_locking.c @@ -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; diff --git a/lib/locking/locking.c b/lib/locking/locking.c index 7e499bb23..b6bd8d852 100644 --- a/lib/locking/locking.c +++ b/lib/locking/locking.c @@ -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; } diff --git a/lib/locking/locking.h b/lib/locking/locking.h index 96f7d86f0..f6a385953 100644 --- a/lib/locking/locking.h +++ b/lib/locking/locking.h @@ -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;