This function handles memory allocation for a new dentry using the slab allocator.
It also links the dentry to its corresponding VNode (if provided).
- Note
- This function performs lazy initialization of the dentry slab cache if it does not exist yet.
- Parameters
-
| name | The name of the file or directory. |
| vnode | Pointer to the associated VNode (inode data). Pass NULL if the VNode is not yet available. |
- Returns
- dentry_ptr A pointer to the newly allocated and initialized dentry.
Definition at line 31 of file ioapic.c.
References __initrd_data, __serial2_producer_lock, ALIGN_UP, alloc_minor(), base, ioforge_usb_device::base, block_device_cache, BLOCK_SIZE, kstring::c_str, cache_, cap, kstring::cap, dentry::child_list, ioforge_usb_device::class_code, atomic_t::counter, create_and_attach_vnode(), CREATE_MISSING_ENTRY, data, hlist_node::dentry, dentry_cache, dev_chain, ioforge_pci_device::device_id, ioforge_device::first_child, flags, foreach_block_device_by_type(), get_current_core_data(), get_kernel_vmm_page(), dentry::hash, hash_dentry(), dentry::hash_node, header, vnode::id, initrd_read(), ioapic_base_addr, IOAPICREDTBL, ioforge_attach(), ioforge_can_contain_block_device(), ioforge_can_contain_usb_device(), ioforge_get_root(), IOFORGE_NIC, IOFORGE_PCI, IOFORGE_USB_DEVICE, IOFORGE_VIRTIO, irq_restore(), irq_save(), kalloc(), kalloc_global_lock, KALLOC_REDZONE_MAGIC, KALLOC_REDZONE_SIZE, KALLOC_SLAB_ALLOC, KERNEL_API, kfree(), kstring::len, len, llist_init(), lock, lock_irqsave(), LOG2_DEBUG, LOG2_INFO, LOG_DEBUG, LOG_ERROR, LOG_WARN, kalloc_metadata_t::magic, cdev::major, major, MAX_USB_NODES, memcopy(), memset(), cdev::minor, minor, mount_cache, multicore_start, dentry::name, filesystem::name, ioforge_device::name, name, filesystem::next, hlist_node::next, ioforge_device::next_sibling, NIL, NULL, offset, cdev::ops, ops, vnode::ops, PAGE_PRESENT, PAGE_USER, PAGE_WRITABLE, paging_get_highest_page_map(), dentry::parent, parent, parse_before_multicore(), parse_multicore(), ioforge_virtio_device::pci, pci, pci_read16(), pci_write16(), pci_write32(), vnode::permission, phys_base_alloc(), hlist_node::prev, print_dentry_tree(), print_device_tree(), ptr, rbt_insert_node(), rbt_node_cache, vops_file_t::read, read_ioapic_register(), dentry::refcount, reg, registered_filesystems, resolve_dentry(), root, serial2_printf(), ioforge_usb_device::serial_number, serial_printf(), ioforge_nic_service::service, setup_redzone(), kalloc_metadata_t::size, size, vnode::size, slab_free(), spin_acquire(), spin_release(), stack, strlen(), strncmp(), ioforge_block_device::type, ioforge_device::type, type, vnode::type, unlock_irqrestore(), vaddr_alloc_locked(), vector, ioforge_pci_device::vendor_id, VFS_OK, vfs_tree, virtio_root, vma_register(), dentry::vnode, vnode_cache, vnode_id, vnode::vnode_private, VNODE_TYPE_DIR, VNODE_TYPE_FILE, vxCreateSlabCache(), vxMultipleMmap(), and vxSlabAlloc().