summaryrefslogtreecommitdiffstats
path: root/daemons/clvmd/lvm-functions.c
diff options
context:
space:
mode:
authorAlasdair Kergon <agk@redhat.com>2010-12-06 17:37:09 +0000
committerAlasdair Kergon <agk@redhat.com>2010-12-06 17:37:09 +0000
commitea7c621b0a63f261c7927f1cdf5b0eff2fb70757 (patch)
tree29ba64f99d93d81bd6c8fe61cd62ce901c647915 /daemons/clvmd/lvm-functions.c
parent98e6fdec8b44f4571543edead1dc4fef46abebdb (diff)
downloadlvm2-ea7c621b0a63f261c7927f1cdf5b0eff2fb70757.tar.gz
lvm2-ea7c621b0a63f261c7927f1cdf5b0eff2fb70757.tar.xz
lvm2-ea7c621b0a63f261c7927f1cdf5b0eff2fb70757.zip
Fix debug logging of derived flag LCK_CACHE in clvmd.
Diffstat (limited to 'daemons/clvmd/lvm-functions.c')
-rw-r--r--daemons/clvmd/lvm-functions.c35
1 files changed, 20 insertions, 15 deletions
diff --git a/daemons/clvmd/lvm-functions.c b/daemons/clvmd/lvm-functions.c
index 7fda9928..5b4a7ee1 100644
--- a/daemons/clvmd/lvm-functions.c
+++ b/daemons/clvmd/lvm-functions.c
@@ -44,11 +44,7 @@ struct lv_info {
int lock_mode;
};
-/*
- * FIXME: 8bit value passed here -
- * so only LCK_XXX defines < 0x100 can be decoded
- */
-static const char *decode_locking_cmd(unsigned char cmdl)
+static const char *decode_full_locking_cmd(uint32_t cmdl)
{
static char buf[128];
const char *type;
@@ -117,11 +113,20 @@ static const char *decode_locking_cmd(unsigned char cmdl)
cmdl & LCK_NONBLOCK ? "|NONBLOCK" : "",
cmdl & LCK_HOLD ? "|HOLD" : "",
cmdl & LCK_LOCAL ? "|LOCAL" : "",
- cmdl & LCK_CLUSTER_VG ? "|CLUSTER_VG" : "");
+ cmdl & LCK_CLUSTER_VG ? "|CLUSTER_VG" : "",
+ cmdl & LCK_CACHE ? "|CACHE" : "");
return buf;
}
+/*
+ * Only processes 8 bits: excludes LCK_CACHE.
+ */
+static const char *decode_locking_cmd(unsigned char cmdl)
+{
+ return decode_full_locking_cmd((uint32_t) cmdl);
+}
+
static const char *decode_flags(unsigned char flags)
{
static char buf[128];
@@ -676,15 +681,6 @@ void do_lock_vg(unsigned char command, unsigned char lock_flags, char *resource)
uint32_t lock_cmd = command;
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;
- }
-
lock_cmd &= (LCK_SCOPE_MASK | LCK_TYPE_MASK | LCK_HOLD);
/*
@@ -693,6 +689,15 @@ void do_lock_vg(unsigned char command, unsigned char lock_flags, char *resource)
if (strncmp(resource, "P_#", 3) && !strncmp(resource, "P_", 2))
lock_cmd |= LCK_CACHE;
+ DEBUGLOG("do_lock_vg: resource '%s', cmd = %s, flags = %s, memlock = %d\n",
+ resource, decode_full_locking_cmd(lock_cmd), 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);
switch (lock_cmd) {
case LCK_VG_COMMIT: