diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2022-03-31 22:05:33 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@gmail.com> | 2022-04-02 16:53:18 -0400 |
commit | 54eda97079bc73ef18249a4a00442f347b0cdfbb (patch) | |
tree | 4e78389af66ded24c7b2c93ca6b1711d21a967cf | |
parent | ab3b6e7dd69c5cd5dfd96fd265ade6897720f671 (diff) |
bcachefs: Use crc_is_compressed()
Trivial cleanup.
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
-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 7654ab24a909..bc39d742fa00 100644 --- a/fs/bcachefs/buckets.c +++ b/fs/bcachefs/buckets.c @@ -671,10 +671,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; } |