Update the used_dirs_count when we create a new directory.
This commit is contained in:
@@ -2691,6 +2691,10 @@ static int ext2_mkdir(const char *path, mode_t permission)
|
|||||||
vfs_close(parent);
|
vfs_close(parent);
|
||||||
return -ENOENT;
|
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.
|
// Write the inode.
|
||||||
if (ext2_write_inode(fs, &inode, inode_index) == -1) {
|
if (ext2_write_inode(fs, &inode, inode_index) == -1) {
|
||||||
pr_err("Failed to write the newly created inode.\n");
|
pr_err("Failed to write the newly created inode.\n");
|
||||||
|
|||||||
Reference in New Issue
Block a user