From 20c52ee5d25721ba6f3b6ccf8de76492a7c11642 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=BD=D0=B0=D0=B1?= Date: Sun, 17 Dec 2023 17:46:05 +0100 Subject: [PATCH] zfs: prop: put written[@#] in .rodata, don't strlen() them MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Ahelenia ZiemiaƄska --- module/zcommon/zfs_prop.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/module/zcommon/zfs_prop.c b/module/zcommon/zfs_prop.c index 764993b45e7c..875c45ef662f 100644 --- a/module/zcommon/zfs_prop.c +++ b/module/zcommon/zfs_prop.c @@ -838,10 +838,10 @@ zfs_prop_userquota(const char *name) boolean_t zfs_prop_written(const char *name) { - static const char *prop_prefix = "written@"; - static const char *book_prefix = "written#"; - return (strncmp(name, prop_prefix, strlen(prop_prefix)) == 0 || - strncmp(name, book_prefix, strlen(book_prefix)) == 0); + static const char prop_prefix[] = "written@"; + static const char book_prefix[] = "written#"; + return (strncmp(name, prop_prefix, sizeof (prop_prefix) - 1) == 0 || + strncmp(name, book_prefix, sizeof (book_prefix) - 1) == 0); } /*