mirror of
git://sourceware.org/git/lvm2.git
synced 2025-03-10 16:58:47 +03:00
Removing locking layer from sync_local_dev_names
the indirection is not needed without clvm
This commit is contained in:
parent
8266b7e951
commit
5e672df6ae
@ -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;
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user