mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-03 05:18:29 +03:00
more cleanup
This commit is contained in:
parent
98fd1ce332
commit
3dfd8f12dc
@ -119,7 +119,7 @@ int do_command(struct local_client *client, struct clvm_header *msg, int msglen,
|
||||
/* Check to see if the VG is in use by LVM1 */
|
||||
status = do_check_lvm1(lockname);
|
||||
/* P_#global causes a full cache refresh */
|
||||
if (!strcmp(lockname, "P_#global"))
|
||||
if (!strcmp(lockname, "P_" VG_GLOBAL))
|
||||
do_refresh_cache();
|
||||
else
|
||||
drop_metadata(lockname + 2);
|
||||
|
@ -472,8 +472,8 @@ static void drop_vg_locks()
|
||||
popen
|
||||
("lvm pvs --config 'log{command_names=0 prefix=\"\"}' --nolocking --noheadings -o vg_name", "r");
|
||||
|
||||
sync_unlock("P_#orphans", LCK_EXCL);
|
||||
sync_unlock("P_#global", LCK_EXCL);
|
||||
sync_unlock("P_" VG_ORPHANS, LCK_EXCL);
|
||||
sync_unlock("P_" VG_GLOBAL, LCK_EXCL);
|
||||
|
||||
if (!vgs)
|
||||
return;
|
||||
|
@ -210,10 +210,14 @@ static int _file_lock_resource(struct cmd_context *cmd, const char *resource,
|
||||
|
||||
switch (flags & LCK_SCOPE_MASK) {
|
||||
case LCK_VG:
|
||||
if (flags & LCK_CACHE) {
|
||||
/* Skip cache refresh for VG_GLOBAL - the caller handles it */
|
||||
if (strcmp(resource, VG_GLOBAL))
|
||||
lvmcache_drop_metadata(resource);
|
||||
|
||||
/* LCK_CACHE does not require a real lock */
|
||||
if (flags & LCK_CACHE)
|
||||
break;
|
||||
}
|
||||
|
||||
if (*resource == '#')
|
||||
dm_snprintf(lockfile, sizeof(lockfile),
|
||||
"%s/P_%s", _lock_dir, resource + 1);
|
||||
|
@ -27,9 +27,11 @@ int locking_is_clustered(void);
|
||||
|
||||
/*
|
||||
* LCK_VG:
|
||||
* Lock/unlock on-disk volume group data
|
||||
* Use VG_ORPHANS to lock orphan PVs
|
||||
* char *vol holds volume group name
|
||||
* Lock/unlock on-disk volume group data.
|
||||
* Use VG_ORPHANS to lock all orphan PVs.
|
||||
* Use VG_GLOBAL as a global lock and to wipe the internal cache.
|
||||
* char *vol holds volume group name.
|
||||
* Set the LCK_CACHE flag to invalidate 'vol' in the internal cache.
|
||||
*
|
||||
* LCK_LV:
|
||||
* Lock/unlock an individual logical volume
|
||||
@ -37,6 +39,13 @@ int locking_is_clustered(void);
|
||||
*/
|
||||
int lock_vol(struct cmd_context *cmd, const char *vol, uint32_t flags);
|
||||
|
||||
/*
|
||||
* Internal locking representation.
|
||||
* LCK_VG: Uses prefix V_ unless the vol begins with # (i.e. #global or #orphans)
|
||||
* or the LCK_CACHE flag is set when it uses the prefix P_.
|
||||
* If LCK_CACHE is set, we do not take out a real lock.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Does the LVM1 driver have this VG active?
|
||||
*/
|
||||
@ -69,7 +78,7 @@ int check_lvm1_vg_inactive(struct cmd_context *cmd, const char *vgname);
|
||||
#define LCK_HOLD 0x00000020U /* Hold lock when lock_vol returns? */
|
||||
#define LCK_LOCAL 0x00000040U /* Don't propagate to other nodes */
|
||||
#define LCK_CLUSTER_VG 0x00000080U /* VG is clustered */
|
||||
#define LCK_CACHE 0x00000100U /* Operation on cache using P_ lock */
|
||||
#define LCK_CACHE 0x00000100U /* Operation on cache only using P_ lock */
|
||||
|
||||
/*
|
||||
* Additional lock bits for cluster communication
|
||||
|
Loading…
Reference in New Issue
Block a user