bcachefs: Merging for indirect extents

Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
This commit is contained in:
Kent Overstreet
2021-05-15 15:04:08 -04:00
committed by Kent Overstreet
parent c2177e4da3
commit b058ac2091
2 changed files with 55 additions and 42 deletions

View File

@@ -82,6 +82,14 @@ void bch2_reflink_v_to_text(struct printbuf *out, struct bch_fs *c,
bch2_bkey_ptrs_to_text(out, c, k);
}
bool bch2_reflink_v_merge(struct bch_fs *c, struct bkey_s _l, struct bkey_s_c _r)
{
struct bkey_s_reflink_v l = bkey_s_to_reflink_v(_l);
struct bkey_s_c_reflink_v r = bkey_s_c_to_reflink_v(_r);
return l.v->refcount == r.v->refcount && bch2_extent_merge(c, _l, _r);
}
/* indirect inline data */
const char *bch2_indirect_inline_data_invalid(const struct bch_fs *c,