[PATCH 1/4] fscrypt: Add FSTR() helper macro
Thorsten Blum
blum at kernel.org
Tue Nov 17 16:28:47 PST 2026
Similar to QSTR(), add FSTR() to initialize struct fscrypt_str from a
NUL-terminated string without specifying its length.
Signed-off-by: Thorsten Blum <blum at kernel.org>
---
include/linux/fscrypt.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/include/linux/fscrypt.h b/include/linux/fscrypt.h
index 28f2108e29f3..84d9147fda2f 100644
--- a/include/linux/fscrypt.h
+++ b/include/linux/fscrypt.h
@@ -50,6 +50,7 @@ struct fscrypt_name {
};
#define FSTR_INIT(n, l) { .name = n, .len = l }
+#define FSTR(n) ((struct fscrypt_str)FSTR_INIT(n, strlen(n)))
#define FSTR_TO_QSTR(f) QSTR_INIT((f)->name, (f)->len)
#define fname_name(p) ((p)->disk_name.name)
#define fname_len(p) ((p)->disk_name.len)
More information about the linux-mtd
mailing list