Skip to content

Commit f2f61f4

Browse files
author
Kent Overstreet
committed
bcachefs: bch2_btree_root_alloc() -> bch2_btree_root_alloc_fake()
Signed-off-by: Kent Overstreet <[email protected]>
1 parent ca1e02f commit f2f61f4

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

fs/bcachefs/btree_update_interior.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2466,7 +2466,7 @@ void bch2_btree_set_root_for_read(struct bch_fs *c, struct btree *b)
24662466
bch2_btree_set_root_inmem(c, b);
24672467
}
24682468

2469-
static int __bch2_btree_root_alloc(struct btree_trans *trans, enum btree_id id)
2469+
static int __bch2_btree_root_alloc_fake(struct btree_trans *trans, enum btree_id id, unsigned level)
24702470
{
24712471
struct bch_fs *c = trans->c;
24722472
struct closure cl;
@@ -2485,7 +2485,7 @@ static int __bch2_btree_root_alloc(struct btree_trans *trans, enum btree_id id)
24852485

24862486
set_btree_node_fake(b);
24872487
set_btree_node_need_rewrite(b);
2488-
b->c.level = 0;
2488+
b->c.level = level;
24892489
b->c.btree_id = id;
24902490

24912491
bkey_btree_ptr_init(&b->key);
@@ -2512,9 +2512,9 @@ static int __bch2_btree_root_alloc(struct btree_trans *trans, enum btree_id id)
25122512
return 0;
25132513
}
25142514

2515-
void bch2_btree_root_alloc(struct bch_fs *c, enum btree_id id)
2515+
void bch2_btree_root_alloc_fake(struct bch_fs *c, enum btree_id id, unsigned level)
25162516
{
2517-
bch2_trans_run(c, __bch2_btree_root_alloc(trans, id));
2517+
bch2_trans_run(c, __bch2_btree_root_alloc_fake(trans, id, level));
25182518
}
25192519

25202520
static void bch2_btree_update_to_text(struct printbuf *out, struct btree_update *as)

fs/bcachefs/btree_update_interior.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ int bch2_btree_node_update_key_get_iter(struct btree_trans *, struct btree *,
171171
struct bkey_i *, unsigned, bool);
172172

173173
void bch2_btree_set_root_for_read(struct bch_fs *, struct btree *);
174-
void bch2_btree_root_alloc(struct bch_fs *, enum btree_id);
174+
void bch2_btree_root_alloc_fake(struct bch_fs *, enum btree_id, unsigned);
175175

176176
static inline unsigned btree_update_reserve_required(struct bch_fs *c,
177177
struct btree *b)

fs/bcachefs/recovery.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,7 @@ static int read_btree_roots(struct bch_fs *c)
476476
if (!r->b) {
477477
r->alive = false;
478478
r->level = 0;
479-
bch2_btree_root_alloc(c, i);
479+
bch2_btree_root_alloc_fake(c, i, 0);
480480
}
481481
}
482482
fsck_err:
@@ -929,7 +929,7 @@ int bch2_fs_initialize(struct bch_fs *c)
929929
set_bit(BCH_FS_may_go_rw, &c->flags);
930930

931931
for (unsigned i = 0; i < BTREE_ID_NR; i++)
932-
bch2_btree_root_alloc(c, i);
932+
bch2_btree_root_alloc_fake(c, i, 0);
933933

934934
for_each_member_device(c, ca)
935935
bch2_dev_usage_init(ca);

0 commit comments

Comments
 (0)