mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
Update lvmcache VG lock state for all locking types now.
This commit is contained in:
parent
8bf70e11ee
commit
d334793f2a
@ -1,5 +1,6 @@
|
||||
Version 2.02.34 -
|
||||
===================================
|
||||
Update lvmcache VG lock state for all locking types now.
|
||||
Fix output if overriding command_names on cmdline.
|
||||
Add detection of clustered mirror log capability.
|
||||
Add check to vg_commit() ensuring VG lock held before writing new VG metadata.
|
||||
|
@ -21,7 +21,6 @@
|
||||
#include "defaults.h"
|
||||
#include "lvm-file.h"
|
||||
#include "lvm-string.h"
|
||||
#include "lvmcache.h"
|
||||
|
||||
#include <limits.h>
|
||||
#include <unistd.h>
|
||||
@ -222,16 +221,6 @@ static int _file_lock_resource(struct cmd_context *cmd, const char *resource,
|
||||
|
||||
if (!_lock_file(lockfile, flags))
|
||||
return_0;
|
||||
|
||||
switch (flags & LCK_TYPE_MASK) {
|
||||
case LCK_UNLOCK:
|
||||
lvmcache_unlock_vgname(resource);
|
||||
break;
|
||||
default:
|
||||
lvmcache_lock_vgname(resource,
|
||||
(flags & LCK_TYPE_MASK) ==
|
||||
LCK_READ);
|
||||
}
|
||||
break;
|
||||
case LCK_LV:
|
||||
switch (flags & LCK_TYPE_MASK) {
|
||||
|
@ -21,6 +21,7 @@
|
||||
#include "toolcontext.h"
|
||||
#include "memlock.h"
|
||||
#include "defaults.h"
|
||||
#include "lvmcache.h"
|
||||
|
||||
#include <signal.h>
|
||||
#include <sys/stat.h>
|
||||
@ -315,22 +316,29 @@ int check_lvm1_vg_inactive(struct cmd_context *cmd, const char *vgname)
|
||||
*/
|
||||
static int _lock_vol(struct cmd_context *cmd, const char *resource, uint32_t flags)
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
_block_signals(flags);
|
||||
_lock_memory(flags);
|
||||
|
||||
assert(resource);
|
||||
|
||||
if (!(_locking.lock_resource(cmd, resource, flags))) {
|
||||
_unlock_memory(flags);
|
||||
_unblock_signals();
|
||||
return 0;
|
||||
if ((ret = _locking.lock_resource(cmd, resource, flags))) {
|
||||
if ((flags & LCK_SCOPE_MASK) == LCK_VG) {
|
||||
if ((flags & LCK_TYPE_MASK) == LCK_UNLOCK)
|
||||
lvmcache_unlock_vgname(resource);
|
||||
else
|
||||
lvmcache_lock_vgname(resource, (flags & LCK_TYPE_MASK)
|
||||
== LCK_READ);
|
||||
}
|
||||
|
||||
_update_vg_lock_count(flags);
|
||||
}
|
||||
|
||||
_update_vg_lock_count(flags);
|
||||
_unlock_memory(flags);
|
||||
_unblock_signals();
|
||||
|
||||
return 1;
|
||||
return ret;
|
||||
}
|
||||
|
||||
int lock_vol(struct cmd_context *cmd, const char *vol, uint32_t flags)
|
||||
|
@ -18,7 +18,6 @@
|
||||
#include "locking_types.h"
|
||||
#include "lvm-string.h"
|
||||
#include "activate.h"
|
||||
#include "lvmcache.h"
|
||||
|
||||
#include <signal.h>
|
||||
|
||||
@ -41,15 +40,6 @@ static int _no_lock_resource(struct cmd_context *cmd, const char *resource,
|
||||
{
|
||||
switch (flags & LCK_SCOPE_MASK) {
|
||||
case LCK_VG:
|
||||
switch (flags & LCK_TYPE_MASK) {
|
||||
case LCK_UNLOCK:
|
||||
lvmcache_unlock_vgname(resource);
|
||||
break;
|
||||
default:
|
||||
lvmcache_lock_vgname(resource,
|
||||
(flags & LCK_TYPE_MASK) ==
|
||||
LCK_READ);
|
||||
}
|
||||
break;
|
||||
case LCK_LV:
|
||||
switch (flags & LCK_TYPE_MASK) {
|
||||
|
Loading…
Reference in New Issue
Block a user