diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2023-12-16 21:16:34 -0500 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2024-01-01 11:47:41 -0500 |
commit | 038fecc045932171e882a4e3668208c28f66f795 (patch) | |
tree | c09848098eabaf9d389632f392bf68a547bce3a8 /fs/bcachefs/util.h | |
parent | cf904c8d964fa477cdb83445a03d05e9eda5d65c (diff) |
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.h | 7 |
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 */ |