summaryrefslogtreecommitdiff
path: root/fs/bcachefs/replicas.h
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2019-01-25 01:54:51 +0300
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-23 00:08:15 +0300
commit3ccc5c50f29fb6934fb71e12983f1f2beabe29b9 (patch)
treec2c01b1592b4a0420e1c525d2fc3b8d4b933188d /fs/bcachefs/replicas.h
parent2c5af169f72c1018e83b79ac82ffe387534910e8 (diff)
downloadlinux-3ccc5c50f29fb6934fb71e12983f1f2beabe29b9.tar.xz
bcachefs: Write out fs usage
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/replicas.h')
-rw-r--r--fs/bcachefs/replicas.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/bcachefs/replicas.h b/fs/bcachefs/replicas.h
index 4fabe0372ec3..35164887dffb 100644
--- a/fs/bcachefs/replicas.h
+++ b/fs/bcachefs/replicas.h
@@ -57,6 +57,11 @@ unsigned bch2_dev_has_data(struct bch_fs *, struct bch_dev *);
int bch2_replicas_gc_end(struct bch_fs *, int);
int bch2_replicas_gc_start(struct bch_fs *, unsigned);
+#define for_each_cpu_replicas_entry(_r, _i) \
+ for (_i = (_r)->entries; \
+ (void *) (_i) < (void *) (_r)->entries + (_r)->nr * (_r)->entry_size;\
+ _i = (void *) (_i) + (_r)->entry_size)
+
/* iterate over superblock replicas - used by userspace tools: */
#define replicas_entry_bytes(_i) \