mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-01 10:45:49 +00:00
bcachefs: bch2_btree_root_alloc() -> bch2_btree_root_alloc_fake()
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
parent
ca1e02f7e9
commit
f2f61f4192
@ -2466,7 +2466,7 @@ void bch2_btree_set_root_for_read(struct bch_fs *c, struct btree *b)
|
||||
bch2_btree_set_root_inmem(c, b);
|
||||
}
|
||||
|
||||
static int __bch2_btree_root_alloc(struct btree_trans *trans, enum btree_id id)
|
||||
static int __bch2_btree_root_alloc_fake(struct btree_trans *trans, enum btree_id id, unsigned level)
|
||||
{
|
||||
struct bch_fs *c = trans->c;
|
||||
struct closure cl;
|
||||
@ -2485,7 +2485,7 @@ static int __bch2_btree_root_alloc(struct btree_trans *trans, enum btree_id id)
|
||||
|
||||
set_btree_node_fake(b);
|
||||
set_btree_node_need_rewrite(b);
|
||||
b->c.level = 0;
|
||||
b->c.level = level;
|
||||
b->c.btree_id = id;
|
||||
|
||||
bkey_btree_ptr_init(&b->key);
|
||||
@ -2512,9 +2512,9 @@ static int __bch2_btree_root_alloc(struct btree_trans *trans, enum btree_id id)
|
||||
return 0;
|
||||
}
|
||||
|
||||
void bch2_btree_root_alloc(struct bch_fs *c, enum btree_id id)
|
||||
void bch2_btree_root_alloc_fake(struct bch_fs *c, enum btree_id id, unsigned level)
|
||||
{
|
||||
bch2_trans_run(c, __bch2_btree_root_alloc(trans, id));
|
||||
bch2_trans_run(c, __bch2_btree_root_alloc_fake(trans, id, level));
|
||||
}
|
||||
|
||||
static void bch2_btree_update_to_text(struct printbuf *out, struct btree_update *as)
|
||||
|
@ -171,7 +171,7 @@ int bch2_btree_node_update_key_get_iter(struct btree_trans *, struct btree *,
|
||||
struct bkey_i *, unsigned, bool);
|
||||
|
||||
void bch2_btree_set_root_for_read(struct bch_fs *, struct btree *);
|
||||
void bch2_btree_root_alloc(struct bch_fs *, enum btree_id);
|
||||
void bch2_btree_root_alloc_fake(struct bch_fs *, enum btree_id, unsigned);
|
||||
|
||||
static inline unsigned btree_update_reserve_required(struct bch_fs *c,
|
||||
struct btree *b)
|
||||
|
@ -476,7 +476,7 @@ static int read_btree_roots(struct bch_fs *c)
|
||||
if (!r->b) {
|
||||
r->alive = false;
|
||||
r->level = 0;
|
||||
bch2_btree_root_alloc(c, i);
|
||||
bch2_btree_root_alloc_fake(c, i, 0);
|
||||
}
|
||||
}
|
||||
fsck_err:
|
||||
@ -929,7 +929,7 @@ int bch2_fs_initialize(struct bch_fs *c)
|
||||
set_bit(BCH_FS_may_go_rw, &c->flags);
|
||||
|
||||
for (unsigned i = 0; i < BTREE_ID_NR; i++)
|
||||
bch2_btree_root_alloc(c, i);
|
||||
bch2_btree_root_alloc_fake(c, i, 0);
|
||||
|
||||
for_each_member_device(c, ca)
|
||||
bch2_dev_usage_init(ca);
|
||||
|
Loading…
Reference in New Issue
Block a user