From 7832f4a896e0e162ce414c5850427fd71d3e28ce Mon Sep 17 00:00:00 2001 From: Michael Shaw Date: Fri, 27 Oct 2023 22:42:50 -0400 Subject: [PATCH] ext2: replace struct inode with ext2_inode --- fs/ext2.c | 2 +- fs/vfs.c | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/fs/ext2.c b/fs/ext2.c index c8bf6d0..cd66110 100644 --- a/fs/ext2.c +++ b/fs/ext2.c @@ -663,7 +663,7 @@ static int ext2_open_file(struct fs *vfs, struct file *file, const char *path) return ret; } - memcpy(&file->inode, inode, sizeof(struct inode)); + memcpy(&file->inode, inode, sizeof(struct ext2_inode)); file->size = inode->size; file->type = inode_to_ftype[inode->mode >> 12]; file->inode_num = inode_no; diff --git a/fs/vfs.c b/fs/vfs.c index a6890eb..8122b4f 100644 --- a/fs/vfs.c +++ b/fs/vfs.c @@ -283,10 +283,9 @@ void vfs_init(const char *rootdev_name) struct fs *fs = ext2_init_fs(rootdev); if (!fs) { kprintf(LOG_ERROR "Failed to mount root device %s\n", rootdev_name); - return; + panic(); } else { kprintf(LOG_DEBUG "Mounted root device %s\n", rootdev_name); - panic(); } fs->mount_point = kzalloc(2, ALLOC_KERN);