From d54aa794c595bbba17ab0e0096dcafa43ace7ae7 Mon Sep 17 00:00:00 2001 From: Michael Shaw Date: Fri, 26 Jan 2024 18:43:59 -0500 Subject: [PATCH] ext2: mark root vnode no_free --- fs/ext2.c | 3 ++- include/fs/vfs.h | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/fs/ext2.c b/fs/ext2.c index 7fbe8ad..2f3ab6b 100644 --- a/fs/ext2.c +++ b/fs/ext2.c @@ -1303,13 +1303,14 @@ struct fs *ext2_init_fs(struct block_device *bdev) } memset(ret->root, 0, sizeof(struct vnode)); + ret->root->name[0] = '/'; ret->root->fs = ret; ret->root->size = root_inode->size; ret->root->uid = root_inode->uid; ret->root->gid = root_inode->gid; ret->root->flags = root_inode->mode; ret->root->ino_num = EXT2_ROOT_INO; - ret->root->name[0] = '/'; + ret->root->no_free = true; return ret; } diff --git a/include/fs/vfs.h b/include/fs/vfs.h index b531317..21870dc 100644 --- a/include/fs/vfs.h +++ b/include/fs/vfs.h @@ -66,7 +66,7 @@ struct vnode { struct dirent *dirents; /* for directories */ - bool mount_point; /* is this vnode a fs root? */ + bool mount_ptr; /* does this node point to a root of a mounted fs? */ bool no_free; /* permanently cached vnodes */ };