Inode::Inode(Volume* volume, ino_t id) : fVolume(volume), fID(id), fCache(NULL), fMap(NULL), fCached(false), fHasExtraAttributes(false) { rw_lock_init(&fLock, "ext2 inode"); recursive_lock_init(&fSmallDataLock, "ext2 inode small data"); TRACE("Inode::Inode(): ext2_inode: %lu, disk inode: %lu\n", sizeof(ext2_inode), fVolume->InodeSize()); fNodeSize = sizeof(ext2_inode) > fVolume->InodeSize() ? fVolume->InodeSize() : sizeof(ext2_inode); fInitStatus = UpdateNodeFromDisk(); if (fInitStatus == B_OK) { fHasExtraAttributes = (fNodeSize == sizeof(ext2_inode) && fNode.ExtraInodeSize() + EXT2_INODE_NORMAL_SIZE == sizeof(ext2_inode)); if (IsDirectory() || (IsSymLink() && Size() < 60)) { TRACE("Inode::Inode(): Not creating the file cache\n"); fCached = false; fInitStatus = B_OK; } else fInitStatus = EnableFileCache(); } else TRACE("Inode: Failed initialization\n"); }
Interface::Interface(const char* interfaceName, net_device_interface* deviceInterface) : fBusy(false) { TRACE("Interface %p: new \"%s\", device interface %p\n", this, interfaceName, deviceInterface); int written = strlcpy(name, interfaceName, IF_NAMESIZE); memset(name + written, 0, IF_NAMESIZE - written); // Clear remaining space device = deviceInterface->device; index = ++sInterfaceIndex; flags = 0; type = 0; mtu = deviceInterface->device->mtu; metric = 0; fDeviceInterface = acquire_device_interface(deviceInterface); recursive_lock_init(&fLock, name); // Grab a reference to the networking stack, to make sure it won't be // unloaded as long as an interface exists module_info* module; get_module(gNetStackInterfaceModule.info.name, &module); }
status_t register_domain(int family, const char* name, struct net_protocol_module_info* module, struct net_address_module_info* addressModule, net_domain** _domain) { TRACE(("register_domain(%d, %s)\n", family, name)); MutexLocker locker(sDomainLock); struct net_domain_private* domain = lookup_domain(family); if (domain != NULL) return B_NAME_IN_USE; domain = new(std::nothrow) net_domain_private; if (domain == NULL) return B_NO_MEMORY; recursive_lock_init(&domain->lock, name); domain->family = family; domain->name = name; domain->module = module; domain->address_module = addressModule; sDomains.Add(domain); *_domain = domain; return B_OK; }
DefaultNotificationService::DefaultNotificationService(const char* name) : fName(name) { recursive_lock_init(&fLock, name); NotificationManager::Manager().RegisterService(*this); }
status_t elf_reinit_after_fork(void) { recursive_lock_init(&sLock, kLockName); // We also need to update the IDs of our images. We are the child and // and have cloned images with different IDs. Since in most cases (fork() // + exec*()) this would just increase the fork() overhead with no one // caring, we do that lazily, when first doing something different. gInvalidImageIDs = true; return B_OK; }
Inode::Inode(Volume* volume) : fVolume(volume), fID(0), fCache(NULL), fMap(NULL), fInitStatus(B_NO_INIT) { rw_lock_init(&fLock, "ext2 inode"); recursive_lock_init(&fSmallDataLock, "ext2 inode small data"); TRACE("Inode::Inode(): ext2_inode: %lu, disk inode: %" B_PRIu32 "\n", sizeof(ext2_inode), fVolume->InodeSize()); fNodeSize = sizeof(ext2_inode) > fVolume->InodeSize() ? fVolume->InodeSize() : sizeof(ext2_inode); }
static status_t init() { sTeamHash = hash_init(64, Session::NextOffset(), &team_compare, &team_hash); if (sTeamHash == NULL) return B_NO_MEMORY; status_t status; sPrefetchHash = hash_init(64, Session::NextOffset(), &prefetch_compare, &prefetch_hash); if (sPrefetchHash == NULL) { status = B_NO_MEMORY; goto err1; } recursive_lock_init(&sLock, "launch speedup"); // register kernel syscalls if (register_generic_syscall(LAUNCH_SPEEDUP_SYSCALLS, launch_speedup_control, 1, 0) != B_OK) { status = B_ERROR; goto err3; } // read in prefetch knowledge base mkdir("/etc/launch_cache", 0755); load_prefetch_data(); // start boot session sMainSession = start_session(-1, -1, -1, "system boot"); sMainSession->Unlock(); dprintf("START BOOT %Ld\n", system_time()); return B_OK; err3: recursive_lock_destroy(&sLock); hash_uninit(sPrefetchHash); err1: hash_uninit(sTeamHash); return status; }
status_t init_interfaces() { recursive_lock_init(&sLock, "net interfaces"); mutex_init(&sHashLock, "net local addresses"); new (&sInterfaces) InterfaceList; new (&sAddressTable) AddressTable; // static C++ objects are not initialized in the module startup #if ENABLE_DEBUGGER_COMMANDS add_debugger_command("net_interface", &dump_interface, "Dump the given network interface"); add_debugger_command("net_interfaces", &dump_interfaces, "Dump all network interfaces"); add_debugger_command("net_local", &dump_local, "Dump all local interface addresses"); add_debugger_command("net_route", &dump_route, "Dump the given network route"); #endif return B_OK; }
VMTranslationMap::VMTranslationMap() : fMapCount(0) { recursive_lock_init(&fLock, "translation map"); }