mirror of
https://github.com/drasko/codezero.git
synced 2026-04-02 01:59:05 +02: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:
@@ -127,6 +127,7 @@ struct vnode *memfs_alloc_vnode(struct superblock *sb)
|
||||
/* Associate memfs-specific fields with vnode */
|
||||
v->ops = memfs_vnode_operations;
|
||||
v->fops = memfs_file_operations;
|
||||
v->sb = sb;
|
||||
|
||||
/* Return the vnode */
|
||||
return v;
|
||||
@@ -315,7 +316,10 @@ int memfs_vnode_readdir(struct vnode *v)
|
||||
return 0;
|
||||
|
||||
/* This is as big as a page */
|
||||
v->dirbuf.buffer = vfs_alloc_dirpage();
|
||||
if (IS_ERR(v->dirbuf.buffer = vfs_alloc_dirpage(v))) {
|
||||
printf("%s: Could not allocate dirbuf.\n", __FUNCTION__);
|
||||
return (int)v->dirbuf.buffer;
|
||||
}
|
||||
v->dirbuf.npages = 1;
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user