bcachefs: Use crc_is_compressed()

Trivial cleanup.

Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
This commit is contained in:
Kent Overstreet 2022-03-31 22:05:33 -04:00 committed by Kent Overstreet
parent c32fc674d4
commit 75f02de43f

View file

@ -675,10 +675,9 @@ static s64 ptr_disk_sectors(s64 sectors, struct extent_ptr_decoded p)
{
EBUG_ON(sectors < 0);
return p.crc.compression_type &&
p.crc.compression_type != BCH_COMPRESSION_TYPE_incompressible
return crc_is_compressed(p.crc)
? DIV_ROUND_UP_ULL(sectors * p.crc.compressed_size,
p.crc.uncompressed_size)
p.crc.uncompressed_size)
: sectors;
}