mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 23:07:35 +00:00
Kernel: Use divide_rounded_up inside write_block_list_for_inode
This commit is contained in:
parent
869b33d6dd
commit
9ce0639383
1 changed files with 1 additions and 3 deletions
|
@ -339,9 +339,7 @@ KResult Ext2FS::write_block_list_for_inode(InodeIndex inode_index, ext2_inode& e
|
||||||
remaining_blocks -= new_shape.doubly_indirect_blocks;
|
remaining_blocks -= new_shape.doubly_indirect_blocks;
|
||||||
output_block_index += new_shape.doubly_indirect_blocks;
|
output_block_index += new_shape.doubly_indirect_blocks;
|
||||||
} else {
|
} else {
|
||||||
unsigned indirect_block_count = new_shape.doubly_indirect_blocks / entries_per_block;
|
unsigned indirect_block_count = divide_rounded_up(new_shape.doubly_indirect_blocks, entries_per_block);
|
||||||
if ((new_shape.doubly_indirect_blocks % entries_per_block) != 0)
|
|
||||||
indirect_block_count++;
|
|
||||||
|
|
||||||
auto dind_block_contents = ByteBuffer::create_uninitialized(block_size());
|
auto dind_block_contents = ByteBuffer::create_uninitialized(block_size());
|
||||||
if (dind_block_new) {
|
if (dind_block_new) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue