bcachefs: Add persistent counters
authorDaniel Hill <daniel@gluo.nz>
Tue, 15 Mar 2022 08:36:33 +0000 (21:36 +1300)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:09:32 +0000 (17:09 -0400)
commit104c69745fdf7e5f8aa022f60bc9d568987bd8b8
tree09fc07cf3d1bbe991c7a586fbac4ee24c31d1b98
parent1f93726e6347938343190913cb959623e67ecf78
bcachefs: Add persistent counters

This adds a new superblock field for persisting counters
and adds a sysfs interface in counters/ exposing these counters.

The superblock field is ignored by older versions letting us avoid
an on disk version bump.

Each sysfs file outputs a counter that tracks since filesystem
creation and a counter for the current mount session.

Signed-off-by: Daniel Hill <daniel@gluo.nz>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/Makefile
fs/bcachefs/bcachefs.h
fs/bcachefs/bcachefs_format.h
fs/bcachefs/counters.c [new file with mode: 0644]
fs/bcachefs/counters.h [new file with mode: 0644]
fs/bcachefs/io.c
fs/bcachefs/move.c
fs/bcachefs/super-io.c
fs/bcachefs/super.c
fs/bcachefs/sysfs.c
fs/bcachefs/sysfs.h