2 * Copyright 2000, International Business Machines Corporation and others.
5 * This software has been released under the terms of the IBM Public
6 * License. For details, see the LICENSE file in the top-level source
7 * directory or online at http://www.openafs.org/dl/license10.html
11 * Linux module support routines.
14 #include <afsconfig.h>
15 #include "afs/param.h"
20 #include <linux/module.h> /* early to avoid printf->printk mapping */
21 #include "afs/sysincludes.h"
22 #include "afsincludes.h"
23 #include "h/unistd.h" /* For syscall numbers. */
26 #ifdef AFS_AMD64_LINUX20_ENV
27 #include <asm/ia32_unistd.h>
29 #ifdef AFS_SPARC64_LINUX20_ENV
30 #include <linux/ioctl32.h>
33 #include <linux/proc_fs.h>
34 #include <linux/slab.h>
35 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
36 #include <linux/init.h>
37 #include <linux/sched.h>
38 #include <linux/kernel.h>
41 static unsigned long nfs_server_addr = 0;
42 #if defined(module_param)
43 module_param(nfs_server_addr, long, 0);
45 MODULE_PARM(nfs_server_addr, "l");
47 MODULE_PARM_DESC(nfs_server_addr, "IP Address of NFS Server");
49 static char *this_cell = 0;
50 #if defined(module_param_array) && LINUX_VERSION_CODE > KERNEL_VERSION(2,6,9)
51 module_param_array(this_cell, charp, 0);
53 MODULE_PARM(this_cell, "s");
55 MODULE_PARM_DESC(this_cell, "Local cell name");
57 #if defined(AFS_LINUX24_ENV)
58 DECLARE_MUTEX(afs_global_lock);
59 struct proc_dir_entry *openafs_procfs;
61 struct semaphore afs_global_lock = MUTEX;
63 int afs_global_owner = 0;
65 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
77 err = osi_syscall_init();
80 #ifdef AFS_LINUX24_ENV
81 openafs_procfs = proc_mkdir(PROC_FSDIRNAME, proc_root_fs);
85 afspag_Init(htonl(nfs_server_addr));
87 afspag_SetPrimaryCell(this_cell);
92 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
102 osi_linux_free_afs_memory();
104 #ifdef AFS_LINUX24_ENV
106 remove_proc_entry(PROC_FSDIRNAME, proc_root_fs);
111 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
112 MODULE_LICENSE("http://www.openafs.org/dl/license10.html");
113 module_init(afspag_init);
114 module_exit(afspag_cleanup);
117 #ifdef AFS_LINUX26_ENV
119 * These will never be called in the standalone PAG manager, because
120 * they are only referenced in afs_InitReq, and nothing calls that.
121 * However, we need to define them in order to resolve the reference,
122 * unless we want to move afs_InitReq out of afs_osi_pag.c.
124 int osi_linux_nfs_initreq(struct vrequest *av, struct AFS_UCRED *cr, int *code)
131 afs_nfsclient_reqhandler(struct afs_exporter *exporter,
132 struct AFS_UCRED **cred,
133 afs_int32 host, afs_int32 *pagparam,
134 struct afs_exporter **outexporter)