summaryrefslogtreecommitdiff
path: root/fs/bcachefs/extents.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/bcachefs/extents.c')
-rw-r--r--fs/bcachefs/extents.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/fs/bcachefs/extents.c b/fs/bcachefs/extents.c
index ef36d244ab24..5c48d2d96a5f 100644
--- a/fs/bcachefs/extents.c
+++ b/fs/bcachefs/extents.c
@@ -235,7 +235,7 @@ unsigned bch2_extent_is_compressed(struct bkey_s_c k)
if (!p.ptr.cached &&
p.crc.compression_type != BCH_COMPRESSION_NONE &&
p.crc.compressed_size < p.crc.live_size)
- ret = max_t(unsigned, ret, p.crc.compressed_size);
+ ret += p.crc.compressed_size;
}
}
@@ -1275,8 +1275,7 @@ bch2_extent_can_insert(struct btree_insert *trans,
switch (bch2_disk_reservation_add(trans->c,
trans->disk_res,
- sectors * bch2_extent_nr_dirty_ptrs(k),
- flags)) {
+ sectors, flags)) {
case 0:
break;
case -ENOSPC: