kernel/fs: Add support for setting custom VMCaches in vnodes.

This adds one (private) VFS function, and checks in all usages of
the vnode->cache as a VMVnodeCache that it really is one. (Generic
usages, for the moment just the ReleaseRef() calls in vnode
destruction, are intentionally not touched.)

This will be used by ramfs to set the cache from its own,
so that map_file() calls on a ramfs can work.
This commit is contained in:
Augustin Cavalier
2019-08-31 20:38:18 -04:00
parent 69c34116f0
commit a9be0efb2e
3 changed files with 32 additions and 4 deletions
+1
View File
@@ -112,6 +112,7 @@ status_t vfs_synchronous_io(io_request* request,
void* cookie);
status_t vfs_get_vnode_cache(struct vnode *vnode, struct VMCache **_cache,
bool allocate);
status_t vfs_set_vnode_cache(struct vnode *vnode, struct VMCache *_cache);
status_t vfs_get_file_map(struct vnode *vnode, off_t offset, size_t size,
struct file_io_vec *vecs, size_t *_count);
status_t vfs_get_fs_node_from_path(fs_volume *volume, const char *path,