X-Git-Url: https://git.openafs.org/?p=openafs.git;a=blobdiff_plain;f=src%2Fafs%2FLINUX%2Fosi_pag_module.c;h=ac4f800c2d1ba6d070daeaa72b88dd15237dc3d4;hp=8bea5d1e7e1f510bcfd124996581c4b19c31acc0;hb=b7f4f2023b2b3e1aac46715176940fb50cc75265;hpb=2a9ef007a3271ef2e49af13093d4e30c147c0b31 diff --git a/src/afs/LINUX/osi_pag_module.c b/src/afs/LINUX/osi_pag_module.c index 8bea5d1..ac4f800 100644 --- a/src/afs/LINUX/osi_pag_module.c +++ b/src/afs/LINUX/osi_pag_module.c @@ -14,30 +14,21 @@ #include #include "afs/param.h" -RCSID - ("$Header$"); - -#if !defined(AFS_NONFSTRANS) || defined(AFS_AIX_IAUTH_ENV) #include /* early to avoid printf->printk mapping */ #include "afs/sysincludes.h" #include "afsincludes.h" -#include "h/unistd.h" /* For syscall numbers. */ -#include "h/mm.h" +#include /* For syscall numbers. */ +#include #ifdef AFS_AMD64_LINUX20_ENV #include #endif -#ifdef AFS_SPARC64_LINUX20_ENV -#include -#endif #include #include -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0) #include #include #include -#endif static unsigned long nfs_server_addr = 0; #if defined(module_param) && LINUX_VERSION_CODE > KERNEL_VERSION(2,6,9) @@ -55,37 +46,42 @@ MODULE_PARM(this_cell, "s"); #endif MODULE_PARM_DESC(this_cell, "Local cell name"); -#if defined(AFS_LINUX24_ENV) #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16) DEFINE_MUTEX(afs_global_lock); #else DECLARE_MUTEX(afs_global_lock); #endif struct proc_dir_entry *openafs_procfs; -#else -struct semaphore afs_global_lock = MUTEX; -#endif int afs_global_owner = 0; -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0) +#ifdef HAVE_LINUX_KUID_T +struct user_namespace *afs_ns; +#endif + int __init afspag_init(void) -#else -int -init_module(void) -#endif { +#if !defined(EXPORTED_PROC_ROOT_FS) + char path[64]; +#endif int err; +#ifdef HAVE_LINUX_KUID_T + afs_ns = afs_current_user_ns(); +#endif + osi_Init(); err = osi_syscall_init(); if (err) return err; -#ifdef AFS_LINUX24_ENV +#if defined(EXPORTED_PROC_ROOT_FS) openafs_procfs = proc_mkdir(PROC_FSDIRNAME, proc_root_fs); - osi_ioctl_init(); +#else + sprintf(path, "fs/%s", PROC_FSDIRNAME); + openafs_procfs = proc_mkdir(path, NULL); #endif + osi_ioctl_init(); afspag_Init(htonl(nfs_server_addr)); if (this_cell) @@ -94,39 +90,37 @@ init_module(void) return 0; } -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0) void __exit afspag_cleanup(void) -#else -void -cleanup_module(void) -#endif { +#if !defined(EXPORTED_PROC_ROOT_FS) + char path[64]; +#endif osi_syscall_clean(); osi_linux_free_afs_memory(); -#ifdef AFS_LINUX24_ENV osi_ioctl_clean(); +#if defined(EXPORTED_PROC_ROOT_FS) remove_proc_entry(PROC_FSDIRNAME, proc_root_fs); +#else + sprintf(path, "fs/%s", PROC_FSDIRNAME); + remove_proc_entry(path, NULL); #endif return; } -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0) MODULE_LICENSE("http://www.openafs.org/dl/license10.html"); module_init(afspag_init); module_exit(afspag_cleanup); -#endif -#ifdef AFS_LINUX26_ENV /* Hack alert! * These will never be called in the standalone PAG manager, because * they are only referenced in afs_InitReq, and nothing calls that. * However, we need to define them in order to resolve the reference, * unless we want to move afs_InitReq out of afs_osi_pag.c. */ -int osi_linux_nfs_initreq(struct vrequest *av, struct AFS_UCRED *cr, int *code) +int osi_linux_nfs_initreq(struct vrequest *av, afs_ucred_t *cr, int *code) { *code = EACCES; return 1; @@ -134,12 +128,9 @@ int osi_linux_nfs_initreq(struct vrequest *av, struct AFS_UCRED *cr, int *code) int afs_nfsclient_reqhandler(struct afs_exporter *exporter, - struct AFS_UCRED **cred, - afs_int32 host, afs_int32 *pagparam, + afs_ucred_t **cred, + afs_uint32 host, afs_int32 *pagparam, struct afs_exporter **outexporter) { return EINVAL; } -#endif -#endif /* AFS_NONFSTRANS */ -