summaryrefslogtreecommitdiffstats
path: root/lib/locking/file_locking.c
diff options
context:
space:
mode:
authorAlasdair Kergon <agk@redhat.com>2010-08-17 19:25:05 +0000
committerAlasdair Kergon <agk@redhat.com>2010-08-17 19:25:05 +0000
commit22149572e8a05492316bf74dee681a3a948bd2b1 (patch)
tree72aadf89125169394805e364d59bba0c2a52195e /lib/locking/file_locking.c
parent2d6fcbf67d131c7969bd60798b2bfe3cc2316205 (diff)
downloadlvm2-22149572e8a05492316bf74dee681a3a948bd2b1.tar.gz
lvm2-22149572e8a05492316bf74dee681a3a948bd2b1.tar.xz
lvm2-22149572e8a05492316bf74dee681a3a948bd2b1.zip
Use 'SINGLENODE' instead of 'dead' in clvmd singlenode messages.
Ignore snapshots when performing mirror recovery beneath an origin. Pass LCK_ORIGIN_ONLY flag around cluster. Add suspend_lv_origin and resume_lv_origin using LCK_ORIGIN_ONLY.
Diffstat (limited to 'lib/locking/file_locking.c')
-rw-r--r--lib/locking/file_locking.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/lib/locking/file_locking.c b/lib/locking/file_locking.c
index 5972fdf7..ed1ccd57 100644
--- a/lib/locking/file_locking.c
+++ b/lib/locking/file_locking.c
@@ -254,6 +254,7 @@ static int _file_lock_resource(struct cmd_context *cmd, const char *resource,
uint32_t flags)
{
char lockfile[PATH_MAX];
+ unsigned origin_only = (flags & LCK_ORIGIN_ONLY) ? 1 : 0;
switch (flags & LCK_SCOPE_MASK) {
case LCK_VG:
@@ -278,9 +279,8 @@ static int _file_lock_resource(struct cmd_context *cmd, const char *resource,
case LCK_LV:
switch (flags & LCK_TYPE_MASK) {
case LCK_UNLOCK:
- log_very_verbose("Unlocking LV %s", resource);
- // FIXME Set origin_only
- if (!lv_resume_if_active(cmd, resource, 0))
+ log_very_verbose("Unlocking LV %s%s", resource, origin_only ? " without snapshots" : "");
+ if (!lv_resume_if_active(cmd, resource, origin_only))
return 0;
break;
case LCK_NULL:
@@ -297,9 +297,8 @@ static int _file_lock_resource(struct cmd_context *cmd, const char *resource,
log_very_verbose("Locking LV %s (PR) - ignored", resource);
break;
case LCK_WRITE:
- log_very_verbose("Locking LV %s (W)", resource);
- // FIXME Set origin_only
- if (!lv_suspend_if_active(cmd, resource, 0))
+ log_very_verbose("Locking LV %s (W)%s", resource, origin_only ? " without snapshots" : "");
+ if (!lv_suspend_if_active(cmd, resource, origin_only))
return 0;
break;
case LCK_EXCL: