mirror of
https://github.com/drasko/codezero.git
synced 2026-02-07 15:33:16 +01:00
Seem to have fixed dirbuf allocation.
Dirbuf allocation was broken, fixed it. Added more comments on reading directories. Issues: fs0 ought to check buf address for sys_readdir(). Currently test0 is passing an area on its stack and fs0 is writing the data to its own address space (i.e. an area on its own stack.)
This commit is contained in:
@@ -86,8 +86,6 @@ extern struct vnode_ops memfs_vnode_operations;
|
||||
extern struct superblock_ops memfs_superblock_operations;
|
||||
extern struct file_ops memfs_file_operations;
|
||||
|
||||
extern struct memfs_superblock *memfs_superblock;
|
||||
|
||||
int memfs_format_filesystem(void *buffer);
|
||||
struct memfs_inode *memfs_create_inode(struct memfs_superblock *sb);
|
||||
void memfs_register_fstype(struct list_head *);
|
||||
|
||||
@@ -27,19 +27,18 @@ extern struct list_head dentry_cache;
|
||||
* Normally mm0 tracks all vnode pages, but this is used to track pages in
|
||||
* directory vnodes, which are normally never mapped by tasks.
|
||||
*/
|
||||
extern struct memfs_superblock *memfs_superblock;
|
||||
static inline void *vfs_alloc_dirpage(void)
|
||||
static inline void *vfs_alloc_dirpage(struct vnode *v)
|
||||
{
|
||||
/*
|
||||
* Urgh, we allocate from the block cache of memfs to store generic vfs directory
|
||||
* pages. This is currently the quickest we can allocate page-aligned memory.
|
||||
*/
|
||||
return memfs_alloc_block(memfs_superblock);
|
||||
return memfs_alloc_block(v->sb->fs_super);
|
||||
}
|
||||
|
||||
static inline void vfs_free_dirpage(void *block)
|
||||
static inline void vfs_free_dirpage(struct vnode *v, void *block)
|
||||
{
|
||||
memfs_free_block(memfs_superblock, block);
|
||||
memfs_free_block(v->sb->fs_super, block);
|
||||
}
|
||||
|
||||
static inline struct dentry *vfs_alloc_dentry(void)
|
||||
|
||||
Reference in New Issue
Block a user