[Ocfs2-devel] [PATCH 03/11] ocfs2: Handle missing dlmconstants.h

Sunil Mushran sunil.mushran at oracle.com
Wed Nov 11 12:44:56 PST 2009


Mainline commit d69a3ad6a0e47b2aa9b2b2ddfd385752132a4d34 split
lock mode and flag constants from dlm.h into a sharable header,
dlmconstants.h.

This patch adds a header with the same name that merely includes
dlm.h.

Signed-off-by: Sunil Mushran <sunil.mushran at oracle.com>
---
 Config.make.in                     |    1 +
 Makefile                           |    3 ++-
 configure.in                       |    6 ++++++
 fs/ocfs2/Makefile                  |    4 ++++
 fs/ocfs2/stackglue.h               |    2 ++
 kapi-compat/include/dlmconstants.h |    9 +++++++++
 6 files changed, 24 insertions(+), 1 deletions(-)
 create mode 100644 kapi-compat/include/dlmconstants.h

diff --git a/Config.make.in b/Config.make.in
index cf292b6..33b7a89 100644
--- a/Config.make.in
+++ b/Config.make.in
@@ -58,6 +58,7 @@ MAKEBO_VERSION = @VERSION@
 EXTRA_CFLAGS += @KAPI_COMPAT_CFLAGS@
 
 NO_DELAYED_WORK_STRUCT = @NO_DELAYED_WORK_STRUCT@
+NO_DLMCONSTANTS_HEADER = @NO_DLMCONSTANTS_HEADER@
 
 
 OCFS_DEBUG = @OCFS_DEBUG@
diff --git a/Makefile b/Makefile
index 262bc49..d038ae9 100644
--- a/Makefile
+++ b/Makefile
@@ -9,7 +9,8 @@ SUBDIRS = fs vendor
 LINUX_INCLUDE_FILES =
 
 KAPI_COMPAT_FILES = \
-	kapi-compat/include/workqueue.h
+	kapi-compat/include/workqueue.h			\
+	kapi-compat/include/dlmconstants.h
 
 PATCH_FILES =
 
diff --git a/configure.in b/configure.in
index e4628a7..3528514 100644
--- a/configure.in
+++ b/configure.in
@@ -164,6 +164,12 @@ OCFS2_CHECK_KERNEL([struct delayed_work in workqueue.h], workqueue.h,
 AC_SUBST(NO_DELAYED_WORK_STRUCT)
 KAPI_COMPAT_HEADERS="$KAPI_COMPAT_HEADERS $NO_DELAYED_WORK_STRUCT"
 
+NO_DLMCONSTANTS_HEADER=
+OCFS2_CHECK_KERNEL([dlmconstants.h], dlmconstants.h,
+ , NO_DLMCONSTANTS_HEADER=dlmconstants.h, [__DLMCONSTANTS_DOT_H__])
+AC_SUBST(NO_DLMCONSTANTS_HEADER)
+KAPI_COMPAT_HEADERS="$KAPI_COMPAT_HEADERS $NO_DLMCONSTANTS_HEADER"
+
 
 # End kapi_compat checks
 
diff --git a/fs/ocfs2/Makefile b/fs/ocfs2/Makefile
index 4e4f49a..5f969fe 100644
--- a/fs/ocfs2/Makefile
+++ b/fs/ocfs2/Makefile
@@ -38,6 +38,10 @@ ifdef NO_DELAYED_WORK_STRUCT
 EXTRA_CFLAGS += -DNO_DELAYED_WORK_STRUCT
 endif
 
+ifdef NO_DLMCONSTANTS_HEADER
+EXTRA_CFLAGS += -DNO_DLMCONSTANTS_HEADER
+endif
+
 #
 # Since SUBDIRS means something to kbuild, define them safely.  Do not
 # include trailing slashes.
diff --git a/fs/ocfs2/stackglue.h b/fs/ocfs2/stackglue.h
index 03a44d6..52d1a1d 100644
--- a/fs/ocfs2/stackglue.h
+++ b/fs/ocfs2/stackglue.h
@@ -23,7 +23,9 @@
 
 #include <linux/types.h>
 #include <linux/list.h>
+#ifndef NO_DLMCONSTANTS_HEADER
 #include <linux/dlmconstants.h>
+#endif
 
 #include "dlm/dlmapi.h"
 #include <linux/dlm.h>
diff --git a/kapi-compat/include/dlmconstants.h b/kapi-compat/include/dlmconstants.h
new file mode 100644
index 0000000..19e92c9
--- /dev/null
+++ b/kapi-compat/include/dlmconstants.h
@@ -0,0 +1,9 @@
+#ifndef KAPI_DLMCONSTANTS_H
+#define KAPI_DLMCONSTANTS_H
+
+#ifdef NO_DLMCONSTANTS_HEADER
+#include <linux/types.h>
+#include <linux/dlm.h>
+#endif
+
+#endif
-- 
1.5.6.5




More information about the Ocfs2-devel mailing list