 SLES10's invalidatepage callback returns an int. This patch adds a check.

Signed-off-by: Jeff Mahoney <jeffm@suse.com>
---
 Config.make.in    |    1 +
 configure.in      |    6 ++++++
 fs/ocfs2/Makefile |    4 ++++
 fs/ocfs2/aops.c   |    7 +++++++
 4 files changed, 18 insertions(+)

--- a/Config.make.in	2008-02-02 10:36:30.000000000 -0500
+++ b/Config.make.in	2008-02-02 10:36:31.000000000 -0500
@@ -89,6 +89,7 @@ NO_PAGE_MKWRITE = @NO_PAGE_MKWRITE@
 NO_VFSMOUNT_IN_GET_SB_BDEV = @NO_VFSMOUNT_IN_GET_SB_BDEV@
 NO_READ_MAPPING_PAGE = @NO_READ_MAPPING_PAGE@
 FILLDIR_T_WITH_INO_T = @FILLDIR_T_WITH_INO_T@
+INVALIDATEPAGE_RETURNS_INT = @INVALIDATEPAGE_RETURNS_INT@
 
 OCFS_DEBUG = @OCFS_DEBUG@
 
--- a/configure.in	2008-02-02 10:36:30.000000000 -0500
+++ b/configure.in	2008-02-02 10:36:31.000000000 -0500
@@ -389,6 +389,12 @@ OCFS2_CHECK_KERNEL([ino_t in filldir_t i
   [typedef int (\*filldir_t)(void \*, const char \*, int, loff_t, ino_t, unsigned);])
 AC_SUBST(FILLDIR_T_WITH_INO_T)
 
+INVALIDATEPAGE_RETURNS_INT=
+OCFS2_CHECK_KERNEL([invalidatepage returning int in fs.h], fs.h,
+  INVALIDATEPAGE_RETURNS_INT=yes, ,
+  [^	int (\*invalidatepage) (struct page \*, unsigned long);])
+AC_SUBST(INVALIDATEPAGE_RETURNS_INT)
+
 # 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:30.000000000 -0500
+++ b/fs/ocfs2/Makefile	2008-02-02 10:36:31.000000000 -0500
@@ -148,6 +148,10 @@ ifdef FILLDIR_T_WITH_INO_T
 EXTRA_CFLAGS += -DFILLDIR_T_WITH_INO_T
 endif
 
+ifdef INVALIDATEPAGE_RETURNS_INT
+EXTRA_CFLAGS += -DINVALIDATEPAGE_RETURNS_INT
+endif
+
 #
 # Since SUBDIRS means something to kbuild, define them safely.  Do not
 # include trailing slashes.
--- a/fs/ocfs2/aops.c	2008-02-02 10:22:48.000000000 -0500
+++ b/fs/ocfs2/aops.c	2008-02-02 10:36:31.000000000 -0500
@@ -658,11 +658,18 @@ static void ocfs2_dio_end_io(struct kioc
  * from ext3.  PageChecked() bits have been removed as OCFS2 does not
  * do journalled data.
  */
+#ifdef INVALIDATEPAGE_RETURNS_INT
+static int ocfs2_invalidatepage(struct page *page, unsigned long offset)
+#else
 static void ocfs2_invalidatepage(struct page *page, unsigned long offset)
+#endif
 {
 	journal_t *journal = OCFS2_SB(page->mapping->host->i_sb)->journal->j_journal;
 
 	journal_invalidatepage(journal, page, offset);
+#ifdef INVALIDATEPAGE_RETURNS_INT
+	return 0;
+#endif
 }
 
 static int ocfs2_releasepage(struct page *page, gfp_t wait)



