 SLES10 doesn't have a blkcnt_t type defined. This patch adds a check.

Signed-off-by: Jeff Mahoney <jeffm@suse.com>
---
 Config.make.in                 |    1 +
 Makefile                       |    1 +
 configure.in                   |    8 +++++++-
 fs/ocfs2/Makefile              |    4 ++++
 kapi-compat/include/blkcnt_t.h |    8 ++++++++
 5 files changed, 21 insertions(+), 1 deletion(-)

--- a/Config.make.in	2008-02-02 10:36:25.000000000 -0500
+++ b/Config.make.in	2008-02-02 10:36:26.000000000 -0500
@@ -83,6 +83,7 @@ NO_LOCKDEP = @NO_LOCKDEP@
 NO_MANDATORY_LOCK = @NO_MANDATORY_LOCK@
 WRITEBACK_CONTROL_NO_RANGE_PREFIX = @WRITEBACK_CONTROL_NO_RANGE_PREFIX@
 NO_SYNC_FILE_FLAGS = @NO_SYNC_FILE_FLAGS@
+NO_BLKCNT_T = @NO_BLKCNT_T@
 
 OCFS_DEBUG = @OCFS_DEBUG@
 
--- a/Makefile	2008-02-02 10:36:24.000000000 -0500
+++ b/Makefile	2008-02-02 10:36:26.000000000 -0500
@@ -29,6 +29,7 @@ KAPI_COMPAT_FILES = \
 	kapi-compat/include/should_remove_suid.h \
 	kapi-compat/include/generic_segment_checks.h \
 	kapi-compat/include/writeback_control.h \
+	kapi-compat/include/blkcnt_t.h \
 	kapi-compat/include/aiovec.h
 
 PATCH_FILES =
--- a/configure.in	2008-02-02 10:36:25.000000000 -0500
+++ b/configure.in	2008-02-02 10:36:26.000000000 -0500
@@ -351,10 +351,16 @@ KAPI_COMPAT_HEADERS="$KAPI_COMPAT_HEADER
 
 NO_SYNC_FILE_FLAGS=
 OCFS2_CHECK_KERNEL([SYNC_FILE_RANGE flags], fs.h,
-, NO_SYNC_FILE_FLAGS=yes, [^#define SYNC_FILE_RANGE_WRITE])
+  , NO_SYNC_FILE_FLAGS=yes, [^#define SYNC_FILE_RANGE_WRITE])
 KAPI_COMPAT_HEADERS="$KAPI_COMPAT_HEADERS sync_mapping_range.h"
 AC_SUBST(NO_SYNC_FILE_FLAGS)
 
+NO_BLKCNT_T=
+OCFS2_CHECK_KERNEL([blkcnt_t in types.h], types.h, , NO_BLKCNT_T=yes,
+  [^typedef unsigned long blkcnt_t;])
+AC_SUBST(NO_BLKCNT_T)
+KAPI_COMPAT_HEADERS="$KAPI_COMPAT_HEADERS blkcnt_t.h"
+
 # 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
--- a/fs/ocfs2/Makefile	2008-02-02 10:36:25.000000000 -0500
+++ b/fs/ocfs2/Makefile	2008-02-02 10:36:26.000000000 -0500
@@ -124,6 +124,10 @@ ifdef NO_SYNC_FILE_FLAGS
 EXTRA_CFLAGS += -DNO_SYNC_FILE_FLAGS
 endif
 
+ifdef NO_BLKCNT_T
+EXTRA_CFLAGS += -DNO_BLKCNT_T
+endif
+
 #
 # Since SUBDIRS means something to kbuild, define them safely.  Do not
 # include trailing slashes.
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ b/kapi-compat/include/blkcnt_t.h	2008-02-02 10:36:26.000000000 -0500
@@ -0,0 +1,8 @@
+#ifndef KAPI_COMPAT_BLKCNT_T_H
+#define KAPI_COMPAT_BLKCNT_T_H
+
+#ifdef NO_BLKCNT_T
+typedef unsigned long blkcnt_t;
+#endif
+
+#endif



