Skip to content

Commit

Permalink
Fix frag count calculation comparing bytes to pages.
Browse files Browse the repository at this point in the history
  • Loading branch information
kilobyte committed Aug 23, 2022
1 parent c6953ce commit ceb17a3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions compsize.c
Original file line number Diff line number Diff line change
Expand Up @@ -166,9 +166,9 @@ static void parse_file_extent_item(uint8_t *bp, uint32_t hlen,
if (!IS_ALIGNED(disk_bytenr, 1 << 12))
die("%s: Extent not 4K-aligned at %"PRIu64"?!?\n", filename, disk_bytenr);

disk_bytenr >>= 12;
unsigned long pageno = disk_bytenr >> 12;
radix_tree_preload(GFP_KERNEL);
if (radix_tree_insert(&ws->seen_extents, disk_bytenr, (void *)disk_bytenr) == 0)
if (radix_tree_insert(&ws->seen_extents, pageno, (void *)pageno) == 0)
{
ws->disk[comp_type] += disk_num_bytes;
ws->uncomp[comp_type] += ram_bytes;
Expand Down

1 comment on commit ceb17a3

@tbertels
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#47

Please sign in to comment.