diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2018-11-22 22:50:35 -0500 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 17:08:12 -0400 |
commit | eeb83e25bb07ff1d00297c541c03e35c8c3c762c (patch) | |
tree | ae0cd93121daec2bec5ec066dfb50cb7171cc3df /fs/bcachefs/bkey_methods.h | |
parent | dfe9bfb32e380df67d25cd5afb887b3466230e03 (diff) |
bcachefs: Hold usage_lock over mark_key and fs_usage_apply
Fixes an inconsistency at the end of gc
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/bkey_methods.h')
-rw-r--r-- | fs/bcachefs/bkey_methods.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/fs/bcachefs/bkey_methods.h b/fs/bcachefs/bkey_methods.h index be6041e92c05..62b86a8e2ba8 100644 --- a/fs/bcachefs/bkey_methods.h +++ b/fs/bcachefs/bkey_methods.h @@ -54,6 +54,18 @@ struct bkey_ops { bool is_extents; }; +static inline bool bkey_type_needs_gc(enum bkey_type type) +{ + switch (type) { + case BKEY_TYPE_BTREE: + case BKEY_TYPE_EXTENTS: + case BKEY_TYPE_EC: + return true; + default: + return false; + } +} + const char *bch2_bkey_val_invalid(struct bch_fs *, enum bkey_type, struct bkey_s_c); const char *__bch2_bkey_invalid(struct bch_fs *, enum bkey_type, struct bkey_s_c); |