On Mon, 26 Mar 2001, Derrick J Brashear wrote:
> It currently hooks that only on sparc64; If a patch to implement hooking
> it for other cases isn't forthcoming then when it comes time to prepare
> OpenAFS 1.0.4 I will implement it.
Attached you will find a patch against the latest sources from CVS
(src/afs/LINUX/osi_module.c revision 1.8 and src/afs/LINUX/osi_groups.c
revision 1.4). I 've tried to share most of the code with the sparc64
hook.
Thomas.
--
----------------------------------------------------------
Thomas Mller, TU Chemnitz, URZ, D-09107 Chemnitz, Germany
----------------------------------------------------------
diff -Naurw src.orig/afs/LINUX/osi_groups.c src/afs/LINUX/osi_groups.c
--- src.orig/afs/LINUX/osi_groups.c Wed Mar 28 13:21:03 2001
+++ src/afs/LINUX/osi_groups.c Wed Mar 28 13:26:15 2001
@@ -126,8 +126,12 @@
return code;
}
-#ifdef AFS_SPARC64_LINUX20_ENV
+#if defined(AFS_SPARC64_LINUX20_ENV) || defined(AFS_LINUX24_ENV)
+#if defined(AFS_SPARC64_LINUX20_ENV)
asmlinkage int afs_xsetgroups32(int gidsetsize, __kernel_gid_t32 *grouplist)
+#else
+asmlinkage int afs_xsetgroups32(int gidsetsize, __kernel_gid32_t *grouplist)
+#endif
{
gid_t gl[NGROUPS];
int ret, i;
diff -Naurw src.orig/afs/LINUX/osi_module.c src/afs/LINUX/osi_module.c
--- src.orig/afs/LINUX/osi_module.c Thu Mar 29 11:07:38 2001
+++ src/afs/LINUX/osi_module.c Thu Mar 29 11:12:44 2001
@@ -48,7 +48,11 @@
/* Since sys_ni_syscall is not exported, I need to cache it in order to restore
* it.
*/
+#ifdef AFS_SPARC64_LINUX20_ENV
static unsigned int afs_ni_syscall = 0;
+#else
+static void* afs_ni_syscall = 0;
+#endif
#ifdef AFS_SPARC64_LINUX20_ENV
static unsigned int afs_ni_syscall32 = 0;
@@ -69,6 +73,10 @@
}
#endif
+#if defined(AFS_LINUX24_ENV)
+asmlinkage int (*sys_setgroupsp32)(int gidsetsize, __kernel_gid32_t *grouplist);
+#endif
+
#ifdef AFS_SPARC64_LINUX20_ENV
#define POINTER2SYSCALL (unsigned int)(unsigned long)
#define SYSCALL2POINTER (void *)(long)
@@ -81,7 +89,7 @@
{
extern int afs_syscall();
extern int afs_xsetgroups();
-#ifdef AFS_SPARC64_LINUX20_ENV
+#if defined(AFS_SPARC64_LINUX20_ENV) || defined(AFS_LINUX24_ENV)
extern int afs_xsetgroups32();
#endif
@@ -127,6 +135,10 @@
sys_setgroupsp32 = SYSCALL2POINTER sys_call_table32[__NR_setgroups];
sys_call_table32[__NR_setgroups] = POINTER2SYSCALL afs_xsetgroups32;
#endif
+#if defined(AFS_LINUX24_ENV)
+ sys_setgroupsp32 = SYSCALL2POINTER sys_call_table[__NR_setgroups32];
+ sys_call_table[__NR_setgroups32] = POINTER2SYSCALL afs_xsetgroups32;
+#endif
return 0;
}
@@ -141,7 +153,9 @@
sys_call_table32[__NR_setgroups] = POINTER2SYSCALL sys_setgroupsp32;
sys_call_table32[__NR_afs_syscall] = afs_ni_syscall32;
#endif
-
+#if defined(AFS_LINUX24_ENV)
+ sys_call_table[__NR_setgroups32] = POINTER2SYSCALL sys_setgroupsp32;
+#endif
unregister_filesystem(&afs_file_system);
osi_linux_free_inode_pages(); /* Invalidate all pages using AFS inodes. */