int init_module(void) #endif { #if !defined(EXPORTED_PROC_ROOT_FS) && defined(AFS_LINUX24_ENV) char path[64]; #endif int err; 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); #else sprintf(path, "fs/%s", PROC_FSDIRNAME); openafs_procfs = proc_mkdir(path, NULL); #endif osi_ioctl_init(); #endif afspag_Init(htonl(nfs_server_addr)); if (this_cell) afspag_SetPrimaryCell(this_cell); return 0; }
int init_module(void) #endif { int err; AFS_RWLOCK_INIT(&afs_xosi, "afs_xosi"); #if !defined(AFS_LINUX24_ENV) /* obtain PAGE_OFFSET value */ afs_linux_page_offset = get_page_offset(); #ifndef AFS_S390_LINUX22_ENV if (afs_linux_page_offset == 0) { /* couldn't obtain page offset so can't continue */ printf("afs: Unable to obtain PAGE_OFFSET. Exiting.."); return -EIO; } #endif /* AFS_S390_LINUX22_ENV */ #endif /* !defined(AFS_LINUX24_ENV) */ osi_Init(); #ifndef LINUX_KEYRING_SUPPORT err = osi_syscall_init(); if (err) return err; #endif err = afs_init_inodecache(); if (err) { #ifndef LINUX_KEYRING_SUPPORT osi_syscall_clean(); #endif return err; } err = register_filesystem(&afs_fs_type); if (err) { afs_destroy_inodecache(); #ifndef LINUX_KEYRING_SUPPORT osi_syscall_clean(); #endif return err; } osi_sysctl_init(); #ifdef LINUX_KEYRING_SUPPORT osi_keyring_init(); #endif #ifdef AFS_LINUX24_ENV osi_proc_init(); osi_ioctl_init(); #endif #if defined(AFS_CACHE_BYPASS) afs_warn("Cache bypass patched libafs module init.\n"); #endif afs_init_pagecopy(); return 0; }