summaryrefslogtreecommitdiff
path: root/ext2fs/ext2fs.h
diff options
context:
space:
mode:
authorJustus Winter <4winter@informatik.uni-hamburg.de>2015-11-22 20:19:52 +0100
committerJustus Winter <4winter@informatik.uni-hamburg.de>2015-11-29 23:59:48 +0100
commit315a491d390a26c668ede6c8fa703b7620c10d08 (patch)
tree2656ce11fd292e29b8afbcd972f3a58915210831 /ext2fs/ext2fs.h
parentfe9ece07747eb7281e0749a3dde7c02267af8ae6 (diff)
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.
Diffstat (limited to 'ext2fs/ext2fs.h')
-rw-r--r--ext2fs/ext2fs.h1
1 files changed, 1 insertions, 0 deletions
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