11#ifndef DFS_PAGE_CACHE_H__
12#define DFS_PAGE_CACHE_H__
16#ifdef RT_USING_PAGECACHE
35 struct rt_aspace *aspace;
43 struct util_avl_struct avl_node;
55 struct dfs_aspace *aspace;
60 ssize_t (*
read)(
struct dfs_file *file,
struct dfs_page *page);
61 ssize_t (*
write)(
struct dfs_page *page);
67 char *fullpath, *pathname;
74 struct util_avl_root avl_root;
75 struct dfs_page *avl_page;
82 struct dfs_vnode *vnode;
83 const struct dfs_aspace_ops *ops;
86#ifndef RT_PAGECACHE_HASH_NR
87#define RT_PAGECACHE_HASH_NR 1024
96 struct rt_messagequeue *mqueue;
100struct dfs_aspace *dfs_aspace_create(
struct dfs_dentry *dentry,
struct dfs_vnode *vnode,
const struct dfs_aspace_ops *ops);
101int dfs_aspace_destroy(
struct dfs_aspace *aspace);
103int dfs_aspace_read(
struct dfs_file *file,
void *buf,
size_t count, off_t *pos);
104int dfs_aspace_write(
struct dfs_file *file,
const void *buf,
size_t count, off_t *pos);
105int dfs_aspace_flush(
struct dfs_aspace *aspace);
106int dfs_aspace_clean(
struct dfs_aspace *aspace);
108void *dfs_aspace_mmap(
struct dfs_file *file,
struct rt_varea *varea,
void *vaddr);
109int dfs_aspace_unmap(
struct dfs_file *file,
struct rt_varea *varea);
110int dfs_aspace_page_unmap(
struct dfs_file *file,
struct rt_varea *varea,
void *vaddr);
111int dfs_aspace_page_dirty(
struct dfs_file *file,
struct rt_varea *varea,
void *vaddr);
113off_t dfs_aspace_fpos(
struct rt_varea *varea,
void *vaddr);
114void *dfs_aspace_vaddr(
struct rt_varea *varea, off_t fpos);
116int dfs_aspace_mmap_read(
struct dfs_file *file,
struct rt_varea *varea,
void *data);
117int dfs_aspace_mmap_write(
struct dfs_file *file,
struct rt_varea *varea,
void *data);
119void dfs_pcache_release(
size_t count);
120void dfs_pcache_unmount(
struct dfs_mnt *mnt);
121void dfs_pcache_clean(
struct dfs_mnt *mnt);
ssize_t write(int fd, const void *buf, size_t len)
ssize_t read(int fd, void *buf, size_t len)
struct rt_list_node rt_list_t