From: Kent Overstreet Date: Fri, 1 Apr 2022 02:05:33 +0000 (-0400) Subject: bcachefs: Use crc_is_compressed() X-Git-Tag: v6.7-rc1~201^2~1016 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=75f02de43f4f7e76b9453096c5f4255d4476eda8;p=thirdparty%2Fkernel%2Flinux.git bcachefs: Use crc_is_compressed() Trivial cleanup. Signed-off-by: Kent Overstreet --- diff --git a/fs/bcachefs/buckets.c b/fs/bcachefs/buckets.c index 31de8035e86d2..dcb2ea3de4b8e 100644 --- a/fs/bcachefs/buckets.c +++ b/fs/bcachefs/buckets.c @@ -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; }