Hi Ryuta,

What version of PVFS are you using? Sumit Narayan and I have updated the CVS version of PVFS to build correctly against 2.6.27, but I'm not sure if the patch will apply to the official releases. The patch is attached to this email if you want to give it a try.

thanks,
-Phil

Phil Carns wrote:
Hello Ryuta,

We don't have a patch for this yet, but I confirmed the same compilation problems here as well. Looks like we need to add a couple more configure tests.

-Phil

Ryuta Suzuki wrote:
Hi,

Now linux kernel 2.6.27 is out.
I try to build pvfs2 kernel module against 2.6.27.
The module compiles but incompatible to this version of kernel, and it cannot be loaded (and mount fails, etc. etc.)

CC [M] /home/ryuta/local/pvfs2/src/pvfs2-build/src/kernel/linux-2.6/pvfs2-utils.o CC [M] /home/ryuta/local/pvfs2/src/pvfs2-build/src/kernel/linux-2.6/devpvfs2-req.o CC [M] /home/ryuta/local/pvfs2/src/pvfs2-build/src/kernel/linux-2.6/pvfs2-cache.o /home/ryuta/local/pvfs2/src/pvfs2-build/src/kernel/linux-2.6/pvfs2-cache.c: In function ‘dev_req_cache_initialize’: /home/ryuta/local/pvfs2/src/pvfs2-build/src/kernel/linux-2.6/pvfs2-cache.c:228: warning: passing argument 5 of ‘kmem_cache_create’ from incompatible pointer type /home/ryuta/local/pvfs2/src/pvfs2-build/src/kernel/linux-2.6/pvfs2-cache.c: In function ‘pvfs2_inode_cache_initialize’: /home/ryuta/local/pvfs2/src/pvfs2-build/src/kernel/linux-2.6/pvfs2-cache.c:330: warning: passing argument 5 of ‘kmem_cache_create’ from incompatible pointer type /home/ryuta/local/pvfs2/src/pvfs2-build/src/kernel/linux-2.6/pvfs2-cache.c: In function ‘kiocb_cache_initialize’: /home/ryuta/local/pvfs2/src/pvfs2-build/src/kernel/linux-2.6/pvfs2-cache.c:420: warning: passing argument 5 of ‘kmem_cache_create’ from incompatible pointer type CC [M] /home/ryuta/local/pvfs2/src/pvfs2-build/src/kernel/linux-2.6/dcache.o CC [M] /home/ryuta/local/pvfs2/src/pvfs2-build/src/kernel/linux-2.6/file.o /home/ryuta/local/pvfs2/src/pvfs2-build/src/kernel/linux-2.6/file.c: In function ‘check_mapping_tree’: /home/ryuta/local/pvfs2/src/pvfs2-build/src/kernel/linux-2.6/file.c:802: warning: passing argument 1 of ‘_read_lock’ from incompatible pointer type /home/ryuta/local/pvfs2/src/pvfs2-build/src/kernel/linux-2.6/file.c:822: warning: passing argument 1 of ‘_read_unlock’ from incompatible pointer type /home/ryuta/local/pvfs2/src/pvfs2-build/src/kernel/linux-2.6/file.c: In function ‘locate_file_pages’: /home/ryuta/local/pvfs2/src/pvfs2-build/src/kernel/linux-2.6/file.c:894: warning: passing argument 1 of ‘_read_lock’ from incompatible pointer type /home/ryuta/local/pvfs2/src/pvfs2-build/src/kernel/linux-2.6/file.c:915: warning: passing argument 1 of ‘_read_unlock’ from incompatible pointer type /home/ryuta/local/pvfs2/src/pvfs2-build/src/kernel/linux-2.6/file.c:918: warning: passing argument 1 of ‘_read_lock’ from incompatible pointer type /home/ryuta/local/pvfs2/src/pvfs2-build/src/kernel/linux-2.6/file.c:938: warning: passing argument 1 of ‘_read_unlock’ from incompatible pointer type CC [M] /home/ryuta/local/pvfs2/src/pvfs2-build/src/kernel/linux-2.6/inode.o /home/ryuta/local/pvfs2/src/pvfs2-build/src/kernel/linux-2.6/inode.c:369: warning: initialization from incompatible pointer type
CC [M] /home/ryuta/local/pvfs2/src/pvfs2-build/src/kernel/linux-2.6/dir.o
CC [M] /home/ryuta/local/pvfs2/src/pvfs2-build/src/kernel/linux-2.6/namei.o /home/ryuta/local/pvfs2/src/pvfs2-build/src/kernel/linux-2.6/namei.c:547: warning: initialization from incompatible pointer type CC [M] /home/ryuta/local/pvfs2/src/pvfs2-build/src/kernel/linux-2.6/super.o CC [M] /home/ryuta/local/pvfs2/src/pvfs2-build/src/kernel/linux-2.6/pvfs2-mod.o CC [M] /home/ryuta/local/pvfs2/src/pvfs2-build/src/kernel/linux-2.6/pvfs2-bufmap.o CC [M] /home/ryuta/local/pvfs2/src/pvfs2-build/src/kernel/linux-2.6/symlink.o /home/ryuta/local/pvfs2/src/pvfs2-build/src/kernel/linux-2.6/symlink.c:72: warning: initialization from incompatible pointer type CC [M] /home/ryuta/local/pvfs2/src/pvfs2-build/src/kernel/linux-2.6/xattr.o
CC [M] /home/ryuta/local/pvfs2/src/pvfs2-build/src/kernel/linux-2.6/acl.o
CC [M] /home/ryuta/local/pvfs2/src/pvfs2-build/src/kernel/linux-2.6/xattr-trusted.o CC [M] /home/ryuta/local/pvfs2/src/pvfs2-build/src/kernel/linux-2.6/xattr-default.o CC [M] /home/ryuta/local/pvfs2/src/pvfs2-build/src/kernel/linux-2.6/waitqueue.o CC [M] /home/ryuta/local/pvfs2/src/pvfs2-build/src/kernel/linux-2.6/pvfs2-proc.o LD [M] /home/ryuta/local/pvfs2/src/pvfs2-build/src/kernel/linux-2.6/pvfs2.o
Building modules, stage 2.

