summaryrefslogtreecommitdiff
path: root/libbcachefs/extents.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2021-02-02 14:26:28 -0500
committerKent Overstreet <kent.overstreet@gmail.com>2021-02-02 16:07:59 -0500
commit4064aa126e2c77b86d090cd8b7731d238e73ae85 (patch)
treec13339a6f28cd6354317d7d727681d5db698f907 /libbcachefs/extents.c
parent7eef5f46ddbd9d5ae2152ee868b110da37279bb9 (diff)
Update bcachefs sources to 26409a8f75 bcachefs: Journal updates to dev usage
Diffstat (limited to 'libbcachefs/extents.c')
-rw-r--r--libbcachefs/extents.c21
1 files changed, 4 insertions, 17 deletions
diff --git a/libbcachefs/extents.c b/libbcachefs/extents.c
index 67ba2c21..4a3a3291 100644
--- a/libbcachefs/extents.c
+++ b/libbcachefs/extents.c
@@ -704,14 +704,8 @@ unsigned bch2_bkey_replicas(struct bch_fs *c, struct bkey_s_c k)
if (p.ptr.cached)
continue;
- if (p.has_ec) {
- struct stripe *s =
- genradix_ptr(&c->stripes[0], p.ec.idx);
-
- WARN_ON(!s);
- if (s)
- replicas += s->nr_redundant;
- }
+ if (p.has_ec)
+ replicas += p.ec.redundancy;
replicas++;
@@ -734,16 +728,9 @@ static unsigned bch2_extent_ptr_durability(struct bch_fs *c,
if (ca->mi.state != BCH_MEMBER_STATE_FAILED)
durability = max_t(unsigned, durability, ca->mi.durability);
- if (p.has_ec) {
- struct stripe *s =
- genradix_ptr(&c->stripes[0], p.ec.idx);
-
- if (WARN_ON(!s))
- goto out;
+ if (p.has_ec)
+ durability += p.ec.redundancy;
- durability += s->nr_redundant;
- }
-out:
return durability;
}