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"
17 #include <linux/module.h> /* early to avoid printf->printk mapping */
18 #include "afs/sysincludes.h"
19 #include "afsincludes.h"
20 #include <linux/unistd.h> /* For syscall numbers. */
23 #ifdef AFS_AMD64_LINUX20_ENV
24 #include <asm/ia32_unistd.h>
26 #ifdef AFS_SPARC64_LINUX20_ENV
27 #include <linux/ioctl32.h>
30 #include <linux/proc_fs.h>
31 #include <linux/slab.h>
32 #include <linux/init.h>
33 #include <linux/sched.h>
34 #include <linux/kernel.h>
36 static unsigned long nfs_server_addr = 0;
37 #if defined(module_param) && LINUX_VERSION_CODE > KERNEL_VERSION(2,6,9)
38 module_param(nfs_server_addr, long, 0);
40 MODULE_PARM(nfs_server_addr, "l");
42 MODULE_PARM_DESC(nfs_server_addr, "IP Address of NFS Server");
44 static char *this_cell = 0;
45 #if defined(module_param_array) && LINUX_VERSION_CODE > KERNEL_VERSION(2,6,9)
46 module_param(this_cell, charp, 0);
48 MODULE_PARM(this_cell, "s");
50 MODULE_PARM_DESC(this_cell, "Local cell name");
52 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16)
53 DEFINE_MUTEX(afs_global_lock);
55 DECLARE_MUTEX(afs_global_lock);
57 struct proc_dir_entry *openafs_procfs;
58 int afs_global_owner = 0;
63 #if !defined(EXPORTED_PROC_ROOT_FS)
70 err = osi_syscall_init();
73 #if defined(EXPORTED_PROC_ROOT_FS)
74 openafs_procfs = proc_mkdir(PROC_FSDIRNAME, proc_root_fs);
76 sprintf(path, "fs/%s", PROC_FSDIRNAME);
77 openafs_procfs = proc_mkdir(path, NULL);
81 afspag_Init(htonl(nfs_server_addr));
83 afspag_SetPrimaryCell(this_cell);
91 #if !defined(EXPORTED_PROC_ROOT_FS)
96 osi_linux_free_afs_memory();
99 #if defined(EXPORTED_PROC_ROOT_FS)
100 remove_proc_entry(PROC_FSDIRNAME, proc_root_fs);
102 sprintf(path, "fs/%s", PROC_FSDIRNAME);
103 remove_proc_entry(path, NULL);
108 MODULE_LICENSE("http://www.openafs.org/dl/license10.html");
109 module_init(afspag_init);
110 module_exit(afspag_cleanup);
113 * These will never be called in the standalone PAG manager, because
114 * they are only referenced in afs_InitReq, and nothing calls that.
115 * However, we need to define them in order to resolve the reference,
116 * unless we want to move afs_InitReq out of afs_osi_pag.c.
118 int osi_linux_nfs_initreq(struct vrequest *av, afs_ucred_t *cr, int *code)
125 afs_nfsclient_reqhandler(struct afs_exporter *exporter,
127 afs_int32 host, afs_int32 *pagparam,
128 struct afs_exporter **outexporter)