LINUX 5.3.0: Check for 'recurse' arg in keyring_search
[openafs.git] / src / afs / LINUX / osi_syscall.c
index 19dc78f..921a7a8 100644 (file)
 #include <afsconfig.h>
 #include "afs/param.h"
 
+#ifdef LINUX_KEYRING_SUPPORT
+/* The syscall probing stuff is unnecessary (and is never called) if we have
+ * keyrings support; we rely on keyrings instead of group ids to track PAGs.
+ * So if we have keyrings, just stub out the syscall functions to do nothing. */
+int
+osi_syscall_init(void)
+{
+    return 0;
+}
+void
+osi_syscall_clean(void)
+{
+    return;
+}
+
+#else /* LINUX_KEYRING_SUPPORT */
 
 #include <linux/module.h> /* early to avoid printf->printk mapping */
 #include "afs/sysincludes.h"
@@ -99,10 +115,10 @@ uint32_t syscall_jump_code[] = {
 };
 #endif
 
-extern long afs_xsetgroups(int gidsetsize, gid_t * grouplist);
+extern asmlinkage long afs_xsetgroups(int gidsetsize, gid_t * grouplist);
 asmlinkage long (*sys_setgroupsp) (int gidsetsize, gid_t * grouplist);
 
-extern int afs_xsetgroups32(int gidsetsize, gid_t * grouplist);
+extern asmlinkage long afs_xsetgroups32(int gidsetsize, gid_t * grouplist);
 asmlinkage int (*sys_setgroups32p) (int gidsetsize,
                                    __kernel_gid32_t * grouplist);
 
@@ -111,9 +127,9 @@ asmlinkage int (*sys_setgroups32p) (int gidsetsize,
 static SYSCALLTYPE *afs_ia32_sys_call_table;
 static SYSCALLTYPE ia32_ni_syscall = 0;
 
-extern int afs32_xsetgroups();
+extern asmlinkage long afs32_xsetgroups(int gidsetsize, u16 * grouplist);
 asmlinkage long (*sys32_setgroupsp) (int gidsetsize, u16 * grouplist);
-extern int afs32_xsetgroups32();
+extern asmlinkage long afs32_xsetgroups32(int gidsetsize, gid_t * grouplist);
 asmlinkage long (*sys32_setgroups32p) (int gidsetsize, gid_t * grouplist);
 #endif /* AFS_AMD64_LINUX20_ENV */
 
@@ -125,7 +141,7 @@ static SYSCALLTYPE afs_ni_syscall32 = 0;
 static SYSCALLTYPE old_sys_setgroupsp = 0;
 static SYSCALLTYPE old_sys32_setgroupsp = 0;
 
-extern int afs32_xsetgroups();
+asmlinkage long afs32_xsetgroups(int gidsetsize, gid_t *grouplist);
 asmlinkage long (*sys32_setgroupsp)(int gidsetsize, gid_t *grouplist);
 
 asmlinkage long sys_close(unsigned int fd);
@@ -151,12 +167,12 @@ static void sys32_setgroups_stub(void)
 static SYSCALLTYPE *afs_sys_call_table32;
 static SYSCALLTYPE afs_ni_syscall32 = 0;
 
-extern int afs32_xsetgroups();
+extern asmlinkage long afs32_xsetgroups(int gidsetsize, u16 * grouplist);
 asmlinkage int (*sys32_setgroupsp) (int gidsetsize,
                                    __kernel_gid32_t * grouplist);
 /* This number is not exported for some bizarre reason. */
 #define __NR_setgroups32      82
-extern int afs32_xsetgroups32();
+extern asmlinkage long afs32_xsetgroups32(int gidsetsize, gid_t * grouplist);
 asmlinkage int (*sys32_setgroups32p) (int gidsetsize,
                                      __kernel_gid32_t * grouplist);
 
@@ -461,8 +477,8 @@ int osi_syscall_init(void)
 
         flush_cache((void *)afs_sys_call_table, 2*NR_syscalls*sizeof(void*));
 
-       sys_setgroupsp = sys_setgroups_stub;
-       sys32_setgroupsp = sys32_setgroups_stub;
+       sys_setgroupsp = POINTER2SYSCALL sys_setgroups_stub;
+       sys32_setgroupsp = POINTER2SYSCALL sys32_setgroups_stub;
     }
 /***** COMMON (except IA64 or PPC64) *****/
 #else /* !AFS_IA64_LINUX20_ENV */
@@ -626,3 +642,5 @@ void osi_syscall_clean(void)
     }
 #endif
 }
+
+#endif /* !LINUX_KEYRING_SUPPORT */