Commit 7773df19 authored by Kent Overstreet's avatar Kent Overstreet
Browse files

bcachefs: metadata version bucket_stripe_sectors



New on disk format version for bch_alloc->stripe_sectors and
BCH_DATA_unstriped - accounting for unstriped data in stripe buckets.

Upgrade/downgrade requires regenerating alloc info - but only if erasure
coding is in use.

Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
parent 2612e291
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -592,6 +592,7 @@ struct bch_dev {
#define BCH_FS_FLAGS()			\
	x(new_fs)			\
	x(started)			\
	x(btree_running)		\
	x(may_go_rw)			\
	x(rw)				\
	x(was_rw)			\
+2 −1
Original line number Diff line number Diff line
@@ -723,7 +723,8 @@ struct bch_sb_field_ext {
	x(member_seq,			BCH_VERSION(1,  4))		\
	x(subvolume_fs_parent,		BCH_VERSION(1,  5))		\
	x(btree_subvolume_children,	BCH_VERSION(1,  6))		\
	x(mi_btree_bitmap,		BCH_VERSION(1,  7))
	x(mi_btree_bitmap,		BCH_VERSION(1,  7))		\
	x(bucket_stripe_sectors,	BCH_VERSION(1,  8))

enum bcachefs_metadata_version {
	bcachefs_metadata_version_min = 9,
+8 −0
Original line number Diff line number Diff line
@@ -866,6 +866,14 @@ __bch2_btree_iter_peek_and_restart(struct btree_trans *trans,
	_p;								\
})

#define bch2_trans_run(_c, _do)						\
({									\
	struct btree_trans *trans = bch2_trans_get(_c);			\
	int _ret = (_do);						\
	bch2_trans_put(trans);						\
	_ret;								\
})

void bch2_trans_updates_to_text(struct printbuf *, struct btree_trans *);
void bch2_btree_path_to_text(struct printbuf *, struct btree_trans *, btree_path_idx_t);
void bch2_trans_paths_to_text(struct printbuf *, struct btree_trans *);
+0 −8
Original line number Diff line number Diff line
@@ -178,14 +178,6 @@ static inline int bch2_trans_commit(struct btree_trans *trans,
	nested_lockrestart_do(_trans, _do ?: bch2_trans_commit(_trans, (_disk_res),\
					(_journal_seq), (_flags)))

#define bch2_trans_run(_c, _do)						\
({									\
	struct btree_trans *trans = bch2_trans_get(_c);			\
	int _ret = (_do);						\
	bch2_trans_put(trans);						\
	_ret;								\
})

#define bch2_trans_do(_c, _disk_res, _journal_seq, _flags, _do)		\
	bch2_trans_run(_c, commit_do(trans, _disk_res, _journal_seq, _flags, _do))

+5 −0
Original line number Diff line number Diff line
@@ -810,6 +810,10 @@ int bch2_fs_recovery(struct bch_fs *c)
	if (ret)
		goto err;

	set_bit(BCH_FS_btree_running, &c->flags);

	ret = bch2_sb_set_upgrade_extra(c);

	ret = bch2_run_recovery_passes(c);
	if (ret)
		goto err;
@@ -969,6 +973,7 @@ int bch2_fs_initialize(struct bch_fs *c)
	mutex_unlock(&c->sb_lock);

	c->curr_recovery_pass = BCH_RECOVERY_PASS_NR;
	set_bit(BCH_FS_btree_running, &c->flags);
	set_bit(BCH_FS_may_go_rw, &c->flags);

	for (unsigned i = 0; i < BTREE_ID_NR; i++)
Loading