diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2018-10-30 14:14:19 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 17:08:10 -0400 |
commit | 7a920560d727701c4397a5448085f99bf9f060d5 (patch) | |
tree | 0881080089d1680faa8f9f2e828bd01d4a21111d /fs/bcachefs/replicas.h | |
parent | 198d67006b6015724a840e8586a484c6590fc975 (diff) | |
download | lwn-7a920560d727701c4397a5448085f99bf9f060d5.tar.gz lwn-7a920560d727701c4397a5448085f99bf9f060d5.zip |
bcachefs: kill struct bch_replicas_cpu_entry
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/replicas.h')
-rw-r--r-- | fs/bcachefs/replicas.h | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/fs/bcachefs/replicas.h b/fs/bcachefs/replicas.h index de506cf9e11d..6c01f35296e7 100644 --- a/fs/bcachefs/replicas.h +++ b/fs/bcachefs/replicas.h @@ -2,6 +2,8 @@ #ifndef _BCACHEFS_REPLICAS_H #define _BCACHEFS_REPLICAS_H +#include "replicas_types.h" + bool bch2_replicas_marked(struct bch_fs *, enum bch_data_type, struct bch_devs_list); bool bch2_bkey_replicas_marked(struct bch_fs *, enum bch_data_type, @@ -34,11 +36,11 @@ int bch2_replicas_gc_start(struct bch_fs *, unsigned); /* iterate over superblock replicas - used by userspace tools: */ -static inline struct bch_replicas_entry * -replicas_entry_next(struct bch_replicas_entry *i) -{ - return (void *) i + offsetof(struct bch_replicas_entry, devs) + i->nr; -} +#define replicas_entry_bytes(_i) \ + (offsetof(typeof(*(_i)), devs) + (_i)->nr_devs) + +#define replicas_entry_next(_i) \ + ((typeof(_i)) ((void *) (_i) + replicas_entry_bytes(_i))) #define for_each_replicas_entry(_r, _i) \ for (_i = (_r)->entries; \ |