summaryrefslogtreecommitdiff
path: root/libbcachefs/bcachefs.h
diff options
context:
space:
mode:
Diffstat (limited to 'libbcachefs/bcachefs.h')
-rw-r--r--libbcachefs/bcachefs.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/libbcachefs/bcachefs.h b/libbcachefs/bcachefs.h
index 4f1ac7aa..45c15bda 100644
--- a/libbcachefs/bcachefs.h
+++ b/libbcachefs/bcachefs.h
@@ -1165,7 +1165,7 @@ static inline bool bch2_ro_ref_tryget(struct bch_fs *c)
static inline void bch2_ro_ref_put(struct bch_fs *c)
{
- if (refcount_dec_and_test(&c->ro_ref))
+ if (c && refcount_dec_and_test(&c->ro_ref))
wake_up(&c->ro_ref_wait);
}
@@ -1277,4 +1277,11 @@ static inline int bch2_fs_casefold_enabled(struct bch_fs *c)
return 0;
}
+static inline const char *strip_bch2(const char *msg)
+{
+ if (!strncmp("bch2_", msg, 5))
+ return msg + 5;
+ return msg;
+}
+
#endif /* _BCACHEFS_H */