ext2: mark root vnode no_free

This commit is contained in:
Michael Shaw 2024-01-26 18:43:59 -05:00
commit d54aa794c5
2 changed files with 3 additions and 2 deletions

View file

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

View file

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