Commit af2ff37d authored by Kent Overstreet's avatar Kent Overstreet
Browse files

bcachefs: Fix block/btree node size defaults



We're fixing option parsing in userspace, it now obeys
OPT_SB_FIELD_SECTORS

Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
parent 5d361ae5
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -684,12 +684,10 @@ void __bch2_opt_set_sb(struct bch_sb *sb, int dev_idx,
	if (opt->flags & OPT_SB_FIELD_ONE_BIAS)
		v++;

	if ((opt->flags & OPT_FS) && opt->set_sb)
	if ((opt->flags & OPT_FS) && opt->set_sb && dev_idx < 0)
		opt->set_sb(sb, v);

	if ((opt->flags & OPT_DEVICE) &&
	    opt->set_member &&
	    dev_idx >= 0) {
	if ((opt->flags & OPT_DEVICE) && opt->set_member && dev_idx >= 0) {
		if (WARN(!bch2_member_exists(sb, dev_idx),
			 "tried to set device option %s on nonexistent device %i",
			 opt->attr.name, dev_idx))
+2 −7
Original line number Diff line number Diff line
@@ -128,13 +128,13 @@ enum fsck_err_opts {
	  OPT_FS|OPT_FORMAT|						\
	  OPT_HUMAN_READABLE|OPT_MUST_BE_POW_2|OPT_SB_FIELD_SECTORS,	\
	  OPT_UINT(512, 1U << 16),					\
	  BCH_SB_BLOCK_SIZE,		8,				\
	  BCH_SB_BLOCK_SIZE,		4 << 10,			\
	  "size",	NULL)						\
	x(btree_node_size,		u32,				\
	  OPT_FS|OPT_FORMAT|						\
	  OPT_HUMAN_READABLE|OPT_MUST_BE_POW_2|OPT_SB_FIELD_SECTORS,	\
	  OPT_UINT(512, 1U << 20),					\
	  BCH_SB_BTREE_NODE_SIZE,	512,				\
	  BCH_SB_BTREE_NODE_SIZE,	256 << 10,			\
	  "size",	"Btree node size, default 256k")		\
	x(errors,			u8,				\
	  OPT_FS|OPT_FORMAT|OPT_MOUNT|OPT_RUNTIME,			\
@@ -499,11 +499,6 @@ enum fsck_err_opts {
	  OPT_STR(bch2_member_states),					\
	  BCH_MEMBER_STATE,		BCH_MEMBER_STATE_rw,		\
	  "state",	"rw,ro,failed,spare")				\
	x(fs_size,			u64,				\
	  OPT_DEVICE|OPT_HIDDEN,					\
	  OPT_UINT(0, S64_MAX),						\
	  BCH2_NO_MEMBER_OPT,		0,				\
	  "size",	"Size of filesystem on device")			\
	x(bucket_size,			u32,				\
	  OPT_DEVICE|OPT_HUMAN_READABLE|OPT_SB_FIELD_SECTORS,		\
	  OPT_UINT(0, S64_MAX),						\