update main #1

Merged
Sinipelto merged 240 commits from Bananymous/banan-os:main into main 2023-11-20 13:20:51 +02:00
1 changed files with 4 additions and 2 deletions
Showing only changes of commit feafc57b63 - Show all commits

View File

@ -5,6 +5,8 @@
#include <kernel/Storage/DiskCache.h> #include <kernel/Storage/DiskCache.h>
#include <kernel/Storage/StorageDevice.h> #include <kernel/Storage/StorageDevice.h>
#define DEBUG_SYNC 0
namespace Kernel namespace Kernel
{ {
@ -146,7 +148,7 @@ namespace Kernel
sector_start++; sector_start++;
else else
{ {
dprintln("syncing {}->{}", cache.first_sector + sector_start, cache.first_sector + sector_start + sector_count); dprintln_if(DEBUG_SYNC, "syncing {}->{}", cache.first_sector + sector_start, cache.first_sector + sector_start + sector_count);
TRY(m_device.write_sectors_impl(cache.first_sector + sector_start, sector_count, m_sync_cache.data() + sector_start * m_sector_size)); TRY(m_device.write_sectors_impl(cache.first_sector + sector_start, sector_count, m_sync_cache.data() + sector_start * m_sector_size));
sector_start += sector_count + 1; sector_start += sector_count + 1;
sector_count = 0; sector_count = 0;
@ -155,7 +157,7 @@ namespace Kernel
if (sector_count > 0) if (sector_count > 0)
{ {
dprintln("syncing {}->{}", cache.first_sector + sector_start, cache.first_sector + sector_start + sector_count); dprintln_if(DEBUG_SYNC, "syncing {}->{}", cache.first_sector + sector_start, cache.first_sector + sector_start + sector_count);
TRY(m_device.write_sectors_impl(cache.first_sector + sector_start, sector_count, m_sync_cache.data() + sector_start * m_sector_size)); TRY(m_device.write_sectors_impl(cache.first_sector + sector_start, sector_count, m_sync_cache.data() + sector_start * m_sector_size));
} }