Fixed the error that dirent structure was not matching userland structure.

This commit is contained in:
Bahadir Balban
2009-10-08 18:37:43 +03:00
parent 4966b2bea9
commit d888267f58
4 changed files with 6 additions and 8 deletions

View File

@@ -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 */

View File

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

View File

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

View File

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