Can't compile 0.40 kernel modules on linux 2.6.8.

Alexander Boström abo at kth.se
Tue Jul 26 17:19:01 CEST 2005


fre 2005-07-22 klockan 15:42 +0200 skrev Friedrich Delgado Friedrichs:
> Hi!

> kafs.h is installed in /usr/include/heimdal, which
> /usr/bin/krb5-config faithfully reports, but of course forcing the
> build to use this file fails because the symbols in afs-pioctl.h are
> not found. I don't see an obvious way to fix this (but of course I'm
> not familiar with the arla sources).

Hi,

The attached patches might help, at least on 32-bit kernels.

/abo



Index: nnpfs/linux/nnpfs_syscalls.c
===================================================================
RCS file: /afs/stacken.kth.se/src/SourceRepository/arla/nnpfs/linux/nnpfs_syscalls.c,v
retrieving revision 1.113
retrieving revision 1.115
diff -u -w -r1.113 -r1.115
--- nnpfs/linux/nnpfs_syscalls.c	20 Jun 2005 13:56:34 -0000	1.113
+++ nnpfs/linux/nnpfs_syscalls.c	21 Jun 2005 00:57:32 -0000	1.115
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995 - 2004 Kungliga Tekniska Högskolan
+ * Copyright (c) 1995 - 2005 Kungliga Tekniska Högskolan
  * (Royal Institute of Technology, Stockholm, Sweden).
  * All rights reserved.
  * 
@@ -38,7 +38,7 @@
 
 #include <nnpfs/nnpfs_locl.h>
 #include <nnpfs/nnpfs_dev.h>
-#include <kafs.h>
+#include <arla-pioctl.h>
 #include <nnpfs/nnpfs_syscalls.h>
 #include <nnpfs/nnpfs_common.h>
 #include <linux/file.h>
@@ -56,13 +56,13 @@
 #endif
 
 #ifdef RCSID
-RCSID("$Id: nnpfs_syscalls.c,v 1.113 2005/06/20 13:56:34 lha Exp $");
+RCSID("$Id: nnpfs_syscalls.c,v 1.115 2005/06/21 00:57:32 tol Exp $");
 #endif
 
 static struct proc_dir_entry *nnpfs_procfs_dir;
 
-#define VIOC_SYSCALL _IOW('C',1,void *)
-#define VIOC_SYSCALL32 _IOW('C',1,u32)
+#define ARLA_VIOC_SYSCALL _IOW('C',1,void *)
+#define ARLA_VIOC_SYSCALL32 _IOW('C',1,u32)
 #define NNPFS_PROC_DIR "nnpfs"
 #define NNPFS_PROC_NODE "afs_ioctl"
  
@@ -960,7 +960,7 @@
 		     a_paramsP, a_followSymlinks));
     
     switch (operation) {
-    case AFSCALL_PIOCTL:
+    case arla_AFSCALL_PIOCTL:
 	NNPFSDEB(XDEBSYS, ("nnpfs_pioctl\n"));
 	memcpy(&vice_ioctl,a_paramsP,sizeof(*a_paramsP));
 
@@ -1005,27 +1005,27 @@
 	}
 
 	switch (a_opcode) {
-	case VIOC_FHGET:
-#ifdef VIOC_FHGET_32
-	case VIOC_FHGET_32:
+	case ARLA_VIOC_FHGET:
+#ifdef ARLA_VIOC_FHGET_32
+	case ARLA_VIOC_FHGET_32:
 #endif
 	    error = fhget_call(&vice_ioctl, dentry);
 	    goto unlock;
-	case VIOC_FHOPEN:
-#ifdef VIOC_FHOPEN_32
-	case VIOC_FHOPEN_32:
+	case ARLA_VIOC_FHOPEN:
+#ifdef ARLA_VIOC_FHOPEN_32
+	case ARLA_VIOC_FHOPEN_32:
 #endif
 	    error = fhopen_call(&vice_ioctl, a_followSymlinks);
 	    goto unlock;
-	case VIOC_NNPFSDEBUG:
-#ifdef VIOC_NNPFSDEBUG_32
-	case VIOC_NNPFSDEBUG_32:
+	case ARLA_VIOC_NNPFSDEBUG:
+#ifdef ARLA_VIOC_NNPFSDEBUG_32
+	case ARLA_VIOC_NNPFSDEBUG_32:
 #endif
 	    error = nnpfs_debug (&vice_ioctl);
 	    goto unlock;
-	case VIOC_NNPFSDEBUG_PRINT:
-#ifdef VIOC_NNPFSDEBUG_PRINT_32
-	case VIOC_NNPFSDEBUG_PRINT_32:
+	case ARLA_VIOC_NNPFSDEBUG_PRINT:
+#ifdef ARLA_VIOC_NNPFSDEBUG_PRINT_32
+	case ARLA_VIOC_NNPFSDEBUG_PRINT_32:
 #endif
 	    error = nnpfs_debug_print (&vice_ioctl, dentry);
 	    goto unlock;
@@ -1081,7 +1081,7 @@
 	}
 
 	break;
-    case AFSCALL_SETPAG:
+    case arla_AFSCALL_SETPAG:
 	error = nnpfs_setpag_call();
 	break;
     default:
@@ -1114,7 +1114,7 @@
     struct ViceIoctl vice_ioctl;
     struct ViceIoctl32 vice_ioctl32;
 
