[OpenAFS-devel] Re: Compiling kernel module for 2.6.28.1
Simon Wilkinson
sxw@inf.ed.ac.uk
Fri, 23 Jan 2009 11:03:23 +0000
--Apple-Mail-1-998333239
Content-Transfer-Encoding: 7bit
Content-Type: text/plain;
charset=US-ASCII;
delsp=yes;
format=flowed
On 23 Jan 2009, at 09:51, Dr A V Le Blanc wrote:
> I've tried compiling the kernel module from openafs-1.5.57 for kernel
> 2.6.28.1, and I get this error:
Unfortunately, d_alloc_anon was removed from the kernel recently, and
replaced with the GPL only d_obtain_alias function, which OpenAFS
cannot use. Unfortunately that, and the relicensing of a load of the
sunrpc functions to also be GPL only, means that the Linux NFS
translator is pretty much dead in the water.
I think the attached patch should disable this code...
S.
--Apple-Mail-1-998333239
Content-Transfer-Encoding: 7bit
Content-Type: application/octet-stream;
x-unix-mode=0644;
name=linux-nonfs.patch
Content-Disposition: attachment;
filename=linux-nonfs.patch
Index: development/openafs/acinclude.m4
===================================================================
--- development.orig/openafs/acinclude.m4 2009-01-21 15:16:48.000000000 +0000
+++ development/openafs/acinclude.m4 2009-01-23 10:28:02.000000000 +0000
@@ -935,6 +935,10 @@
LINUX_SYSCTL_TABLE_CHECKING
LINUX_HAVE_IGET
LINUX_HAVE_I_SIZE_READ
+ LINUX_HAVE_D_ALLOC_ANON
+ if test "x$ac_cv_linux_d_alloc_anon" = "xno"; then
+ AC_DEFINE([AFS_NONFSTRANS], 1, [define to disable the nfs translator])
+ fi
LINUX_FS_STRUCT_NAMEIDATA_HAS_PATH
LINUX_EXPORTS_INIT_MM
LINUX_EXPORTS_SYS_CHDIR
Index: development/openafs/src/afs/LINUX/osi_export.c
===================================================================
--- development.orig/openafs/src/afs/LINUX/osi_export.c 2008-10-24 22:01:40.000000000 +0100
+++ development/openafs/src/afs/LINUX/osi_export.c 2009-01-23 10:55:55.000000000 +0000
@@ -27,6 +27,8 @@
#include "afs/afs_dynroot.h"
#include "h/smp_lock.h"
+#if !defined(AFS_NONFSTRANS)
+
/* #define OSI_EXPORT_DEBUG */
extern struct dentry_operations afs_dentry_operations;
@@ -956,3 +958,5 @@
.get_name = afs_export_get_name,
.get_parent = afs_export_get_parent,
};
+
+#endif
Index: development/openafs/src/cf/linux-test4.m4
===================================================================
--- development.orig/openafs/src/cf/linux-test4.m4 2009-01-21 15:16:51.000000000 +0000
+++ development/openafs/src/cf/linux-test4.m4 2009-01-23 10:25:33.000000000 +0000
@@ -841,6 +841,22 @@
AC_DEFINE([HAVE_LINUX_I_SIZE_READ], 1, [define if your kernel has i_size_read()])
fi])
+AC_DEFUN([LINUX_HAVE_D_ALLOC_ANON], [
+ AC_MSG_CHECKING([for linux d_alloc_anon()])
+ AC_CACHE_VAL([ac_cv_linux_d_alloc_anon], [
+ save_CPPFLAGS="$CPPFLAGS"
+ CPPFLAGS="$CPPFLAGS -Werror-implicit-function-declaration"
+ AC_TRY_KBUILD(
+[#include <linux/dcache.h>],
+[d_alloc_anon(NULL);],
+ ac_cv_linux_d_alloc_anon=yes,
+ ac_cv_linux_d_alloc_anon=no)
+ CPPFLAGS="$save_CPPFLAGS"])
+ AC_MSG_RESULT($ac_cv_linux_d_alloc_anon)
+ if test "x$ac_cv_linux_d_alloc_anon" = "xyes"; then
+ AC_DEFINE([HAVE_LINUX_D_ALLOC_ANON], 1, [define if your kernel has d_alloc_anon()])
+ fi])
+
AC_DEFUN([LINUX_FREEZER_H_EXISTS], [
AC_MSG_CHECKING([for linux/freezer.h existance])
AC_CACHE_VAL([ac_cv_linux_freezer_h_exists], [
--Apple-Mail-1-998333239--