Voxia OS v0.0.1
Hobby Project Operating System Targeting x86-64
Loading...
Searching...
No Matches
cache.h
Go to the documentation of this file.
1#ifndef __VFS__CACHE_H_
2#define __VFS__CACHE_H_
3
4#include <type.h>
5
6#define VFS_CACHE_SIZE 32
7
8struct hlist_node {
9 struct hlist_node* next;
10 struct hlist_node* prev;
11 void* dentry;
12};
13
14struct hlist_head {
15 struct hlist_node* first; // kepala bucket (hanya satu pointer)
16};
17
18#define hlist_for_each(pos, head, member) \
19 for (pos = (head->first == NULL) ? NULL \
20 : container_of((head)->first, \
21 typeof(*pos), member); \
22 pos != NULL; \
23 pos = (pos->member.next) ? container_of(pos->member.next, \
24 typeof(*pos), member) \
25 : NULL)
26
27struct dentry;
28
34
35void hlist_add_head(struct hlist_node* n, struct hlist_head* h);
36
40struct dentry*
41cache_lookup(struct vfs_cache* cache, struct dentry* parent, const char* name);
42
43void cache_remove(struct vfs_cache* cache, struct dentry* dentry);
44
45#endif // __VFS__CACHE_H_
struct SDT h
Definition acpi.h:0
struct vfs_cache * create_vfs_cache()
Definition cache.c:39
struct vfs_cache * get_root_cache()
void vfs_cache_insert(struct vfs_cache *cache, struct dentry *dentry)
#define VFS_CACHE_SIZE
Definition cache.h:6
void cache_remove(struct vfs_cache *cache, struct dentry *dentry)
Definition cache.c:116
void hlist_add_head(struct hlist_node *n, struct hlist_head *h)
Definition cache.c:49
struct dentry * cache_lookup(struct vfs_cache *cache, struct dentry *parent, const char *name)
Definition cache.c:92
kstring name
Definition dentry.h:5
dentry_ptr parent
Definition dentry.h:7
typedef __attribute__
Definition msi.c:47
struct process_node cache
Definition process.h:10
struct hlist_node * first
Definition cache.h:15
struct hlist_node * next
Definition cache.h:9
struct hlist_node * prev
Definition cache.h:10
void * dentry
Definition cache.h:11
uint8_t lock
Definition cache.h:31
int count
Definition cache.h:32
struct hlist_head buckets[32]
Definition cache.h:30
unsigned char uint8_t
Definition type.h:7