From d888267f5894e7a14edcfb1511662994e814b279 Mon Sep 17 00:00:00 2001 From: Bahadir Balban Date: Thu, 8 Oct 2009 18:37:43 +0300 Subject: [PATCH] Fixed the error that dirent structure was not matching userland structure. --- conts/posix/mm0/include/fs.h | 5 +++-- conts/posix/mm0/include/memfs/memfs.h | 3 ++- conts/posix/mm0/mm/clone.c | 4 ---- conts/posix/test0/include/tests.h | 2 +- 4 files changed, 6 insertions(+), 8 deletions(-) diff --git a/conts/posix/mm0/include/fs.h b/conts/posix/mm0/include/fs.h index ad48af3..0df0319 100644 --- a/conts/posix/mm0/include/fs.h +++ b/conts/posix/mm0/include/fs.h @@ -105,13 +105,14 @@ struct dirbuf { }; /* Posix-style dirent format used by userspace. Returned by sys_readdir() */ -#define DIRENT_NAME_MAX 32 +#define DIRENT_NAME_MAX 256 struct dirent { u32 inum; /* Inode number */ u32 offset; /* Dentry offset in its buffer */ u16 rlength; /* Record length */ + u8 type; /* Dir type */ u8 name[DIRENT_NAME_MAX]; /* Name string */ -}; +} __attribute__((__packed__)); struct vnode { unsigned long vnum; /* Filesystem-wide unique vnode id */ diff --git a/conts/posix/mm0/include/memfs/memfs.h b/conts/posix/mm0/include/memfs/memfs.h index 229d97e..64d3054 100644 --- a/conts/posix/mm0/include/memfs/memfs.h +++ b/conts/posix/mm0/include/memfs/memfs.h @@ -80,8 +80,9 @@ struct memfs_dentry { u32 inum; /* Inode number */ u32 offset; /* Dentry offset in its buffer */ u16 rlength; /* Record length */ + u8 type; /* Record type */ u8 name[MEMFS_DNAME_MAX]; /* Name string */ -}; +} __attribute__((__packed__)); extern struct vnode_ops memfs_vnode_operations; extern struct superblock_ops memfs_superblock_operations; diff --git a/conts/posix/mm0/mm/clone.c b/conts/posix/mm0/mm/clone.c index 312c88d..afeead6 100644 --- a/conts/posix/mm0/mm/clone.c +++ b/conts/posix/mm0/mm/clone.c @@ -52,7 +52,6 @@ int sys_fork(struct tcb *parent) BUG(); /* Create and prefault a shared page for child and map it to vfs task */ - BUG(); //shpage_map_to_task(child, find_task(VFS_TID), // SHPAGE_NEW_ADDRESS | SHPAGE_NEW_SHM | // SHPAGE_PREFAULT); @@ -108,13 +107,10 @@ int do_clone(struct tcb *parent, unsigned long child_stack, unsigned int flags) BUG(); /* Create and prefault a shared page for child and map it to vfs task */ - BUG(); //shpage_map_to_task(child, find_task(VFS_TID), // SHPAGE_NEW_ADDRESS | SHPAGE_NEW_SHM | // SHPAGE_PREFAULT); - /* We can now notify vfs about forked process */ - BUG(); /* Add child to global task list */ global_add_task(child); diff --git a/conts/posix/test0/include/tests.h b/conts/posix/test0/include/tests.h index e6e313f..4e46a81 100644 --- a/conts/posix/test0/include/tests.h +++ b/conts/posix/test0/include/tests.h @@ -3,7 +3,7 @@ #define __TASKNAME__ "test0" -//#define TEST_VERBOSE_PRINT +#define TEST_VERBOSE_PRINT #if defined (TEST_VERBOSE_PRINT) #define test_printf(...) printf(__VA_ARGS__) #else