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"
18 #include <linux/module.h> /* early to avoid printf->printk mapping */
19 #include "afs/sysincludes.h"
20 #include "afsincludes.h"
21 #include <linux/unistd.h> /* For syscall numbers. */
24 #ifdef AFS_AMD64_LINUX20_ENV
25 #include <asm/ia32_unistd.h>
28 #include <linux/proc_fs.h>
29 #include <linux/slab.h>
30 #include <linux/init.h>
31 #include <linux/sched.h>
32 #include <linux/kernel.h>
34 #include "osi_pagecopy.h"
36 extern struct file_system_type afs_fs_type
;
38 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16)
39 DEFINE_MUTEX(afs_global_lock
);
41 DECLARE_MUTEX(afs_global_lock
);
43 int afs_global_owner
= 0;
45 #ifdef HAVE_LINUX_KUID_T
46 struct user_namespace
*afs_ns
;
53 AFS_RWLOCK_INIT(&afs_xosi
, "afs_xosi");
55 #ifdef HAVE_LINUX_KUID_T
56 afs_ns
= afs_current_user_ns();
60 #if !defined(AFS_NONFSTRANS)
61 osi_linux_nfssrv_init();
64 err
= osi_syscall_init();
67 err
= afs_init_inodecache();
72 err
= register_filesystem(&afs_fs_type
);
74 afs_destroy_inodecache();
80 #ifdef LINUX_KEYRING_SUPPORT
93 afs_shutdown_pagecopy();
95 #ifdef LINUX_KEYRING_SUPPORT
96 osi_keyring_shutdown();
100 unregister_filesystem(&afs_fs_type
);
102 afs_destroy_inodecache();
103 #if !defined(AFS_NONFSTRANS)
104 osi_linux_nfssrv_shutdown();
107 osi_linux_free_afs_memory();
115 MODULE_LICENSE("http://www.openafs.org/dl/license10.html");
116 module_init(afs_init
);
117 module_exit(afs_cleanup
);