summaryrefslogtreecommitdiff
path: root/fs/bcachefs/disk_accounting_format.h
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2025-03-21 12:29:56 -0400
committerKent Overstreet <kent.overstreet@linux.dev>2025-03-24 09:50:37 -0400
commitf4a584f4bf64e0db30312088d504d4da29ca556b (patch)
tree48dd7bdecc41978a05c0f2d1580e5b97d0b75e53 /fs/bcachefs/disk_accounting_format.h
parent5ae6f33053af6e904e609593d05e4faf3aeb16fb (diff)
downloadlinux-next-f4a584f4bf64e0db30312088d504d4da29ca556b.tar.gz
linux-next-f4a584f4bf64e0db30312088d504d4da29ca556b.zip
bcachefs: bch2_disk_accounting_mod2()
We're hitting some issues with uninitialized struct padding, flagged by kmsan. They appear to be falso positives, otherwise bch2_accounting_validate() would have flagged them as "junk at end". But for now, we'll need to initialize disk_accounting_pos with memset(). This adds a new helper, bch2_disk_accounting_mod2(), that initializes a disk_accounting_pos and does the accounting mod all at once - so overall things actually get slightly more ergonomic. BCH_DISK_ACCOUNTING_replicas keys are left for now; KMSAN isn't warning about them and they're a bit special. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/disk_accounting_format.h')
-rw-r--r--fs/bcachefs/disk_accounting_format.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/fs/bcachefs/disk_accounting_format.h b/fs/bcachefs/disk_accounting_format.h
index 7b6e6c97e6aa..15190196485f 100644
--- a/fs/bcachefs/disk_accounting_format.h
+++ b/fs/bcachefs/disk_accounting_format.h
@@ -113,14 +113,14 @@ enum disk_accounting_type {
BCH_DISK_ACCOUNTING_TYPE_NR,
};
-struct bch_nr_inodes {
+struct bch_acct_nr_inodes {
};
-struct bch_persistent_reserved {
+struct bch_acct_persistent_reserved {
__u8 nr_replicas;
};
-struct bch_dev_data_type {
+struct bch_acct_dev_data_type {
__u8 dev;
__u8 data_type;
};
@@ -149,10 +149,10 @@ struct disk_accounting_pos {
struct {
__u8 type;
union {
- struct bch_nr_inodes nr_inodes;
- struct bch_persistent_reserved persistent_reserved;
+ struct bch_acct_nr_inodes nr_inodes;
+ struct bch_acct_persistent_reserved persistent_reserved;
struct bch_replicas_entry_v1 replicas;
- struct bch_dev_data_type dev_data_type;
+ struct bch_acct_dev_data_type dev_data_type;
struct bch_acct_compression compression;
struct bch_acct_snapshot snapshot;
struct bch_acct_btree btree;