diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2022-04-01 05:05:33 +0300 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-23 00:09:30 +0300 |
commit | 75f02de43f4f7e76b9453096c5f4255d4476eda8 (patch) | |
tree | d59b4e9da4fadbe95582a8c4c837d5a42eff0b0c /fs/bcachefs/buckets.c | |
parent | c32fc674d4ca13f3b889693a2b59365d93a77144 (diff) | |
download | linux-75f02de43f4f7e76b9453096c5f4255d4476eda8.tar.xz |
bcachefs: Use crc_is_compressed()
Trivial cleanup.
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Diffstat (limited to 'fs/bcachefs/buckets.c')
-rw-r--r-- | fs/bcachefs/buckets.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/fs/bcachefs/buckets.c b/fs/bcachefs/buckets.c index 31de8035e86d..dcb2ea3de4b8 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; } |