dlm: master - dlm_controld: fix build with old (< 3.0) kernel headers (take 2)
Fabio M. Di Nitto
fabbione at fedoraproject.org
Wed Aug 24 06:41:13 UTC 2011
Gitweb: http://git.fedorahosted.org/git/dlm.git?p=dlm.git;a=commitdiff;h=476b8ebba327d27e4610b513817aa3ebb6fbb6fd
Commit: 476b8ebba327d27e4610b513817aa3ebb6fbb6fd
Parent: 297eb3800e2b24b764d2bc8483d2ef72b40a0779
Author: Fabio M. Di Nitto <fdinitto at redhat.com>
AuthorDate: Wed Aug 24 08:35:33 2011 +0200
Committer: Fabio M. Di Nitto <fdinitto at redhat.com>
CommitterDate: Wed Aug 24 08:40:58 2011 +0200
dlm_controld: fix build with old (< 3.0) kernel headers (take 2)
Signed-off-by: Fabio M. Di Nitto <fdinitto at 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 12f35de..f8d6b02 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;
@@ -785,12 +794,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) {
@@ -1641,7 +1645,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));
}
More information about the cluster-commits
mailing list