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:
Bahadir Balban
2008-04-13 00:23:21 +01:00
parent 367e455506
commit 2efffdfa88
5 changed files with 22 additions and 19 deletions

View File

@@ -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 *);

View File

@@ -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)