Browse Source

1. Extra directory remove caching.

2. Faster inode allocation (but worse inode distribution)
pull/1/head
gkostka 11 years ago
parent
commit
914d1a53f6
  1. 5
      lwext4/ext4.c
  2. 2
      lwext4/ext4_ialloc.c

5
lwext4/ext4.c

@ -1167,6 +1167,9 @@ int ext4_dir_rm(const char *path)
inode_current = f.inode;
dir_end = false;
ext4_block_delay_cache_flush(mp->fs.bdev, 1);
do {
/*Load directory node.*/
r = ext4_fs_get_inode_ref(&f.mp->fs, inode_current, &current);
@ -1300,7 +1303,7 @@ int ext4_dir_rm(const char *path)
}while(depth);
ext4_block_delay_cache_flush(mp->fs.bdev, 0);
EXT4_MP_UNLOCK(mp);
return r;
}

2
lwext4/ext4_ialloc.c

@ -186,7 +186,7 @@ int ext4_ialloc_alloc_inode(struct ext4_fs *fs, uint32_t *index, bool is_dir)
uint32_t used_dirs = ext4_bg_get_used_dirs_count(bg, sb);
/* Check if this block group is good candidate for allocation */
if (free_inodes >= avg_free_inodes) {
if (free_inodes > 0) {
/* Load block with bitmap */
uint32_t bitmap_block_addr = ext4_bg_get_inode_bitmap(
bg_ref.block_group, sb);

Loading…
Cancel
Save