mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
Move processing of VG locks to separate function (similar to LV locks).
And print some debugging info. No functional change in this patch.
This commit is contained in:
parent
d7f44761ab
commit
ac85c2e75b
@ -1,5 +1,6 @@
|
||||
Version 2.02.57 -
|
||||
====================================
|
||||
Move processing of VG locks to separate function in clvmd.
|
||||
Properly decode flags even for VG locks.
|
||||
Properly handle precommitted flag in cache when commited data only present.
|
||||
Resume renamed volumes in reverse order to preserve memlock pairing.
|
||||
|
@ -119,15 +119,12 @@ int do_command(struct local_client *client, struct clvm_header *msg, int msglen,
|
||||
break;
|
||||
|
||||
case CLVMD_CMD_LOCK_VG:
|
||||
lock_cmd = args[0];
|
||||
lock_flags = args[1];
|
||||
lockname = &args[2];
|
||||
/* 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_" VG_GLOBAL))
|
||||
do_refresh_cache();
|
||||
else
|
||||
drop_metadata(lockname + 2);
|
||||
|
||||
do_lock_vg(lock_cmd, lock_flags, lockname);
|
||||
break;
|
||||
|
||||
case CLVMD_CMD_LOCK_LV:
|
||||
|
@ -676,12 +676,23 @@ static void drop_vg_locks()
|
||||
}
|
||||
|
||||
/*
|
||||
* Drop lvmcache metadata
|
||||
* Handle VG lock - drop metadata or update lvmcache state
|
||||
*/
|
||||
void drop_metadata(const char *vgname)
|
||||
void do_lock_vg(unsigned char command, unsigned char lock_flags, char *resource)
|
||||
{
|
||||
DEBUGLOG("Dropping metadata for VG %s\n", vgname);
|
||||
char *vgname = resource + 2;
|
||||
|
||||
DEBUGLOG("do_lock_vg: resource '%s', cmd = %s, flags = %s, memlock = %d\n",
|
||||
resource, decode_locking_cmd(command), decode_flags(lock_flags), memlock());
|
||||
|
||||
/* P_#global causes a full cache refresh */
|
||||
if (!strcmp(resource, "P_" VG_GLOBAL)) {
|
||||
do_refresh_cache();
|
||||
return;
|
||||
}
|
||||
|
||||
pthread_mutex_lock(&lvm_lock);
|
||||
DEBUGLOG("Dropping metadata for VG %s\n", vgname);
|
||||
lvmcache_drop_metadata(vgname);
|
||||
pthread_mutex_unlock(&lvm_lock);
|
||||
}
|
||||
|
@ -35,6 +35,7 @@ extern void lvm_do_backup(const char *vgname);
|
||||
extern int hold_unlock(char *resource);
|
||||
extern int hold_lock(char *resource, int mode, int flags);
|
||||
extern char *get_last_lvm_error(void);
|
||||
extern void drop_metadata(const char *vgname);
|
||||
extern void do_lock_vg(unsigned char command, unsigned char lock_flags,
|
||||
char *resource);
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user