From 75f02de43f4f7e76b9453096c5f4255d4476eda8 Mon Sep 17 00:00:00 2001 From: Kent Overstreet Date: Thu, 31 Mar 2022 22:05:33 -0400 Subject: [PATCH] bcachefs: Use crc_is_compressed() Trivial cleanup. Signed-off-by: Kent Overstreet --- fs/bcachefs/buckets.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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; } -- 2.30.2