/* * Copyright 2000, International Business Machines Corporation and others. * All Rights Reserved. * * This software has been released under the terms of the IBM Public * License. For details, see the LICENSE file in the top-level source * directory or online at http://www.openafs.org/dl/license10.html */ /* * Linux module support routines. * */ #include #include "afs/param.h" #include /* early to avoid printf->printk mapping */ #include "afs/sysincludes.h" #include "afsincludes.h" #include /* For syscall numbers. */ #include #ifdef AFS_AMD64_LINUX_ENV #include #endif #include #include #include #include #include #include "osi_pagecopy.h" extern struct file_system_type afs_fs_type; DEFINE_MUTEX(afs_global_lock); int afs_global_owner = 0; #ifdef HAVE_LINUX_KUID_T struct user_namespace *afs_ns; #endif int __init afs_init(void) { int err; #ifdef HAVE_LINUX_KUID_T afs_ns = afs_current_user_ns(); #endif osi_Init(); /* Initialize CellLRU since it is used while traversing CellServDB proc * entry */ QInit(&CellLRU); #if !defined(AFS_NONFSTRANS) osi_linux_nfssrv_init(); #endif err = osi_syscall_init(); if (err) return err; err = afs_init_inodecache(); if (err) { osi_syscall_clean(); return err; } err = register_filesystem(&afs_fs_type); if (err) { afs_destroy_inodecache(); osi_syscall_clean(); return err; } osi_sysctl_init(); #ifdef LINUX_KEYRING_SUPPORT osi_keyring_init(); #endif osi_proc_init(); osi_ioctl_init(); afs_init_pagecopy(); return 0; } void __exit afs_cleanup(void) { afs_shutdown_pagecopy(); #ifdef LINUX_KEYRING_SUPPORT osi_keyring_shutdown(); #endif osi_sysctl_clean(); osi_syscall_clean(); unregister_filesystem(&afs_fs_type); afs_destroy_inodecache(); #if !defined(AFS_NONFSTRANS) osi_linux_nfssrv_shutdown(); #endif shutdown_osisleep(); osi_linux_free_afs_memory(); osi_ioctl_clean(); osi_proc_clean(); return; } MODULE_LICENSE("http://www.openafs.org/dl/license10.html"); module_init(afs_init); module_exit(afs_cleanup);