|
Voxia OS v0.0.1
Hobby Project Operating System Targeting x86-64
|
#include "autoconf.h"#include "init/init.h"#include "libk/serial.h"#include "llist.h"#include "type.h"#include <hash.h>#include <str.h>#include <vfs/cache.h>#include <vfs/dentry.h>Go to the source code of this file.
Functions | |
| INIT (VfsCache) | |
| struct vfs_cache * | create_vfs_cache () |
| void | hlist_add_head (struct hlist_node *n, struct hlist_head *h) |
| static void | hlist_del (struct hlist_node *n, struct hlist_head *h) |
| __attribute__ ((always_inline)) | |
| struct dentry * | cache_lookup (struct vfs_cache *cache, struct dentry *parent, const char *name) |
| void | cache_remove (struct vfs_cache *cache, struct dentry *dentry) |
| __attribute__ ((used, visibility("default"), section(".export"))) | |
| This function handles memory allocation for a new dentry using the slab allocator. | |
Variables | |
| static struct vfs_cache * | cache_ = 0 |
| __attribute__ | ( | (always_inline) | ) |
Definition at line 72 of file cache.c.
References kstring::c_str, cache, dentry::child_list, dentry::hash, dentry::hash_node, hlist_add_head(), idx, llist_add_tail(), LOG_DEBUG, dentry::name, NULL, dentry::parent, and VFS_CACHE_SIZE.
| __attribute__ | ( | (used, visibility("default"), section(".export")) | ) |
This function handles memory allocation for a new dentry using the slab allocator.
It also links the dentry to its corresponding VNode (if provided).
| 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. |
Definition at line 127 of file cache.c.
References cache_, and KERNEL_API.
| struct dentry * cache_lookup | ( | struct vfs_cache * | cache, |
| struct dentry * | parent, | ||
| const char * | name ) |
Definition at line 92 of file cache.c.
References bucket, kstring::c_str, cache, container_of, h, hash_dentry(), hash_node, idx, dentry::name, name, NULL, dentry::parent, parent, pos, strcmp(), and VFS_CACHE_SIZE.
Definition at line 116 of file cache.c.
References cache, dentry::hash, dentry::hash_node, hlist_del(), idx, and VFS_CACHE_SIZE.
Referenced by delete_dentry(), and vfs_umount_recursive().
| struct vfs_cache * create_vfs_cache | ( | ) |
| void hlist_add_head | ( | struct hlist_node * | n, |
| struct hlist_head * | h ) |
Definition at line 49 of file cache.c.
References h, hlist_node::next, NULL, and hlist_node::prev.
Referenced by __attribute__().
|
static |
Definition at line 58 of file cache.c.
References h, hlist_node::next, NULL, and hlist_node::prev.
Referenced by cache_remove().
| INIT | ( | VfsCache | ) |
Definition at line 34 of file cache.c.
References cache_, create_vfs_cache(), and serial2_printf().
|
static |
Definition at line 32 of file cache.c.
Referenced by __attribute__(), and INIT().