Skip to content

Commit cf49f8a

Browse files
author
Kent Overstreet
committed
bcachefs: rename version -> bversion
give bversions a more distinct name, to aid in grepping Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
1 parent fd65378 commit cf49f8a

17 files changed

+30
-30
lines changed

fs/bcachefs/backpointers.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -501,7 +501,7 @@ static int check_extent_checksum(struct btree_trans *trans,
501501
prt_printf(&buf, "\n %s ", bch2_btree_id_str(o_btree));
502502
bch2_bkey_val_to_text(&buf, c, extent2);
503503

504-
struct nonce nonce = extent_nonce(extent.k->version, p.crc);
504+
struct nonce nonce = extent_nonce(extent.k->bversion, p.crc);
505505
struct bch_csum csum = bch2_checksum(c, p.crc.csum_type, nonce, data_buf, bytes);
506506
if (fsck_err_on(bch2_crc_cmp(csum, p.crc.csum),
507507
trans, dup_backpointer_to_bad_csum_extent,

fs/bcachefs/bcachefs_format.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ struct bkey {
217217
#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
218218
__u8 pad[1];
219219

220-
struct bversion version;
220+
struct bversion bversion;
221221
__u32 size; /* extent size, in sectors */
222222
struct bpos p;
223223
#elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
@@ -328,8 +328,8 @@ enum bch_bkey_fields {
328328
bkey_format_field(OFFSET, p.offset), \
329329
bkey_format_field(SNAPSHOT, p.snapshot), \
330330
bkey_format_field(SIZE, size), \
331-
bkey_format_field(VERSION_HI, version.hi), \
332-
bkey_format_field(VERSION_LO, version.lo), \
331+
bkey_format_field(VERSION_HI, bversion.hi), \
332+
bkey_format_field(VERSION_LO, bversion.lo), \
333333
}, \
334334
})
335335

fs/bcachefs/bkey.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -554,8 +554,8 @@ static inline void bch2_bkey_pack_test(void) {}
554554
x(BKEY_FIELD_OFFSET, p.offset) \
555555
x(BKEY_FIELD_SNAPSHOT, p.snapshot) \
556556
x(BKEY_FIELD_SIZE, size) \
557-
x(BKEY_FIELD_VERSION_HI, version.hi) \
558-
x(BKEY_FIELD_VERSION_LO, version.lo)
557+
x(BKEY_FIELD_VERSION_HI, bversion.hi) \
558+
x(BKEY_FIELD_VERSION_LO, bversion.lo)
559559

560560
struct bkey_format_state {
561561
u64 field_min[BKEY_NR_FIELDS];

fs/bcachefs/bkey_methods.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ void bch2_bkey_to_text(struct printbuf *out, const struct bkey *k)
289289

290290
bch2_bpos_to_text(out, k->p);
291291

292-
prt_printf(out, " len %u ver %llu", k->size, k->version.lo);
292+
prt_printf(out, " len %u ver %llu", k->size, k->bversion.lo);
293293
} else {
294294
prt_printf(out, "(null)");
295295
}

fs/bcachefs/bkey_methods.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ bool bch2_bkey_normalize(struct bch_fs *, struct bkey_s);
7070
static inline bool bch2_bkey_maybe_mergable(const struct bkey *l, const struct bkey *r)
7171
{
7272
return l->type == r->type &&
73-
!bversion_cmp(l->version, r->version) &&
73+
!bversion_cmp(l->bversion, r->bversion) &&
7474
bpos_eq(l->p, bkey_start_pos(r));
7575
}
7676

fs/bcachefs/btree_gc.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -601,15 +601,15 @@ static int bch2_gc_mark_key(struct btree_trans *trans, enum btree_id btree_id,
601601

602602
if (initial) {
603603
BUG_ON(bch2_journal_seq_verify &&
604-
k.k->version.lo > atomic64_read(&c->journal.seq));
604+
k.k->bversion.lo > atomic64_read(&c->journal.seq));
605605

606606
if (fsck_err_on(btree_id != BTREE_ID_accounting &&
607-
k.k->version.lo > atomic64_read(&c->key_version),
607+
k.k->bversion.lo > atomic64_read(&c->key_version),
608608
trans, bkey_version_in_future,
609609
"key version number higher than recorded %llu\n %s",
610610
atomic64_read(&c->key_version),
611611
(bch2_bkey_val_to_text(&buf, c, k), buf.buf)))
612-
atomic64_set(&c->key_version, k.k->version.lo);
612+
atomic64_set(&c->key_version, k.k->bversion.lo);
613613
}
614614

615615
if (mustfix_fsck_err_on(level && !bch2_dev_btree_bitmap_marked(c, k),

fs/bcachefs/btree_io.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1223,7 +1223,7 @@ int bch2_btree_node_read_done(struct bch_fs *c, struct bch_dev *ca,
12231223
ret = bch2_bkey_val_validate(c, u.s_c, READ);
12241224
if (ret == -BCH_ERR_fsck_delete_bkey ||
12251225
(bch2_inject_invalid_keys &&
1226-
!bversion_cmp(u.k->version, MAX_VERSION))) {
1226+
!bversion_cmp(u.k->bversion, MAX_VERSION))) {
12271227
btree_keys_account_key_drop(&b->nr, 0, k);
12281228

12291229
i->u64s = cpu_to_le16(le16_to_cpu(i->u64s) - k->u64s);

fs/bcachefs/btree_trans_commit.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -684,10 +684,10 @@ bch2_trans_commit_write_locked(struct btree_trans *trans, unsigned flags,
684684
!(flags & BCH_TRANS_COMMIT_no_journal_res)) {
685685
if (bch2_journal_seq_verify)
686686
trans_for_each_update(trans, i)
687-
i->k->k.version.lo = trans->journal_res.seq;
687+
i->k->k.bversion.lo = trans->journal_res.seq;
688688
else if (bch2_inject_invalid_keys)
689689
trans_for_each_update(trans, i)
690-
i->k->k.version = MAX_VERSION;
690+
i->k->k.bversion = MAX_VERSION;
691691
}
692692

693693
h = trans->hooks;
@@ -709,9 +709,9 @@ bch2_trans_commit_write_locked(struct btree_trans *trans, unsigned flags,
709709
if (jset_entry_is_key(entry) && entry->start->k.type == KEY_TYPE_accounting) {
710710
struct bkey_i_accounting *a = bkey_i_to_accounting(entry->start);
711711

712-
a->k.version = journal_pos_to_bversion(&trans->journal_res,
712+
a->k.bversion = journal_pos_to_bversion(&trans->journal_res,
713713
(u64 *) entry - (u64 *) trans->journal_entries);
714-
BUG_ON(bversion_zero(a->k.version));
714+
BUG_ON(bversion_zero(a->k.bversion));
715715
ret = bch2_accounting_mem_mod_locked(trans, accounting_i_to_s_c(a), BCH_ACCOUNTING_normal);
716716
if (ret)
717717
goto revert_fs_usage;

fs/bcachefs/data_update.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -639,7 +639,7 @@ int bch2_data_update_init(struct btree_trans *trans,
639639

640640
bch2_write_op_init(&m->op, c, io_opts);
641641
m->op.pos = bkey_start_pos(k.k);
642-
m->op.version = k.k->version;
642+
m->op.version = k.k->bversion;
643643
m->op.target = data_opts.target;
644644
m->op.write_point = wp;
645645
m->op.nr_replicas = 0;

fs/bcachefs/disk_accounting.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ static int __bch2_accounting_mem_insert(struct bch_fs *c, struct bkey_s_c_accoun
291291

292292
struct accounting_mem_entry n = {
293293
.pos = a.k->p,
294-
.version = a.k->version,
294+
.bversion = a.k->bversion,
295295
.nr_counters = bch2_accounting_counters(a.k),
296296
.v[0] = __alloc_percpu_gfp(n.nr_counters * sizeof(u64),
297297
sizeof(u64), GFP_KERNEL),
@@ -636,15 +636,15 @@ int bch2_accounting_read(struct bch_fs *c)
636636
accounting_pos_cmp, &k.k->p);
637637

638638
bool applied = idx < acc->k.nr &&
639-
bversion_cmp(acc->k.data[idx].version, k.k->version) >= 0;
639+
bversion_cmp(acc->k.data[idx].bversion, k.k->bversion) >= 0;
640640

641641
if (applied)
642642
continue;
643643

644644
if (i + 1 < &darray_top(*keys) &&
645645
i[1].k->k.type == KEY_TYPE_accounting &&
646646
!journal_key_cmp(i, i + 1)) {
647-
BUG_ON(bversion_cmp(i[0].k->k.version, i[1].k->k.version) >= 0);
647+
BUG_ON(bversion_cmp(i[0].k->k.bversion, i[1].k->k.bversion) >= 0);
648648

649649
i[1].journal_seq = i[0].journal_seq;
650650

0 commit comments

Comments
 (0)