diff options
author | Hunter Shaffer <huntershaffer182456@gmail.com> | 2023-09-25 00:02:56 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 17:10:15 -0400 |
commit | 3f7b9713dae09df31067c6d1d33c6eb1f617529f (patch) | |
tree | 5c91897a90624d6bc5d6e19c6731f78a44fa255c /fs/bcachefs/sb-members.h | |
parent | 1241df5872b439ff1e5a8c70e0ce82345264904f (diff) | |
download | linux-3f7b9713dae09df31067c6d1d33c6eb1f617529f.tar.gz linux-3f7b9713dae09df31067c6d1d33c6eb1f617529f.tar.bz2 linux-3f7b9713dae09df31067c6d1d33c6eb1f617529f.zip |
bcachefs: New superblock section members_v2
members_v2 has dynamically resizable entries so that we can extend
bch_member. The members can no longer be accessed with simple array
indexing Instead members_v2_get is used to find a member's exact
location within the array and returns a copy of that member.
Alternatively member_v2_get_mut retrieves a mutable point to a member.
Signed-off-by: Hunter Shaffer <huntershaffer182456@gmail.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/sb-members.h')
-rw-r--r-- | fs/bcachefs/sb-members.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/bcachefs/sb-members.h b/fs/bcachefs/sb-members.h index 85d1af6a990c..72958facbb4f 100644 --- a/fs/bcachefs/sb-members.h +++ b/fs/bcachefs/sb-members.h @@ -2,6 +2,9 @@ #ifndef _BCACHEFS_SB_MEMBERS_H #define _BCACHEFS_SB_MEMBERS_H +int bch2_members_v2_init(struct bch_fs *c); +int bch_members_cpy_v2_v1(struct bch_sb_handle *disk_sb); +struct bch_member *bch2_members_v2_get_mut(struct bch_sb *sb, int i); struct bch_member bch2_sb_member_get(struct bch_sb *sb, int i); static inline bool bch2_dev_is_online(struct bch_dev *ca) @@ -173,6 +176,8 @@ static inline struct bch_devs_mask bch2_online_devs(struct bch_fs *c) return devs; } +extern const struct bch_sb_field_ops bch_sb_field_ops_members_v2; + extern const struct bch_sb_field_ops bch_sb_field_ops_members; #endif /* _BCACHEFS_SB_MEMBERS_H */ |