Skip to content

Commit

Permalink
Fix runlists becoming too large (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
Schamper authored Nov 11, 2022
1 parent 18d589b commit abd3482
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion dissect/ffs/ffs.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ def open(self):
return RunlistStream(self.fs.fh, self.dataruns(), self.size, self.fs.fragment_size)

def _iter_blocks(self):
num_blocks = (self.size + self.fs.block_size - 1) // self.fs.block_size
num_blocks = (self.size + (self.fs.block_size - 1)) // self.fs.block_size
num_direct_blocks = min(num_blocks, c_ffs.UFS_NDADDR)

blocks = self.inode.di_db[:num_direct_blocks]
Expand All @@ -320,6 +320,9 @@ def _iter_blocks(self):
yield block
num_blocks -= 1

if num_blocks == 0:
return

def _walk_indirect(self, block, level, num_blocks):
yield block, level

Expand Down

0 comments on commit abd3482

Please sign in to comment.