From 4221bfdf7473622a64b8c96b58a223c1dcbfd44f Mon Sep 17 00:00:00 2001 From: Bertrand Songis Date: Wed, 31 Aug 2016 23:54:36 +0200 Subject: [PATCH] =?UTF-8?q?[Horus]=C2=A0Attempt=20to=20fix=20the=20problem?= =?UTF-8?q?=20with=20some=20files=20after=20a=20massstorage=20session?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- radio/src/disk_cache.cpp | 15 +++++++++++++++ radio/src/disk_cache.h | 24 +++++++++++++----------- radio/src/targets/horus/diskio.cpp | 2 ++ 3 files changed, 30 insertions(+), 11 deletions(-) diff --git a/radio/src/disk_cache.cpp b/radio/src/disk_cache.cpp index df63e5d1e..16722034c 100644 --- a/radio/src/disk_cache.cpp +++ b/radio/src/disk_cache.cpp @@ -71,6 +71,11 @@ void DiskCacheBlock::free(DWORD sector, UINT count) } } +void DiskCacheBlock::free() +{ + endSector = 0; +} + bool DiskCacheBlock::empty() const { return (endSector == 0); @@ -84,6 +89,16 @@ DiskCache::DiskCache(): blocks = new DiskCacheBlock[DISK_CACHE_BLOCKS_NUM]; } +void DiskCache::clear() +{ + lastBlock = 0; + stats.noHits = 0; + stats.noMisses = 0; + for (int n=0; n