Commit df8a4239 authored by Kent Overstreet's avatar Kent Overstreet Committed by Kent Overstreet

bcachefs: extent_squash() can no longer fail

Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
parent e4ccb251
......@@ -1402,7 +1402,7 @@ bch2_extent_can_insert(struct btree_insert *trans,
return BTREE_INSERT_OK;
}
static enum btree_insert_ret
static void
extent_squash(struct extent_insert_state *s, struct bkey_i *insert,
struct bset_tree *t, struct bkey_packed *_k, struct bkey_s k,
enum bch_extent_overlap overlap)
......@@ -1496,8 +1496,6 @@ extent_squash(struct extent_insert_state *s, struct bkey_i *insert,
break;
}
}
return BTREE_INSERT_OK;
}
static enum btree_insert_ret
......@@ -1542,7 +1540,7 @@ __bch2_insert_fixup_extent(struct extent_insert_state *s)
_k->needs_whiteout = false;
}
ret = extent_squash(s, insert, t, _k, k, overlap);
extent_squash(s, insert, t, _k, k, overlap);
} else {
if (bkey_whiteout(k.k))
goto next;
......@@ -1575,21 +1573,18 @@ __bch2_insert_fixup_extent(struct extent_insert_state *s)
discard.k.needs_whiteout = true;
ret = extent_squash(s, insert, t, _k, k, overlap);
BUG_ON(ret != BTREE_INSERT_OK);
extent_squash(s, insert, t, _k, k, overlap);
extent_bset_insert(c, iter, &discard);
} else {
ret = extent_squash(s, insert, t, _k, k, overlap);
BUG_ON(ret != BTREE_INSERT_OK);
extent_squash(s, insert, t, _k, k, overlap);
}
next:
bch2_cut_front(s->committed, insert);
bch2_btree_iter_set_pos_same_leaf(iter, s->committed);
}
if (ret != BTREE_INSERT_OK ||
overlap == BCH_EXTENT_OVERLAP_FRONT ||
if (overlap == BCH_EXTENT_OVERLAP_FRONT ||
overlap == BCH_EXTENT_OVERLAP_MIDDLE)
break;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment