From f2b0348eb4b32cbaec3a5680fc9b95423659f1ca Mon Sep 17 00:00:00 2001 From: "Enrico Fraccaroli (Galfurian)" Date: Thu, 7 Apr 2022 13:08:03 -0400 Subject: [PATCH] Update the used_dirs_count when we create a new directory. --- mentos/src/fs/ext2.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mentos/src/fs/ext2.c b/mentos/src/fs/ext2.c index ca673f0..1e6dabc 100644 --- a/mentos/src/fs/ext2.c +++ b/mentos/src/fs/ext2.c @@ -2691,6 +2691,10 @@ static int ext2_mkdir(const char *path, mode_t permission) vfs_close(parent); return -ENOENT; } + // Increase the number of directories inside the group. + fs->block_groups[group_index].used_dirs_count += 1; + // Update the bgdt. + ext2_write_bgdt(fs); // Write the inode. if (ext2_write_inode(fs, &inode, inode_index) == -1) { pr_err("Failed to write the newly created inode.\n");