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

bcachefs: Plumb bch_validate_flags to sb_field_ops.validate()

parent 65eaf4e2
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -469,9 +469,8 @@ int bch2_rechecksum_bio(struct bch_fs *c, struct bio *bio,

/* BCH_SB_FIELD_crypt: */

static int bch2_sb_crypt_validate(struct bch_sb *sb,
				  struct bch_sb_field *f,
				  struct printbuf *err)
static int bch2_sb_crypt_validate(struct bch_sb *sb, struct bch_sb_field *f,
				  enum bch_validate_flags flags, struct printbuf *err)
{
	struct bch_sb_field_crypt *crypt = field_to_type(f, crypt);

+2 −3
Original line number Diff line number Diff line
@@ -18,9 +18,8 @@ static int group_cmp(const void *_l, const void *_r)
		strncmp(l->label, r->label, sizeof(l->label));
}

static int bch2_sb_disk_groups_validate(struct bch_sb *sb,
					struct bch_sb_field *f,
					struct printbuf *err)
static int bch2_sb_disk_groups_validate(struct bch_sb *sb, struct bch_sb_field *f,
				enum bch_validate_flags flags, struct printbuf *err)
{
	struct bch_sb_field_disk_groups *groups =
		field_to_type(f, disk_groups);
+4 −6
Original line number Diff line number Diff line
@@ -16,9 +16,8 @@ static int u64_cmp(const void *_l, const void *_r)
	return cmp_int(*l, *r);
}

static int bch2_sb_journal_validate(struct bch_sb *sb,
				    struct bch_sb_field *f,
				    struct printbuf *err)
static int bch2_sb_journal_validate(struct bch_sb *sb, struct bch_sb_field *f,
				enum bch_validate_flags flags, struct printbuf *err)
{
	struct bch_sb_field_journal *journal = field_to_type(f, journal);
	struct bch_member m = bch2_sb_member_get(sb, sb->dev_idx);
@@ -99,9 +98,8 @@ static int u64_range_cmp(const void *_l, const void *_r)
	return cmp_int(l->start, r->start);
}

static int bch2_sb_journal_v2_validate(struct bch_sb *sb,
				    struct bch_sb_field *f,
				    struct printbuf *err)
static int bch2_sb_journal_v2_validate(struct bch_sb *sb, struct bch_sb_field *f,
				enum bch_validate_flags flags, struct printbuf *err)
{
	struct bch_sb_field_journal_v2 *journal = field_to_type(f, journal_v2);
	struct bch_member m = bch2_sb_member_get(sb, sb->dev_idx);
+2 −3
Original line number Diff line number Diff line
@@ -162,9 +162,8 @@ int bch2_blacklist_table_initialize(struct bch_fs *c)
	return 0;
}

static int bch2_sb_journal_seq_blacklist_validate(struct bch_sb *sb,
						  struct bch_sb_field *f,
						  struct printbuf *err)
static int bch2_sb_journal_seq_blacklist_validate(struct bch_sb *sb, struct bch_sb_field *f,
				enum bch_validate_flags flags, struct printbuf *err)
{
	struct bch_sb_field_journal_seq_blacklist *bl =
		field_to_type(f, journal_seq_blacklist);
+2 −3
Original line number Diff line number Diff line
@@ -20,7 +20,7 @@ static const char * const bch2_quota_counters[] = {
};

static int bch2_sb_quota_validate(struct bch_sb *sb, struct bch_sb_field *f,
				  struct printbuf *err)
				  enum bch_validate_flags flags, struct printbuf *err)
{
	struct bch_sb_field_quota *q = field_to_type(f, quota);

@@ -60,8 +60,7 @@ const struct bch_sb_field_ops bch_sb_field_ops_quota = {
};

int bch2_quota_invalid(struct bch_fs *c, struct bkey_s_c k,
		       enum bch_validate_flags flags,
		       struct printbuf *err)
		       enum bch_validate_flags flags, struct printbuf *err)
{
	int ret = 0;

Loading