Skip to content

Commit a5c3e26

Browse files
author
Kent Overstreet
committed
bcachefs: Plumb bch_validate_flags to sb_field_ops.validate()
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
1 parent 65eaf4e commit a5c3e26

13 files changed

+38
-47
lines changed

fs/bcachefs/checksum.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -469,9 +469,8 @@ int bch2_rechecksum_bio(struct bch_fs *c, struct bio *bio,
469469

470470
/* BCH_SB_FIELD_crypt: */
471471

472-
static int bch2_sb_crypt_validate(struct bch_sb *sb,
473-
struct bch_sb_field *f,
474-
struct printbuf *err)
472+
static int bch2_sb_crypt_validate(struct bch_sb *sb, struct bch_sb_field *f,
473+
enum bch_validate_flags flags, struct printbuf *err)
475474
{
476475
struct bch_sb_field_crypt *crypt = field_to_type(f, crypt);
477476

fs/bcachefs/disk_groups.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,8 @@ static int group_cmp(const void *_l, const void *_r)
1818
strncmp(l->label, r->label, sizeof(l->label));
1919
}
2020

21-
static int bch2_sb_disk_groups_validate(struct bch_sb *sb,
22-
struct bch_sb_field *f,
23-
struct printbuf *err)
21+
static int bch2_sb_disk_groups_validate(struct bch_sb *sb, struct bch_sb_field *f,
22+
enum bch_validate_flags flags, struct printbuf *err)
2423
{
2524
struct bch_sb_field_disk_groups *groups =
2625
field_to_type(f, disk_groups);

fs/bcachefs/journal_sb.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,8 @@ static int u64_cmp(const void *_l, const void *_r)
1616
return cmp_int(*l, *r);
1717
}
1818

19-
static int bch2_sb_journal_validate(struct bch_sb *sb,
20-
struct bch_sb_field *f,
21-
struct printbuf *err)
19+
static int bch2_sb_journal_validate(struct bch_sb *sb, struct bch_sb_field *f,
20+
enum bch_validate_flags flags, struct printbuf *err)
2221
{
2322
struct bch_sb_field_journal *journal = field_to_type(f, journal);
2423
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)
9998
return cmp_int(l->start, r->start);
10099
}
101100

102-
static int bch2_sb_journal_v2_validate(struct bch_sb *sb,
103-
struct bch_sb_field *f,
104-
struct printbuf *err)
101+
static int bch2_sb_journal_v2_validate(struct bch_sb *sb, struct bch_sb_field *f,
102+
enum bch_validate_flags flags, struct printbuf *err)
105103
{
106104
struct bch_sb_field_journal_v2 *journal = field_to_type(f, journal_v2);
107105
struct bch_member m = bch2_sb_member_get(sb, sb->dev_idx);

fs/bcachefs/journal_seq_blacklist.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,9 +162,8 @@ int bch2_blacklist_table_initialize(struct bch_fs *c)
162162
return 0;
163163
}
164164

165-
static int bch2_sb_journal_seq_blacklist_validate(struct bch_sb *sb,
166-
struct bch_sb_field *f,
167-
struct printbuf *err)
165+
static int bch2_sb_journal_seq_blacklist_validate(struct bch_sb *sb, struct bch_sb_field *f,
166+
enum bch_validate_flags flags, struct printbuf *err)
168167
{
169168
struct bch_sb_field_journal_seq_blacklist *bl =
170169
field_to_type(f, journal_seq_blacklist);

fs/bcachefs/quota.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ static const char * const bch2_quota_counters[] = {
2020
};
2121

2222
static int bch2_sb_quota_validate(struct bch_sb *sb, struct bch_sb_field *f,
23-
struct printbuf *err)
23+
enum bch_validate_flags flags, struct printbuf *err)
2424
{
2525
struct bch_sb_field_quota *q = field_to_type(f, quota);
2626

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

6262
int bch2_quota_invalid(struct bch_fs *c, struct bkey_s_c k,
63-
enum bch_validate_flags flags,
64-
struct printbuf *err)
63+
enum bch_validate_flags flags, struct printbuf *err)
6564
{
6665
int ret = 0;
6766

fs/bcachefs/replicas.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -860,7 +860,7 @@ static int bch2_cpu_replicas_validate(struct bch_replicas_cpu *cpu_r,
860860
}
861861

862862
static int bch2_sb_replicas_validate(struct bch_sb *sb, struct bch_sb_field *f,
863-
struct printbuf *err)
863+
enum bch_validate_flags flags, struct printbuf *err)
864864
{
865865
struct bch_sb_field_replicas *sb_r = field_to_type(f, replicas);
866866
struct bch_replicas_cpu cpu_r;
@@ -899,7 +899,7 @@ const struct bch_sb_field_ops bch_sb_field_ops_replicas = {
899899
};
900900

901901
static int bch2_sb_replicas_v0_validate(struct bch_sb *sb, struct bch_sb_field *f,
902-
struct printbuf *err)
902+
enum bch_validate_flags flags, struct printbuf *err)
903903
{
904904
struct bch_sb_field_replicas_v0 *sb_r = field_to_type(f, replicas_v0);
905905
struct bch_replicas_cpu cpu_r;

fs/bcachefs/sb-clean.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -266,9 +266,8 @@ void bch2_journal_super_entries_add_common(struct bch_fs *c,
266266
}
267267
}
268268

269-
static int bch2_sb_clean_validate(struct bch_sb *sb,
270-
struct bch_sb_field *f,
271-
struct printbuf *err)
269+
static int bch2_sb_clean_validate(struct bch_sb *sb, struct bch_sb_field *f,
270+
enum bch_validate_flags flags, struct printbuf *err)
272271
{
273272
struct bch_sb_field_clean *clean = field_to_type(f, clean);
274273

fs/bcachefs/sb-counters.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,8 @@ static size_t bch2_sb_counter_nr_entries(struct bch_sb_field_counters *ctrs)
2020
return (__le64 *) vstruct_end(&ctrs->field) - &ctrs->d[0];
2121
};
2222

23-
static int bch2_sb_counters_validate(struct bch_sb *sb,
24-
struct bch_sb_field *f,
25-
struct printbuf *err)
23+
static int bch2_sb_counters_validate(struct bch_sb *sb, struct bch_sb_field *f,
24+
enum bch_validate_flags flags, struct printbuf *err)
2625
{
2726
return 0;
2827
};

fs/bcachefs/sb-downgrade.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ downgrade_entry_next_c(const struct bch_sb_field_downgrade_entry *e)
138138
_i = downgrade_entry_next_c(_i))
139139

140140
static int bch2_sb_downgrade_validate(struct bch_sb *sb, struct bch_sb_field *f,
141-
struct printbuf *err)
141+
enum bch_validate_flags flags, struct printbuf *err)
142142
{
143143
struct bch_sb_field_downgrade *e = field_to_type(f, downgrade);
144144

fs/bcachefs/sb-errors.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ static inline unsigned bch2_sb_field_errors_u64s(unsigned nr)
3030
}
3131

3232
static int bch2_sb_errors_validate(struct bch_sb *sb, struct bch_sb_field *f,
33-
struct printbuf *err)
33+
enum bch_validate_flags flags, struct printbuf *err)
3434
{
3535
struct bch_sb_field_errors *e = field_to_type(f, errors);
3636
unsigned i, nr = bch2_sb_field_errors_nr_entries(e);

0 commit comments

Comments
 (0)