/* One-time init for all ext2 instances */
void ext2_init(void)
{
- ext2_i_kcache = kmem_cache_create("ext2_i_info", sizeof(struct ext2_i_info),
- __alignof__(struct ext2_i_info), 0, 0, 0);
+ ext2_i_kcache = kmem_cache_create("ext2_i_info",
+ sizeof(struct ext2_i_info),
+ __alignof__(struct ext2_i_info), 0,
+ NULL, 0, 0, NULL);
}
/* Block management */
blksize = 1024 << le32_to_cpu(e2sb->s_log_block_size);
blks_per_group = le32_to_cpu(e2sb->s_blocks_per_group);
num_blk_group = num_blks / blks_per_group + (num_blks % blks_per_group ? 1 : 0);
-
+
if (print) {
printk("EXT2 info:\n-------------------------\n");
printk("Total Inodes: %8d\n", le32_to_cpu(e2sb->s_inodes_cnt));
printk("Volume name: %s\n", e2sb->s_volume_name);
printk("\nBlock Group Info:\n----------------------\n");
}
-
+
for (int i = 0; i < num_blk_group; i++) {
sum_blks += le16_to_cpu(bg[i].bg_free_blocks_cnt);
sum_inodes += le16_to_cpu(bg[i].bg_free_inodes_cnt);
printk("Used Dirs: %8d\n", le16_to_cpu(bg[i].bg_used_dirs_cnt));
}
}
-
+
/* Sanity Assertions. A good ext2 will always pass these. */
inodes_per_grp = le32_to_cpu(e2sb->s_inodes_per_group);
blks_per_group = le32_to_cpu(e2sb->s_blocks_per_group);
struct ext2_dirent *dir_buf, *dir_i;
if (!ext2_foreach_dirent(dir, lookup_each_func, (long)dentry, 0, 0))
return dentry;
- printd("EXT2: Not Found, %s\n", dentry->d_name.name);
+ printd("EXT2: Not Found, %s\n", dentry->d_name.name);
return 0;
}
assert(e2dir->dir_namelen <= MAX_FILENAME_SZ);
strlcpy(dirent->d_name, (char*)e2dir->dir_name, e2dir->dir_namelen + 1);
ext2_put_metablock(dir->f_dentry->d_sb, blk_buf);
-
+
/* At the end of the directory, sort of. ext2 often preallocates blocks, so
* this will cause us to walk along til the end, which isn't quite right. */
if (dir->f_dentry->d_inode->i_size == dirent->d_off)