summaryrefslogtreecommitdiff
path: root/libbcachefs/util.h
diff options
context:
space:
mode:
Diffstat (limited to 'libbcachefs/util.h')
-rw-r--r--libbcachefs/util.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/libbcachefs/util.h b/libbcachefs/util.h
index b93d5f48..a4db93a2 100644
--- a/libbcachefs/util.h
+++ b/libbcachefs/util.h
@@ -855,4 +855,11 @@ static inline int cmp_le32(__le32 l, __le32 r)
#include <linux/uuid.h>
+#define QSTR(n) { { { .len = strlen(n) } }, .name = n }
+
+static inline bool qstr_eq(const struct qstr l, const struct qstr r)
+{
+ return l.len == r.len && !memcmp(l.name, r.name, l.len);
+}
+
#endif /* _BCACHEFS_UTIL_H */