return bkey_cmp(l, r) < 0 ? l : r;
}
+static inline struct bpos bpos_max(struct bpos l, struct bpos r)
+{
+ return bkey_cmp(l, r) > 0 ? l : r;
+}
+
void bch2_bpos_swab(struct bpos *);
void bch2_bkey_swab_key(const struct bkey_format *, struct bkey_packed *);
struct btree_trans trans;
struct btree_iter *iter;
struct bkey_s_c k;
- struct bpos start_pos = POS(0, c->ec_stripe_hint);
+ struct bpos min_pos = POS(0, 1);
+ struct bpos start_pos = bpos_max(min_pos, POS(0, c->ec_stripe_hint));
int ret;
bch2_trans_init(&trans, c, 0, 0);
BTREE_ITER_SLOTS|BTREE_ITER_INTENT, k, ret) {
if (bkey_cmp(k.k->p, POS(0, U32_MAX)) > 0) {
if (start_pos.offset) {
- start_pos = POS_MIN;
+ start_pos = min_pos;
bch2_btree_iter_set_pos(iter, start_pos);
continue;
}