block_cache: enable prefetching

* Allocate blocks and add them to the hash table so they are
  available for a future block_cache_get call.
* Make use of prefetching in FAT driver.
* A client filesystem may request to prefetch a block run that
  contains some blocks that are already cached.  The request will
  be truncated at the first such block in the run.
* Fixes #19186.

Change-Id: I8d2e3cff15e5b46569438e0dc085e2b391aa57a5
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8525
Reviewed-by: waddlesplash <[email protected]>
This commit is contained in:
Jim906
2024-11-16 18:26:21 +00:00
committed by waddlesplash
parent e6bf67457c
commit 9bb1816c14
7 changed files with 314 additions and 0 deletions
+1
View File
@@ -78,6 +78,7 @@ extern const void *block_cache_get(void *cache, off_t blockNumber);
extern status_t block_cache_set_dirty(void *cache, off_t blockNumber,
bool isDirty, int32 transaction);
extern void block_cache_put(void *cache, off_t blockNumber);
extern status_t block_cache_prefetch(void* cache, off_t blockNumber, size_t* _numBlocks);
/* file cache */
extern void *file_cache_create(dev_t mountID, ino_t vnodeID, off_t size);