zfs: prop: put written[@#] in .rodata, don't strlen() them

Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
This commit is contained in:
наб 2023-12-17 17:46:05 +01:00
parent b06259a42d
commit 20c52ee5d2
No known key found for this signature in database
GPG Key ID: BCFD0B018D2658F1
1 changed files with 4 additions and 4 deletions

View File

@ -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);
}
/*