[Ocfs2-devel] [PATCH 14/30] ocfs2: Handle enum value FS_OCFS2

Sunil Mushran sunil.mushran at oracle.com
Mon Dec 31 14:24:06 PST 2007


Commit 0e03036c97b70b2602f7dedaa3a223ed7563c2c9 in mainline registers
ocfs2 sysctl (FS_OCFS2) number under CTL_FS. This patch allows one to
build ocfs2 with kernels having/not having this change.

Signed-off-by: Sunil Mushran <sunil.mushran at oracle.com>
Signed-off-by: Joel Becker <joel.becker at oracle.com>
---
 Makefile                     |    3 ++-
 configure.in                 |    5 +++++
 kapi-compat/include/sysctl.h |    9 +++++++++
 3 files changed, 16 insertions(+), 1 deletions(-)
 create mode 100644 kapi-compat/include/sysctl.h

diff --git a/Makefile b/Makefile
index 7d6788e..8823752 100644
--- a/Makefile
+++ b/Makefile
@@ -18,7 +18,8 @@ KAPI_COMPAT_FILES = \
 	kapi-compat/include/inc_nlink.h \
 	kapi-compat/include/drop_nlink.h \
 	kapi-compat/include/slab.h \
-	kapi-compat/include/fstype.h
+	kapi-compat/include/fstype.h \
+	kapi-compat/include/sysctl.h
 
 PATCH_FILES =
 
diff --git a/configure.in b/configure.in
index abc835b..8f6eb37 100644
--- a/configure.in
+++ b/configure.in
@@ -215,6 +215,11 @@ OCFS2_CHECK_KERNEL([flag FS_RENAME_DOES_D_MOVE in fs.h], fs.h,
   , fstype_compat_header="fstype.h", [FS_RENAME_DOES_D_MOVE])
 KAPI_COMPAT_HEADERS="$KAPI_COMPAT_HEADERS $fstype_compat_header"
 
+sysctl_compat_header=""
+OCFS2_CHECK_KERNEL([enum FS_OCFS2 in sysctl.h], sysctl.h,
+  , sysctl_compat_header="sysctl.h", [FS_OCFS2])
+KAPI_COMPAT_HEADERS="$KAPI_COMPAT_HEADERS $sysctl_compat_header"
+
 # using -include has two advantages:
 #  the source doesn't need to know to include compat headers
 #  the compat header file names don't go through the search path
diff --git a/kapi-compat/include/sysctl.h b/kapi-compat/include/sysctl.h
new file mode 100644
index 0000000..73ed0a7
--- /dev/null
+++ b/kapi-compat/include/sysctl.h
@@ -0,0 +1,9 @@
+#ifndef KAPI_SYSCTL_H
+#define KAPI_SYSCTL_H
+
+/* CTL_FS names: */
+enum {
+	FS_OCFS2=988,   /* ocfs2 */
+};
+
+#endif
-- 
1.5.3.4




More information about the Ocfs2-devel mailing list