summaryrefslogtreecommitdiff
path: root/fs/bcachefs/bcachefs.h
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2024-05-04 01:07:40 +0300
committerKent Overstreet <kent.overstreet@linux.dev>2024-05-09 00:29:22 +0300
commit552aa5486579c18b4f8e7ca03ef88fa573c517b5 (patch)
treec64a06534b0b4de946fababe7f7800347172298c /fs/bcachefs/bcachefs.h
parentf295298b8c6413f0ed2a5a69dd7f32409cc54f1d (diff)
downloadlinux-552aa5486579c18b4f8e7ca03ef88fa573c517b5.tar.xz
bcachefs: Debug asserts for ca->ref
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/bcachefs.h')
-rw-r--r--fs/bcachefs/bcachefs.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/bcachefs/bcachefs.h b/fs/bcachefs/bcachefs.h
index 82544f826c58..f5ba8c6a34d7 100644
--- a/fs/bcachefs/bcachefs.h
+++ b/fs/bcachefs/bcachefs.h
@@ -537,7 +537,13 @@ struct io_count {
struct bch_dev {
struct kobject kobj;
+#ifdef CONFIG_BCACHEFS_DEBUG
+ atomic_long_t ref;
+ bool dying;
+ unsigned long last_put;
+#else
struct percpu_ref ref;
+#endif
struct completion ref_completion;
struct percpu_ref io_ref;
struct completion io_ref_completion;