AquilaOS documentation
How it works, and its code
Toggle main menu visibility
Loading...
Searching...
No Matches
vcache.h
Go to the documentation of this file.
1
#ifndef _FS_VCACHE_H
2
#define _FS_VCACHE_H
3
4
#include <
fs/vfs.h
>
5
#include <
ds/hashmap.h
>
6
10
struct
vcache
{
11
struct
hashmap
*
hashmap
;
12
};
13
14
/* Sets up a cache; adds, removes and finds a vnode. */
15
void
vcache_init
(
struct
vcache
*
vcache
);
16
int
vcache_insert
(
struct
vcache
*
vcache
,
struct
vnode
*
vnode
);
17
int
vcache_remove
(
struct
vcache
*
vcache
,
struct
vnode
*
vnode
);
18
struct
vnode
*
vcache_find
(
struct
vcache
*
vcache
,
ino_t
ino
);
19
20
MALLOC_DECLARE
(M_VCACHE);
21
22
#endif
/* ! _FS_VCACHE_H */
hashmap.h
MALLOC_DECLARE
#define MALLOC_DECLARE(type)
Definition
kvmem.h:29
vcache
A filesystem's vnode cache (fs/vcache.c): its vnodes in memory, by their inode number,...
Definition
vcache.h:10
vcache::hashmap
struct hashmap * hashmap
Definition
vcache.h:11
vnode
A file in memory (a vnode): what its inode says, and the kernel's own state.
Definition
vfs.h:113
vnode::ino
ino_t ino
Definition
vfs.h:114
ino_t
uintptr_t ino_t
Definition
types.h:23
vcache_init
void vcache_init(struct vcache *vcache)
Sets up an empty vnode cache.
Definition
vcache.c:25
vcache_find
struct vnode * vcache_find(struct vcache *vcache, ino_t ino)
Finds the cached vnode of an inode.
Definition
vcache.c:80
vcache_insert
int vcache_insert(struct vcache *vcache, struct vnode *vnode)
Adds a vnode to a cache.
Definition
vcache.c:37
vcache_remove
int vcache_remove(struct vcache *vcache, struct vnode *vnode)
Takes a vnode out of a cache.
Definition
vcache.c:56
vfs.h
kernel
include
fs
vcache.h
Generated by
1.18.0