-    if (operation == AFSCALL_PIOCTL) {
+    if (operation == arla_AFSCALL_PIOCTL) {
 	if(copy_from_user(&vice_ioctl32, a_paramsP, sizeof(*a_paramsP)) != 0)
 	    return -EFAULT;
 
@@ -1139,7 +1139,7 @@
 {
     struct ViceIoctl vice_ioctl;
 
-    if (operation == AFSCALL_PIOCTL) {
+    if (operation == arla_AFSCALL_PIOCTL) {
 	if(copy_from_user(&vice_ioctl, a_paramsP, sizeof(*a_paramsP)) != 0)
 	    return -EFAULT;
     }
@@ -1155,7 +1155,7 @@
     afsprocdata args;
     long ret;
 
-    if (cmd != VIOC_SYSCALL)
+    if (cmd != ARLA_VIOC_SYSCALL)
 	return -EINVAL;
 
     if (copy_from_user(&args, (void *)arg, sizeof(args)))
@@ -1182,7 +1182,7 @@
     afsprocdata32 args;
     long ret;
 
-    if (cmd != VIOC_SYSCALL32)
+    if (cmd != ARLA_VIOC_SYSCALL32)
 	return -EINVAL;
 
     if (copy_from_user(&args, (void *)arg, sizeof(args)))
@@ -1216,7 +1216,7 @@
     entry->proc_fops = &nnpfs_procfs_fops;
 
 #ifdef CONFIG_COMPAT
-    if (register_ioctl32_conversion(VIOC_SYSCALL32, nnpfs_procfs_ioctl32)) {
+    if (register_ioctl32_conversion(ARLA_VIOC_SYSCALL32, nnpfs_procfs_ioctl32)) {
 	printk(KERN_EMERG "nnpfs_init_procfs: unable to register ioctl32\n");
     }
 #endif /* CONFIG_COMPAT */
@@ -1229,7 +1229,7 @@
 static void nnpfs_exit_procfs(void)
 {
 #ifdef CONFIG_COMPAT
-    if (unregister_ioctl32_conversion(VIOC_SYSCALL32)) {
+    if (unregister_ioctl32_conversion(ARLA_VIOC_SYSCALL32)) {
 	printk(KERN_EMERG "nnpfs_exit_procfs: error unregistering ioctl32\n");
     }
 #endif /* CONFIG_COMPAT */


--- nnpfs/linux/nnpfs_syscalls.c	2005-07-15 20:24:20.000000000 +0200
+++ nnpfs/linux/nnpfs_syscalls.c.new	2005-07-18 11:56:30.000000000 +0200
@@ -87,7 +87,7 @@
 typedef asmlinkage long (*sys_afs_function)(int operation,
 					    char *a_pathP,
 					    int a_opcode,
-					    struct ViceIoctl *a_paramsP,
+					    struct arlaViceIoctl *a_paramsP,
 					    int a_followSymlinks);
 
 typedef asmlinkage long (*sys_setgroups_function)(int, gid_t *);
@@ -677,7 +677,7 @@
  */
 
 static int
-fhget_call(struct ViceIoctl *vice_ioctl, const struct dentry *dentry)
+fhget_call(struct arlaViceIoctl *vice_ioctl, const struct dentry *dentry)
 {
     struct file_handle fh;
     struct nnpfs_cache_handle temp_fh;
@@ -776,7 +776,7 @@
  */
 
 static int
-fhopen_call(struct ViceIoctl *vice_ioctl, int mode)
+fhopen_call(struct arlaViceIoctl *vice_ioctl, int mode)
 {
     struct dentry *dentry;
     struct vfsmount *mnt;
@@ -827,7 +827,7 @@
 }
 
 static int
-nnpfs_debug (struct ViceIoctl *vice_ioctl)
+nnpfs_debug (struct arlaViceIoctl *vice_ioctl)
 {
     if (!capable(CAP_SYS_ADMIN))
         return -EPERM;
@@ -862,7 +862,7 @@
 }
 
 static int
-nnpfs_debug_print (struct ViceIoctl *vice_ioctl, struct dentry *node)
+nnpfs_debug_print (struct arlaViceIoctl *vice_ioctl, struct dentry *node)
 {
     if (!capable(CAP_SYS_ADMIN))
         return -EPERM;
@@ -937,11 +937,11 @@
 sys_afs_int (int operation,
 	     char *a_pathP,
 	     int a_opcode,
-	     struct ViceIoctl *a_paramsP,
+	     struct arlaViceIoctl *a_paramsP,
 	     int a_followSymlinks)
 {
     long error = 0;
-    struct ViceIoctl vice_ioctl; 
+    struct arlaViceIoctl vice_ioctl; 
     struct nnpfs_message_pioctl msg;
     struct nnpfs_message_wakeup_data *msg2;
     struct dentry *dentry = NULL;
@@ -1111,7 +1111,7 @@
 	   struct ViceIoctl32 *a_paramsP,
 	   int a_followSymlinks)
 {
-    struct ViceIoctl vice_ioctl;
+    struct arlaViceIoctl vice_ioctl;
     struct ViceIoctl32 vice_ioctl32;
 
     if (operation == arla_AFSCALL_PIOCTL) {
@@ -1134,10 +1134,10 @@
 sys_afs (int operation,
 	 char *a_pathP,
 	 int a_opcode,
-	 struct ViceIoctl *a_paramsP,
+	 struct arlaViceIoctl *a_paramsP,
 	 int a_followSymlinks)
 {
-    struct ViceIoctl vice_ioctl;
+    struct arlaViceIoctl vice_ioctl;
 
     if (operation == arla_AFSCALL_PIOCTL) {
 	if(copy_from_user(&vice_ioctl, a_paramsP, sizeof(*a_paramsP)) != 0)
@@ -1163,7 +1163,7 @@
     
     ret = sys_afs((int)args.syscall,
 		  (char *)args.param1, (int)args.param2,
-		  (struct ViceIoctl *)args.param3, (int)args.param4);
+		  (struct arlaViceIoctl *)args.param3, (int)args.param4);
     return ret;
 }
 





More information about the Arla-drinkers mailing list