1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-28 17:35:08 +00:00

Kernel/FileSystem: Rename logical_block_size -> device_block_size

This never was a logical block size, it always was a device specific
block size. Ideally the block size would change in accordance to
whatever the driver wants to use, but that is a change for the future.
For now, let's get rid of this confusing naming.
This commit is contained in:
kleines Filmröllchen 2023-07-24 22:12:09 +02:00 committed by Jelle Raaijmakers
parent bf1610d378
commit d1e6e6110d
8 changed files with 41 additions and 41 deletions

View file

@ -31,7 +31,7 @@ ErrorOr<void> FATFS::initialize_while_locked()
VERIFY(m_lock.is_locked());
VERIFY(!is_initialized_while_locked());
m_boot_record = TRY(KBuffer::try_create_with_size("FATFS: Boot Record"sv, m_logical_block_size));
m_boot_record = TRY(KBuffer::try_create_with_size("FATFS: Boot Record"sv, m_device_block_size));
auto boot_record_buffer = UserOrKernelBuffer::for_kernel_buffer(m_boot_record->data());
TRY(raw_read(0, boot_record_buffer));
@ -62,10 +62,10 @@ ErrorOr<void> FATFS::initialize_while_locked()
return EINVAL;
}
m_logical_block_size = boot_record()->bytes_per_sector;
set_block_size(m_logical_block_size);
m_device_block_size = boot_record()->bytes_per_sector;
set_block_size(m_device_block_size);
u32 root_directory_sectors = ((boot_record()->root_directory_entry_count * sizeof(FATEntry)) + (m_logical_block_size - 1)) / m_logical_block_size;
u32 root_directory_sectors = ((boot_record()->root_directory_entry_count * sizeof(FATEntry)) + (m_device_block_size - 1)) / m_device_block_size;
m_first_data_sector = boot_record()->reserved_sector_count + (boot_record()->fat_count * boot_record()->sectors_per_fat) + root_directory_sectors;
TRY(BlockBasedFileSystem::initialize_while_locked());