SLES10 has the old get_sb_bdev() which doesn't take a struct vfsmount
 and returns a struct superblock *.

 This patch adds a workaround to handle that case.

Signed-off-by: Jeff Mahoney <[EMAIL PROTECTED]>
---
 Config.make.in        |    1 +
 configure.in          |    6 ++++++
 fs/ocfs2/Makefile     |    4 ++++
 fs/ocfs2/dlm/Makefile |    4 ++++
 fs/ocfs2/dlm/dlmfs.c  |    9 +++++++++
 fs/ocfs2/super.c      |   10 ++++++++++
 6 files changed, 34 insertions(+)

--- a/Config.make.in    2008-02-02 10:36:28.000000000 -0500
+++ b/Config.make.in    2008-02-02 10:36:28.000000000 -0500
@@ -86,6 +86,7 @@ NO_SYNC_FILE_FLAGS = @NO_SYNC_FILE_FLAGS
 NO_BLKCNT_T = @NO_BLKCNT_T@
 NO_I_PRIVATE = @NO_I_PRIVATE@
 NO_PAGE_MKWRITE = @NO_PAGE_MKWRITE@
+NO_VFSMOUNT_IN_GET_SB_BDEV = @NO_VFSMOUNT_IN_GET_SB_BDEV@
 
 OCFS_DEBUG = @OCFS_DEBUG@
 
--- a/configure.in      2008-02-02 10:36:28.000000000 -0500
+++ b/configure.in      2008-02-02 10:36:29.000000000 -0500
@@ -371,6 +371,12 @@ OCFS2_CHECK_KERNEL([page_mkwrite in stru
   , NO_PAGE_MKWRITE=yes, [^    int (\*page_mkwrite)(struct vm_area_struct 
\*vma, struct page \*page);])
 AC_SUBST(NO_PAGE_MKWRITE)
 
+NO_VFSMOUNT_IN_GET_SB_BDEV=
+OCFS2_CHECK_KERNEL([get_sb_bdev() with 5 arguments in fs.h], fs.h,
+  NO_VFSMOUNT_IN_GET_SB_BDEV=yes, ,
+  [^   int (\*fill_super)(struct super_block \*, void \*, int));$])
+AC_SUBST(NO_VFSMOUNT_IN_GET_SB_BDEV)
+
 # 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:28.000000000 -0500
+++ b/fs/ocfs2/Makefile 2008-02-02 10:36:29.000000000 -0500
@@ -136,6 +136,10 @@ ifdef NO_PAGE_MKWRITE
 EXTRA_CFLAGS += -DNO_PAGE_MKWRITE
 endif
 
+ifdef NO_VFSMOUNT_IN_GET_SB_BDEV
+EXTRA_CFLAGS += -DNO_VFSMOUNT_IN_GET_SB_BDEV
+endif
+
 #
 # Since SUBDIRS means something to kbuild, define them safely.  Do not
 # include trailing slashes.
--- a/fs/ocfs2/dlm/Makefile     2008-02-02 10:22:51.000000000 -0500
+++ b/fs/ocfs2/dlm/Makefile     2008-02-02 10:36:29.000000000 -0500
@@ -50,6 +50,10 @@ ifdef FOP_IS_NOT_CONST
 EXTRA_CFLAGS += -DFOP_IS_NOT_CONST
 endif
 
+ifdef NO_VFSMOUNT_IN_GET_SB_BDEV
+EXTRA_CFLAGS += -DNO_VFSMOUNT_IN_GET_SB_BDEV
+endif
+
 DLM_SOURCES +=                 \
        dlmast.c                \
        dlmconvert.c            \
--- a/fs/ocfs2/dlm/dlmfs.c      2008-02-02 10:22:51.000000000 -0500
+++ b/fs/ocfs2/dlm/dlmfs.c      2008-02-02 10:36:29.000000000 -0500
@@ -602,11 +602,20 @@ static const struct inode_operations dlm
        .getattr        = simple_getattr,
 };
 
+#ifdef NO_VFSMOUNT_IN_GET_SB_BDEV
+static struct super_block *dlmfs_get_sb(struct file_system_type *fs_type,
+                                       int flags, const char *dev_name,
+                                       void *data)
+{
+       return get_sb_nodev(fs_type, flags, data, dlmfs_fill_super);
+}
+#else
 static int dlmfs_get_sb(struct file_system_type *fs_type,
        int flags, const char *dev_name, void *data, struct vfsmount *mnt)
 {
        return get_sb_nodev(fs_type, flags, data, dlmfs_fill_super, mnt);
 }
+#endif
 
 static struct file_system_type dlmfs_fs_type = {
        .owner          = THIS_MODULE,
--- a/fs/ocfs2/super.c  2008-02-02 10:22:51.000000000 -0500
+++ b/fs/ocfs2/super.c  2008-02-02 10:36:29.000000000 -0500
@@ -729,6 +729,15 @@ read_super_error:
        return status;
 }
 
+#ifdef NO_VFSMOUNT_IN_GET_SB_BDEV
+static struct super_block *ocfs2_get_sb(struct file_system_type *fs_type,
+                                       int flags,
+                                       const char *dev_name,
+                                       void *data)
+{
+       return get_sb_bdev(fs_type, flags, dev_name, data, ocfs2_fill_super);
+}
+#else
 static int ocfs2_get_sb(struct file_system_type *fs_type,
                        int flags,
                        const char *dev_name,
@@ -738,6 +747,7 @@ static int ocfs2_get_sb(struct file_syst
        return get_sb_bdev(fs_type, flags, dev_name, data, ocfs2_fill_super,
                           mnt);
 }
+#endif
 
 static struct file_system_type ocfs2_fs_type = {
        .owner          = THIS_MODULE,



_______________________________________________
Ocfs2-devel mailing list
[email protected]
http://oss.oracle.com/mailman/listinfo/ocfs2-devel

Reply via email to