Gitweb:
http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: cddeef5a35a6c4be8ab351079d77b953d3b6db83
Parent: 98040b3146d843402026e3918e6ac563c4687919
Author: Fabio M. Di Nitto <fdinitto(a)redhat.com>
AuthorDate: Wed Aug 24 08:35:33 2011 +0200
Committer: Fabio M. Di Nitto <fdinitto(a)redhat.com>
CommitterDate: Wed Aug 24 08:35:33 2011 +0200
dlm_controld: fix build with old (< 3.0) kernel headers (take 2)
Signed-off-by: Fabio M. Di Nitto <fdinitto(a)redhat.com>
---
group/dlm_controld/plock.c | 20 ++++++++++++++------
1 files changed, 14 insertions(+), 6 deletions(-)
diff --git a/group/dlm_controld/plock.c b/group/dlm_controld/plock.c
index a22a21a..fbfe1b0 100644
--- a/group/dlm_controld/plock.c
+++ b/group/dlm_controld/plock.c
@@ -3,6 +3,15 @@
#include <linux/dlm_plock.h>
+/* FIXME: remove this once everyone is using the version of
+ * dlm_plock.h which defines it */
+
+#ifndef DLM_PLOCK_FL_CLOSE
+#warning DLM_PLOCK_FL_CLOSE undefined. Enabling build workaround.
+#define DLM_PLOCK_FL_CLOSE 1
+#define DLM_PLOCK_BUILD_WORKAROUND 1
+#endif
+
static uint32_t plock_read_count;
static uint32_t plock_recv_count;
static uint32_t plock_rate_delays;
@@ -737,12 +746,7 @@ static void do_unlock(struct lockspace *ls, struct dlm_plock_info
*in,
rv = unlock_internal(ls, r, in);
-/* FIXME: remove this once everyone is using the version of
- * dlm_plock.h which defines it */
-
-#ifndef DLM_PLOCK_FL_CLOSE
-#warning DLM_PLOCK_FL_CLOSE undefined. Enabling build workaround.
-#define DLM_PLOCK_FL_CLOSE 1
+#ifdef DLM_PLOCK_BUILD_WORKAROUND
if (in->pad & DLM_PLOCK_FL_CLOSE) {
#else
if (in->flags & DLM_PLOCK_FL_CLOSE) {
@@ -1592,7 +1596,11 @@ void process_plocks(int ci)
return;
fail:
+#ifdef DLM_PLOCK_BUILD_WORKAROUND
+ if (!(info.pad & DLM_PLOCK_FL_CLOSE)) {
+#else
if (!(info.flags & DLM_PLOCK_FL_CLOSE)) {
+#endif
info.rv = rv;
rv = write(plock_device_fd, &info, sizeof(info));
}