mirror of https://github.com/vitalif/e2fsprogs
libext2fs: grow dblist more aggressively
Make the dblist grow more quickly when many directory blocks are added, otherwise the array has to get copied too often, which is slow when it is large. Signed-off-by: Andreas Dilger <adilger@sun.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>bitmap-optimize
parent
ba7b0feef6
commit
9f9e5c3aea
|
@ -164,7 +164,7 @@ errcode_t ext2fs_add_dir_block(ext2_dblist dblist, ext2_ino_t ino, blk_t blk,
|
|||
|
||||
if (dblist->count >= dblist->size) {
|
||||
old_size = dblist->size * sizeof(struct ext2_db_entry);
|
||||
dblist->size += 100;
|
||||
dblist->size += dblist->size > 200 ? dblist->size / 2 : 100;
|
||||
retval = ext2fs_resize_mem(old_size, (size_t) dblist->size *
|
||||
sizeof(struct ext2_db_entry),
|
||||
&dblist->list);
|
||||
|
|
Loading…
Reference in New Issue