If there's a patch, I'll be happy to give it a shot. Thank you.

-ryuta
_______________________________________________
Pvfs2-users mailing list
[email protected]
http://www.beowulf-underground.org/mailman/listinfo/pvfs2-users

_______________________________________________
Pvfs2-users mailing list
[email protected]
http://www.beowulf-underground.org/mailman/listinfo/pvfs2-users

---------------------
PatchSet 7169 
Date: 2008/10/22 17:11:10
Author: pcarns
Branch: HEAD
Tag: (none) 
Log:
New configure test to fix one of the compile problems with 2.6.27
kernels.  The kmem_cache interface change that we detected in 2.6.24 has
changed yet again.

Members: 
	configure:1.395->1.396 
	pvfs2-config.h.in:1.121->1.122 
	maint/config/kernel.m4:1.60->1.61 
	src/kernel/linux-2.6/pvfs2-cache.c:1.45->1.46 

Index: pvfs2-1/configure
diff -u pvfs2-1/configure:1.395 pvfs2-1/configure:1.396
--- pvfs2-1/configure:1.395	Mon Aug  4 10:52:22 2008
+++ pvfs2-1/configure	Wed Oct 22 17:11:10 2008
@@ -11674,6 +11674,70 @@
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
+        	        		        	tmp_cflags=$CFLAGS
+	CFLAGS="$CFLAGS -Werror"
+	{ echo "$as_me:$LINENO: checking for one-param kmem_cache_create constructor" >&5
+echo $ECHO_N "checking for one-param kmem_cache_create constructor... $ECHO_C" >&6; }
+	cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+		#define __KERNEL__
+		#include <linux/kernel.h>
+		#include <linux/slab.h>
+		void ctor(void *req)
+		{
+		}
+
+int
+main ()
+{
+
+		kmem_cache_create("config-test", 0, 0, 0, ctor);
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_KMEM_CACHE_CREATE_CTOR_ONE_PARAM 1
+_ACEOF
+
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	{ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+	CFLAGS=$tmp_cflags
+
         							tmp_cflags=$CFLAGS
 	CFLAGS="$CFLAGS -Werror"
 	{ echo "$as_me:$LINENO: checking for two-param kmem_cache_create constructor" >&5
Index: pvfs2-1/pvfs2-config.h.in
diff -u pvfs2-1/pvfs2-config.h.in:1.121 pvfs2-1/pvfs2-config.h.in:1.122
--- pvfs2-1/pvfs2-config.h.in:1.121	Mon Aug  4 10:52:24 2008
+++ pvfs2-1/pvfs2-config.h.in	Wed Oct 22 17:11:12 2008
@@ -171,6 +171,10 @@
 /* Define if kernel has device classes */
 #undef HAVE_KERNEL_DEVICE_CLASSES
 
+/* Define if kernel kmem_cache_create constructor has newer-style
+   one-parameter form */
+#undef HAVE_KMEM_CACHE_CREATE_CTOR_ONE_PARAM
+
 /* Define if kernel kmem_cache_create constructor has new-style two-parameter
    form */
 #undef HAVE_KMEM_CACHE_CREATE_CTOR_TWO_PARAM
Index: pvfs2-1/maint/config/kernel.m4
diff -u pvfs2-1/maint/config/kernel.m4:1.60 pvfs2-1/maint/config/kernel.m4:1.61
--- pvfs2-1/maint/config/kernel.m4:1.60	Mon Aug  4 10:52:28 2008
+++ pvfs2-1/maint/config/kernel.m4	Wed Oct 22 17:11:12 2008
@@ -919,6 +919,31 @@
 	AC_MSG_RESULT(no)
 	)
 
+        dnl 2.6.27 changed the constructor parameter signature of
+	dnl kmem_cache_create.  Check for this newer one-param style
+        dnl If they don't match, gcc complains about
+	dnl passing argument ... from incompatible pointer type, hence the
+	dnl need for the -Werror.  Note that the next configure test will
+        dnl determine if we have a two param constructor or not.
+	tmp_cflags=$CFLAGS
+	CFLAGS="$CFLAGS -Werror"
+	AC_MSG_CHECKING(for one-param kmem_cache_create constructor)
+	AC_TRY_COMPILE([
+		#define __KERNEL__
+		#include <linux/kernel.h>
+		#include <linux/slab.h>
+		void ctor(void *req)
+		{
+		}
+	], [
+		kmem_cache_create("config-test", 0, 0, 0, ctor);
+	],
+	AC_MSG_RESULT(yes)
+	AC_DEFINE(HAVE_KMEM_CACHE_CREATE_CTOR_ONE_PARAM, 1, [Define if kernel kmem_cache_create constructor has newer-style one-parameter form]),
+	AC_MSG_RESULT(no)
+	)
+	CFLAGS=$tmp_cflags
+
         dnl 2.6.24 changed the constructor parameter signature of
 	dnl kmem_cache_create.  Check for this newer two-param style and
 	dnl if not, assume it is old.  Note we can get away with just
Index: pvfs2-1/src/kernel/linux-2.6/pvfs2-cache.c
diff -u pvfs2-1/src/kernel/linux-2.6/pvfs2-cache.c:1.45 pvfs2-1/src/kernel/linux-2.6/pvfs2-cache.c:1.46
--- pvfs2-1/src/kernel/linux-2.6/pvfs2-cache.c:1.45	Fri Jan 11 15:30:17 2008
+++ pvfs2-1/src/kernel/linux-2.6/pvfs2-cache.c	Wed Oct 22 17:11:12 2008
@@ -204,7 +204,9 @@
 
 
 static void dev_req_cache_ctor(
-#ifdef HAVE_KMEM_CACHE_CREATE_CTOR_TWO_PARAM
+#if defined(HAVE_KMEM_CACHE_CREATE_CTOR_ONE_PARAM)
+    void *req
+#elif defined(HAVE_KMEM_CACHE_CREATE_CTOR_TWO_PARAM)
     struct kmem_cache *cachep,
     void *req
 #else
@@ -271,7 +273,9 @@
 }
 
 static void pvfs2_inode_cache_ctor(
-#ifdef HAVE_KMEM_CACHE_CREATE_CTOR_TWO_PARAM
+#if defined(HAVE_KMEM_CACHE_CREATE_CTOR_ONE_PARAM)
+    void *req
+#elif defined(HAVE_KMEM_CACHE_CREATE_CTOR_TWO_PARAM)
     struct kmem_cache *cachep,
     void *req
 #else
@@ -395,7 +399,9 @@
 #ifdef HAVE_AIO_VFS_SUPPORT
 
 static void kiocb_ctor(
-#ifdef HAVE_KMEM_CACHE_CREATE_CTOR_TWO_PARAM
+#if defined(HAVE_KMEM_CACHE_CREATE_CTOR_ONE_PARAM)
+    void *req
+#elif defined(HAVE_KMEM_CACHE_CREATE_CTOR_TWO_PARAM)
     struct kmem_cache *cachep,
     void *req
 #else
---------------------
PatchSet 7170 
Date: 2008/10/22 17:38:58
Author: pcarns
Branch: HEAD
Tag: (none) 
Log:
2.6.27 adds a 5th way to lock address_space mappings

Members: 
	configure:1.396->1.397 
	pvfs2-config.h.in:1.122->1.123 
	maint/config/kernel.m4:1.61->1.62 
	src/kernel/linux-2.6/file.c:1.149->1.150 

Index: pvfs2-1/configure
diff -u pvfs2-1/configure:1.396 pvfs2-1/configure:1.397
--- pvfs2-1/configure:1.396	Wed Oct 22 17:11:10 2008
+++ pvfs2-1/configure	Wed Oct 22 17:38:58 2008
@@ -11860,6 +11860,8 @@
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
+        tmp_cflags=$CFLAGS
+        CFLAGS="$CFLAGS -Werror"
         { echo "$as_me:$LINENO: checking if kernel address_space struct has a rwlock_t field named tree_lock" >&5
 echo $ECHO_N "checking if kernel address_space struct has a rwlock_t field named tree_lock... $ECHO_C" >&6; }
 	cat >conftest.$ac_ext <<_ACEOF
@@ -11904,6 +11906,67 @@
 echo "${ECHO_T}yes" >&6; }
 
 cat >>confdefs.h <<\_ACEOF
+#define HAVE_RW_LOCK_TREE_ADDR_SPACE_STRUCT 1
+_ACEOF
+
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	{ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+        CFLAGS=$tmp_cflags
+
+        tmp_cflags=$CFLAGS
+        CFLAGS="$CFLAGS -Werror"
+        { echo "$as_me:$LINENO: checking if kernel address_space struct has a spinlock_t field named tree_lock" >&5
+echo $ECHO_N "checking if kernel address_space struct has a spinlock_t field named tree_lock... $ECHO_C" >&6; }
+	cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+		#define __KERNEL__
+		#include <linux/fs.h>
+
+int
+main ()
+{
+
+		struct address_space as;
+		spin_lock(&as.tree_lock);
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+
+cat >>confdefs.h <<\_ACEOF
 #define HAVE_SPIN_LOCK_TREE_ADDR_SPACE_STRUCT 1
 _ACEOF
 
@@ -11917,6 +11980,7 @@
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+        CFLAGS=$tmp_cflags
 
 	{ echo "$as_me:$LINENO: checking if kernel address_space struct has a priv_lock field - from RT linux" >&5
 echo $ECHO_N "checking if kernel address_space struct has a priv_lock field - from RT linux... $ECHO_C" >&6; }
Index: pvfs2-1/pvfs2-config.h.in
diff -u pvfs2-1/pvfs2-config.h.in:1.122 pvfs2-1/pvfs2-config.h.in:1.123
--- pvfs2-1/pvfs2-config.h.in:1.122	Wed Oct 22 17:11:12 2008
+++ pvfs2-1/pvfs2-config.h.in	Wed Oct 22 17:38:59 2008
@@ -297,6 +297,10 @@
    instead of rw_lock -- used by RT linux */
 #undef HAVE_RT_PRIV_LOCK_ADDR_SPACE_STRUCT
 
+/* Define if kernel address_space struct has a rw_lock_t member named
+   tree_lock */
+#undef HAVE_RW_LOCK_TREE_ADDR_SPACE_STRUCT
+
 /* Define to 1 if you have the <SDL/SDL_ttf.h> header file. */
 #undef HAVE_SDL_SDL_TTF_H
 
@@ -316,8 +320,8 @@
    page_lock instead of rw_lock */
 #undef HAVE_SPIN_LOCK_PAGE_ADDR_SPACE_STRUCT
 
-/* Define if kernel address_space struct has a spin_lock member named
-   tree_lock instead of rw_lock */
+/* Define if kernel address_space struct has a spin_lock_t member named
+   tree_lock */
 #undef HAVE_SPIN_LOCK_TREE_ADDR_SPACE_STRUCT
 
 /* Define if struct super_operations in kernel has statfs_lite callback */
Index: pvfs2-1/maint/config/kernel.m4
diff -u pvfs2-1/maint/config/kernel.m4:1.61 pvfs2-1/maint/config/kernel.m4:1.62
--- pvfs2-1/maint/config/kernel.m4:1.61	Wed Oct 22 17:11:12 2008
+++ pvfs2-1/maint/config/kernel.m4	Wed Oct 22 17:39:00 2008
@@ -983,6 +983,8 @@
 	AC_MSG_RESULT(no)
 	)
 
+        tmp_cflags=$CFLAGS
+        CFLAGS="$CFLAGS -Werror"
         AC_MSG_CHECKING(if kernel address_space struct has a rwlock_t field named tree_lock)
 	AC_TRY_COMPILE([
 		#define __KERNEL__
@@ -992,9 +994,26 @@
 		read_lock(&as.tree_lock);
 	],
 	AC_MSG_RESULT(yes)
-	AC_DEFINE(HAVE_SPIN_LOCK_TREE_ADDR_SPACE_STRUCT, 1, [Define if kernel address_space struct has a spin_lock member named tree_lock instead of rw_lock]),
+	AC_DEFINE(HAVE_RW_LOCK_TREE_ADDR_SPACE_STRUCT, 1, [Define if kernel address_space struct has a rw_lock_t member named tree_lock]),
 	AC_MSG_RESULT(no)
 	)
+        CFLAGS=$tmp_cflags
+
+        tmp_cflags=$CFLAGS
+        CFLAGS="$CFLAGS -Werror"
+        AC_MSG_CHECKING(if kernel address_space struct has a spinlock_t field named tree_lock)
+	AC_TRY_COMPILE([
+		#define __KERNEL__
+		#include <linux/fs.h>
+	], [
+		struct address_space as;
+		spin_lock(&as.tree_lock);
+	],
+	AC_MSG_RESULT(yes)
+	AC_DEFINE(HAVE_SPIN_LOCK_TREE_ADDR_SPACE_STRUCT, 1, [Define if kernel address_space struct has a spin_lock_t member named tree_lock]),
+	AC_MSG_RESULT(no)
+	)
+        CFLAGS=$tmp_cflags
 
 	AC_MSG_CHECKING(if kernel address_space struct has a priv_lock field - from RT linux)
 	AC_TRY_COMPILE([
Index: pvfs2-1/src/kernel/linux-2.6/file.c
diff -u pvfs2-1/src/kernel/linux-2.6/file.c:1.149 pvfs2-1/src/kernel/linux-2.6/file.c:1.150
--- pvfs2-1/src/kernel/linux-2.6/file.c:1.149	Tue Jun 10 09:38:00 2008
+++ pvfs2-1/src/kernel/linux-2.6/file.c	Wed Oct 22 17:39:00 2008
@@ -775,9 +775,12 @@
 #if defined(HAVE_SPIN_LOCK_PAGE_ADDR_SPACE_STRUCT)
 #define lock_mapping_tree(mapping) spin_lock(&mapping->page_lock)
 #define unlock_mapping_tree(mapping) spin_unlock(&mapping->page_lock)
-#elif defined(HAVE_SPIN_LOCK_TREE_ADDR_SPACE_STRUCT)
+#elif defined(HAVE_RW_LOCK_TREE_ADDR_SPACE_STRUCT)
 #define lock_mapping_tree(mapping) read_lock(&mapping->tree_lock)
 #define unlock_mapping_tree(mapping) read_unlock(&mapping->tree_lock)
+#elif defined(HAVE_SPIN_LOCK_TREE_ADDR_SPACE_STRUCT)
+#define lock_mapping_tree(mapping) spin_lock(&mapping->tree_lock)
+#define unlock_mapping_tree(mapping) spin_unlock(&mapping->tree_lock)
 #elif defined(HAVE_RT_PRIV_LOCK_ADDR_SPACE_STRUCT)
 #define lock_mapping_tree(mapping) spin_lock(&mapping->priv_lock)
 #define unlock_mapping_tree(mapping) spin_unlock(&mapping->priv_lock)
---------------------
PatchSet 7172 
Date: 2008/10/23 13:36:05
Author: pcarns
Branch: HEAD
Tag: (none) 
Log:
patch from Sumit Narayan to fix remaining compilation problems with 2.6.27
kernel related to permission function changes

Members: 
	configure:1.397->1.398 
	pvfs2-config.h.in:1.123->1.124 
	maint/config/kernel.m4:1.62->1.63 
	src/kernel/linux-2.6/acl.c:1.25->1.26 
	src/kernel/linux-2.6/pvfs2-kernel.h:1.155->1.156 

Index: pvfs2-1/configure
diff -u pvfs2-1/configure:1.397 pvfs2-1/configure:1.398
--- pvfs2-1/configure:1.397	Wed Oct 22 17:38:58 2008
+++ pvfs2-1/configure	Thu Oct 23 13:36:05 2008
@@ -11738,6 +11738,76 @@
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 	CFLAGS=$tmp_cflags
 
+        	        			tmp_cflags=$CFLAGS
+	CFLAGS="$CFLAGS -Werror -Wall"
+	{ echo "$as_me:$LINENO: checking for two param permission" >&5
+echo $ECHO_N "checking for two param permission... $ECHO_C" >&6; }
+	cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+		#define __KERNEL__
+		#include <linux/kernel.h>
+		#include <linux/slab.h>
+		#include <linux/fs.h>
+		#include <linux/namei.h>
+		int ctor(struct inode *i, int a)
+		{
+			return 0;
+		}
+		struct inode_operations iop = {
+			.permission = ctor,
+		};
+
+int
+main ()
+{
+
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_TWO_PARAM_PERMISSION 1
+_ACEOF
+
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	{ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+	CFLAGS=$tmp_cflags
+
+
         							tmp_cflags=$CFLAGS
 	CFLAGS="$CFLAGS -Werror"
 	{ echo "$as_me:$LINENO: checking for two-param kmem_cache_create constructor" >&5
Index: pvfs2-1/pvfs2-config.h.in
diff -u pvfs2-1/pvfs2-config.h.in:1.123 pvfs2-1/pvfs2-config.h.in:1.124
--- pvfs2-1/pvfs2-config.h.in:1.123	Wed Oct 22 17:38:59 2008
+++ pvfs2-1/pvfs2-config.h.in	Thu Oct 23 13:36:07 2008
@@ -384,6 +384,10 @@
 /* Define if register_sysctl_table takes two arguments */
 #undef HAVE_TWO_ARG_REGISTER_SYSCTL_TABLE
 
+/* Define if kernel's inode_operations has two parameters permission function
+   */
+#undef HAVE_TWO_PARAM_PERMISSION
+
 /* Define if DB open function takes a txnid parameter */
 #undef HAVE_TXNID_PARAMETER_TO_DB_OPEN
 
Index: pvfs2-1/maint/config/kernel.m4
diff -u pvfs2-1/maint/config/kernel.m4:1.62 pvfs2-1/maint/config/kernel.m4:1.63
--- pvfs2-1/maint/config/kernel.m4:1.62	Wed Oct 22 17:39:00 2008
+++ pvfs2-1/maint/config/kernel.m4	Thu Oct 23 13:36:07 2008
@@ -944,6 +944,36 @@
 	)
 	CFLAGS=$tmp_cflags
 
+        dnl 2.6.27 changed the parameter signature of
+	dnl inode_operations->permission.  Check for this newer two-param style
+        dnl If they don't match, gcc complains about
+	dnl passing argument ... from incompatible pointer type, hence the
+	dnl need for the -Werror and -Wall.
+	tmp_cflags=$CFLAGS
+	CFLAGS="$CFLAGS -Werror -Wall"
+	AC_MSG_CHECKING(for two param permission)
+	AC_TRY_COMPILE([
+		#define __KERNEL__
+		#include <linux/kernel.h>
+		#include <linux/slab.h>
+		#include <linux/fs.h>
+		#include <linux/namei.h>
+		int ctor(struct inode *i, int a)
+		{
+			return 0;
+		}
+		struct inode_operations iop = {
+			.permission = ctor,
+		};
+	], [
+	],
+	AC_MSG_RESULT(yes)
+	AC_DEFINE(HAVE_TWO_PARAM_PERMISSION, 1, [Define if kernel's inode_operations has two parameters permission function]),
+	AC_MSG_RESULT(no)
+	)
+	CFLAGS=$tmp_cflags
+
+
         dnl 2.6.24 changed the constructor parameter signature of
 	dnl kmem_cache_create.  Check for this newer two-param style and
 	dnl if not, assume it is old.  Note we can get away with just
Index: pvfs2-1/src/kernel/linux-2.6/acl.c
diff -u pvfs2-1/src/kernel/linux-2.6/acl.c:1.25 pvfs2-1/src/kernel/linux-2.6/acl.c:1.26
--- pvfs2-1/src/kernel/linux-2.6/acl.c:1.25	Thu Mar 29 09:20:42 2007
+++ pvfs2-1/src/kernel/linux-2.6/acl.c	Thu Oct 23 13:36:07 2008
@@ -671,7 +671,11 @@
     return -EAGAIN;
 }
 
+#ifdef HAVE_TWO_PARAM_PERMISSION
+int pvfs2_permission(struct inode *inode, int mask)
+#else
 int pvfs2_permission(struct inode *inode, int mask, struct nameidata *nd)
+#endif
 {
 #ifdef HAVE_GENERIC_PERMISSION
     int ret;
Index: pvfs2-1/src/kernel/linux-2.6/pvfs2-kernel.h
diff -u pvfs2-1/src/kernel/linux-2.6/pvfs2-kernel.h:1.155 pvfs2-1/src/kernel/linux-2.6/pvfs2-kernel.h:1.156
--- pvfs2-1/src/kernel/linux-2.6/pvfs2-kernel.h:1.155	Wed Sep 24 14:12:27 2008
+++ pvfs2-1/src/kernel/linux-2.6/pvfs2-kernel.h	Thu Oct 23 13:36:07 2008
@@ -807,11 +807,11 @@
 #define pvfs2_iget(sb, ref)        pvfs2_iget_common(sb, ref, 0)
 #define pvfs2_iget_locked(sb, ref) pvfs2_iget_common(sb, ref, 1)
 
-#ifdef PVFS2_LINUX_KERNEL_2_4
+#if defined(PVFS2_LINUX_KERNEL_2_4) || defined(HAVE_TWO_PARAM_PERMISSION)
 int pvfs2_permission(struct inode *, int);
 #else
 int pvfs2_permission(struct inode *inode, 
-        int mask, struct nameidata *nd);
+					 int mask, struct nameidata *nd);
 #endif
 
 /*****************************
_______________________________________________
Pvfs2-users mailing list
[email protected]
http://www.beowulf-underground.org/mailman/listinfo/pvfs2-users

Reply via email to