summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZdenek Kabelac <zkabelac@redhat.com>2015-10-22 10:43:58 +0200
committerZdenek Kabelac <zkabelac@redhat.com>2015-10-22 22:26:27 +0200
commit7b78d496bf4e80dab82824a70b1d1d852e7cc1fb (patch)
treedcdc5b5f9ed4c6e5189831c595a95df18dc71f2f
parent19e272ba53a51a0f3103e1d5e04d06b6207f0acc (diff)
downloadlvm2-7b78d496bf4e80dab82824a70b1d1d852e7cc1fb.tar.gz
memlock: report memlock daemon counter
Add internal memlock_count_daemon(). Function can be used to recognize it's being executed from daemon restricted execution inside /lib code.
-rw-r--r--WHATS_NEW1
-rw-r--r--lib/mm/memlock.c5
-rw-r--r--lib/mm/memlock.h1
3 files changed, 7 insertions, 0 deletions
diff --git a/WHATS_NEW b/WHATS_NEW
index ece92e07a..8ffbecaf2 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.133 -
======================================
+ Support checking of memlock daemon counter.
Allow all log levels to be used with the lvmetad -l option.
Add optional shutdown when idle support for lvmetad.
Fix missing in-sync progress info while lvconvert used with lvmpolld.
diff --git a/lib/mm/memlock.c b/lib/mm/memlock.c
index 60686ea5f..34a6efff5 100644
--- a/lib/mm/memlock.c
+++ b/lib/mm/memlock.c
@@ -638,3 +638,8 @@ void memlock_unlock(struct cmd_context *cmd)
}
#endif
+
+int memlock_count_daemon()
+{
+ return _memlock_count_daemon;
+}
diff --git a/lib/mm/memlock.h b/lib/mm/memlock.h
index aab9c859c..3ec5ed865 100644
--- a/lib/mm/memlock.h
+++ b/lib/mm/memlock.h
@@ -36,6 +36,7 @@ void critical_section_dec(struct cmd_context *cmd, const char *reason);
int critical_section(void);
void memlock_inc_daemon(struct cmd_context *cmd);
void memlock_dec_daemon(struct cmd_context *cmd);
+int memlock_count_daemon(void);
void memlock_init(struct cmd_context *cmd);
void memlock_reset(void);
void memlock_unlock(struct cmd_context *cmd);