summaryrefslogtreecommitdiff
path: root/fs/bcachefs/util.h
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2023-12-17 05:16:34 +0300
committerKent Overstreet <kent.overstreet@linux.dev>2024-01-01 19:47:41 +0300
commit038fecc045932171e882a4e3668208c28f66f795 (patch)
treec09848098eabaf9d389632f392bf68a547bce3a8 /fs/bcachefs/util.h
parentcf904c8d964fa477cdb83445a03d05e9eda5d65c (diff)
downloadlinux-038fecc045932171e882a4e3668208c28f66f795.tar.xz
bcachefs: qstr_eq()
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/util.h')
-rw-r--r--fs/bcachefs/util.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/fs/bcachefs/util.h b/fs/bcachefs/util.h
index 7eb567ab4457..1ff063bb8741 100644
--- a/fs/bcachefs/util.h
+++ b/fs/bcachefs/util.h
@@ -856,4 +856,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 */