bcachefs: Use crc_is_compressed()
authorKent Overstreet <kent.overstreet@gmail.com>
Fri, 1 Apr 2022 02:05:33 +0000 (22:05 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:09:30 +0000 (17:09 -0400)
Trivial cleanup.

Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
fs/bcachefs/buckets.c

index 31de803..dcb2ea3 100644 (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;
 }