diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2023-09-26 23:49:34 +0200 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 23:10:16 +0200 |
commit | 4637429e3946d083eedde1668c17a4fadaf3c0b1 (patch) | |
tree | e963537ab982b1a82fa0aa33afab53713ce33fa7 /fs/bcachefs/super.c | |
parent | bcachefs: KEY_TYPE_error now counts towards i_sectors (diff) | |
download | linux-4637429e3946d083eedde1668c17a4fadaf3c0b1.tar.xz linux-4637429e3946d083eedde1668c17a4fadaf3c0b1.zip |
bcachefs: bch2_sb_field_get() refactoring
Instead of using token pasting to generate methods for each superblock
section, just make the type a parameter to bch2_sb_field_get().
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/super.c')
-rw-r--r-- | fs/bcachefs/super.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/bcachefs/super.c b/fs/bcachefs/super.c index 2014f7816f66..1c775695336d 100644 --- a/fs/bcachefs/super.c +++ b/fs/bcachefs/super.c @@ -1630,9 +1630,9 @@ int bch2_dev_add(struct bch_fs *c, const char *path) goto err_unlock; } - mi = bch2_sb_get_members_v2(ca->disk_sb.sb); + mi = bch2_sb_field_get(ca->disk_sb.sb, members_v2); - if (!bch2_sb_resize_members_v2(&ca->disk_sb, + if (!bch2_sb_field_resize(&ca->disk_sb, members_v2, le32_to_cpu(mi->field.u64s) + sizeof(dev_mi) / sizeof(u64))) { ret = -BCH_ERR_ENOSPC_sb_members; @@ -1656,7 +1656,7 @@ have_slot: u64s = DIV_ROUND_UP(sizeof(struct bch_sb_field_members_v2) + le16_to_cpu(mi->member_bytes) * nr_devices, sizeof(u64)); - mi = bch2_sb_resize_members_v2(&c->disk_sb, u64s); + mi = bch2_sb_field_resize(&c->disk_sb, members_v2, u64s); if (!mi) { ret = -BCH_ERR_ENOSPC_sb_members; bch_err_msg(c, ret, "setting up new superblock"); |