search for: cache_block_size

Displaying 2 results from an estimated 2 matches for "cache_block_size".

2009 May 24
0
malloc() in the core
...ing to be changing from 512 to 4K sectors over the next several years, and second because filesystems like ext2 have metadata which is more logically cached on the filesystem block level): static struct cache_struct cache_head, cache[MAX_CACHE_ENTRIES]; static uint8_t cache_data[65536]; static int cache_block_size; static int cache_entries; void cache_init(int block_size) { struct cache_struct *prev, *cur; uint8_t *data = cache_data; int i; cache_block_size = block_size; cache_entries = sizeof cache_data / block_size; if (cache_entries > MAX_CACHE_ENTRIES) cache_entries = MAX_CACHE...
2013 Dec 26
0
[PATCH] core: Avoid initializing the cache more than once
...core/include/fs.h | 1 + 4 files changed, 7 insertions(+), 2 deletions(-) diff --git a/core/fs/cache.c b/core/fs/cache.c index 3b21fc2..798c622 100644 --- a/core/fs/cache.c +++ b/core/fs/cache.c @@ -55,6 +55,8 @@ void cache_init(struct device *dev, int block_size_shift) data += dev->cache_block_size; prev = cur++; } + + dev->cache_init = 1; /* Set cache as initialized */ } /* diff --git a/core/fs/diskio.c b/core/fs/diskio.c index 7d95d67..e9a4c1d 100644 --- a/core/fs/diskio.c +++ b/core/fs/diskio.c @@ -28,6 +28,7 @@ struct device * device_init(void *args) dev.disk...