summaryrefslogtreecommitdiff
path: root/Kernel/FileSystem
diff options
context:
space:
mode:
authorGunnar Beutner <gbeutner@serenityos.org>2021-05-02 01:32:04 +0200
committerAndreas Kling <kling@serenityos.org>2021-05-03 08:42:39 +0200
commit6990ab41c8d4ce9865bde0a75e750240f7c5157a (patch)
tree170d192b69556adc84f755129d4ace8ec0dfd21e /Kernel/FileSystem
parentb613817bcaada76f75289129e4987eafdaff6d87 (diff)
downloadserenity-6990ab41c8d4ce9865bde0a75e750240f7c5157a.zip
Kernel: Fix some 64-bit portability issues
Diffstat (limited to 'Kernel/FileSystem')
-rw-r--r--Kernel/FileSystem/Ext2FileSystem.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/Kernel/FileSystem/Ext2FileSystem.cpp b/Kernel/FileSystem/Ext2FileSystem.cpp
index d5e1814172..ff34c1c201 100644
--- a/Kernel/FileSystem/Ext2FileSystem.cpp
+++ b/Kernel/FileSystem/Ext2FileSystem.cpp
@@ -854,7 +854,7 @@ KResultOr<ssize_t> Ext2FSInode::read_bytes(off_t offset, ssize_t count, UserOrKe
for (auto bi = first_block_logical_index; remaining_count && bi <= last_block_logical_index; bi = bi.value() + 1) {
auto block_index = m_block_list[bi.value()];
size_t offset_into_block = (bi == first_block_logical_index) ? offset_into_first_block : 0;
- size_t num_bytes_to_copy = min((off_t)block_size - offset_into_block, remaining_count);
+ size_t num_bytes_to_copy = min((size_t)block_size - offset_into_block, (size_t)remaining_count);
auto buffer_offset = buffer.offset(nread);
if (block_index.value() == 0) {
// This is a hole, act as if it's filled with zeroes.
@@ -1005,7 +1005,7 @@ KResultOr<ssize_t> Ext2FSInode::write_bytes(off_t offset, ssize_t count, const U
for (auto bi = first_block_logical_index; remaining_count && bi <= last_block_logical_index; bi = bi.value() + 1) {
size_t offset_into_block = (bi == first_block_logical_index) ? offset_into_first_block : 0;
- size_t num_bytes_to_copy = min((off_t)block_size - offset_into_block, remaining_count);
+ size_t num_bytes_to_copy = min((size_t)block_size - offset_into_block, (size_t)remaining_count);
dbgln_if(EXT2_DEBUG, "Ext2FSInode[{}]::write_bytes(): Writing block {} (offset_into_block: {})", identifier(), m_block_list[bi.value()], offset_into_block);
if (auto result = fs().write_block(m_block_list[bi.value()], data.offset(nwritten), num_bytes_to_copy, offset_into_block, allow_cache); result.is_error()) {
dbgln("Ext2FSInode[{}]::write_bytes(): Failed to write block {} (index {})", identifier(), m_block_list[bi.value()], bi);