From 315a491d390a26c668ede6c8fa703b7620c10d08 Mon Sep 17 00:00:00 2001 From: Justus Winter <4winter@informatik.uni-hamburg.de> Date: Sun, 22 Nov 2015 20:19:52 +0100 Subject: ext2fs: keep list of reusable disk cache entries This avoids a linear scan through the cache. * ext2fs/ext2fs.h (struct disk_cache_info): New field 'next'. * ext2fs/pager.c (disk_cache_hint): Drop. (disk_cache_info_free, disk_cache_info_free_lock): New variables. (disk_cache_info_free_pop, disk_cache_info_free_push): New functions. (disk_cache_init): Adjust slightly. (disk_cache_block_ref): Use new functions. (disk_cache_block_deref): Likewise. --- ext2fs/ext2fs.h | 1 + 1 file changed, 1 insertion(+) (limited to 'ext2fs/ext2fs.h') diff --git a/ext2fs/ext2fs.h b/ext2fs/ext2fs.h index 0b6b79ef..b8398192 100644 --- a/ext2fs/ext2fs.h +++ b/ext2fs/ext2fs.h @@ -254,6 +254,7 @@ struct disk_cache_info block_t block; uint16_t flags; uint16_t ref_count; + struct disk_cache_info *next; /* List of reusable entries. */ #ifdef DEBUG_DISK_CACHE block_t last_read, last_read_xor; #endif -- cgit v1.2.3