bcachefs: Debug mode for c->writes references
authorKent Overstreet <kent.overstreet@linux.dev>
Thu, 9 Feb 2023 17:21:45 +0000 (12:21 -0500)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:09:50 +0000 (17:09 -0400)
commitd94189ad568f6cbd80d372cf7aa6e4898b6c5c17
tree4e23dbd00746c19092bcdb8604903cab7049a83b
parentdd81a060eb0680e09d133b81db54b90442c32b5e
bcachefs: Debug mode for c->writes references

This adds a debug mode where we split up the c->writes refcount into
distinct refcounts for every codepath that takes a reference, and adds
sysfs code to print the value of each ref.

This will make it easier to debug shutdown hangs due to refcount leaks.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
13 files changed:
fs/bcachefs/alloc_background.c
fs/bcachefs/bcachefs.h
fs/bcachefs/btree_update_interior.c
fs/bcachefs/btree_update_leaf.c
fs/bcachefs/ec.c
fs/bcachefs/fs-io.c
fs/bcachefs/io.c
fs/bcachefs/move.c
fs/bcachefs/reflink.c
fs/bcachefs/subvolume.c
fs/bcachefs/super.c
fs/bcachefs/super.h
fs/bcachefs/sysfs.c