mirror of
https://github.com/drasko/codezero.git
synced 2026-01-14 11:53:15 +01:00
Fixed the error that dirent structure was not matching userland structure.
This commit is contained in:
@@ -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 */
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user