mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-10-27 20:58:22 +00:00
page cache: proper truncation
This commit is contained in:
@@ -99,10 +99,11 @@ void mm_init();
|
||||
|
||||
extern size_t mm_cache_cached_pages;
|
||||
|
||||
// the mm_cache_* functions that take a vnode NEED it to be taken from a source which is not from the page_t itself
|
||||
#define MM_CACHE_GET_PAGE_FLAGS_NO_POPULATE 1
|
||||
int mm_cache_get_page(vnode_t *vnode, uintmax_t offset, int flags, page_t **res);
|
||||
int mm_cache_take_page(page_t *page);
|
||||
void mm_cache_make_dirty(page_t *page);
|
||||
void mm_cache_take_page(page_t *page);
|
||||
void mm_cache_make_dirty(vnode_t *vnode, page_t *page);
|
||||
int mm_cache_truncate(vnode_t *vnode, uintmax_t offset);
|
||||
int mm_cache_sync_vnode(vnode_t *vnode);
|
||||
int mm_cache_sync(void);
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
#define PAGE_FLAGS_READY 16
|
||||
#define PAGE_FLAGS_ERROR 32
|
||||
#define PAGE_FLAGS_SYNCING 64
|
||||
#define PAGE_FLAGS_RECLAIMING 128
|
||||
|
||||
typedef struct page_t {
|
||||
struct vnode_t *backing;
|
||||
@@ -47,6 +48,7 @@ void mm_page_init();
|
||||
void mm_get_page_statistics(size_t *total_pages, size_t *free_pages);
|
||||
void mm_unlock_page(page_t *page);
|
||||
bool mm_is_page_locked(page_t *page);
|
||||
void mm_make_page_anonymous(page_t *page);
|
||||
|
||||
extern uintptr_t hhdm_base;
|
||||
|
||||
|
||||
@@ -147,6 +147,8 @@ typedef struct vnode_t {
|
||||
|
||||
pushlock_t pages_lock;
|
||||
trie_t pages;
|
||||
size_t page_reclaim_handoffs;
|
||||
eventheader_t zero_reclaim_event;
|
||||
|
||||
mutex_t adv_mutex;
|
||||
advlock_t *advlock;
|
||||
@@ -222,6 +224,8 @@ typedef struct vops_t {
|
||||
(vn)->vfsmounted = NULL; \
|
||||
trie_init(&(vn)->pages); \
|
||||
(vn)->pages_lock = 0; \
|
||||
(vn)->page_reclaim_handoffs = 0; \
|
||||
EVENT_INITHEADER(&(vn)->zero_reclaim_event); \
|
||||
MUTEX_INIT(&(vn)->writeback_mutex); \
|
||||
MUTEX_INIT(&(vn)->dirty_list_mutex); \
|
||||
(vn)->dirty = false; \
|
||||
|
||||
Reference in New Issue
Block a user