ref: 914d1a53f60d476c1bbdb6a666277780b88ed313
parent: 8ed88939d52a36b141607bac3d0b9acf5427093e
author: gkostka <kostka.grzegorz@gmail.com>
date: Fri Jan 17 13:38:49 EST 2014
1. Extra directory remove caching. 2. Faster inode allocation (but worse inode distribution)
--- a/lwext4/ext4.c
+++ b/lwext4/ext4.c
@@ -1167,6 +1167,9 @@
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, ¤t);
@@ -1300,7 +1303,7 @@
}while(depth);
-
+ ext4_block_delay_cache_flush(mp->fs.bdev, 0);
EXT4_MP_UNLOCK(mp);
return r;
}
--- a/lwext4/ext4_ialloc.c
+++ b/lwext4/ext4_ialloc.c
@@ -186,7 +186,7 @@
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);