[PATCH 1/4] fscrypt: Add FSTR() helper macro
From: Thorsten Blum
Date: Tue Nov 17 2026 - 19:29:53 EST
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@xxxxxxxxxx>
---
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)