Skip to content

Commit

Permalink
zfs: prop: put written[@#] in .rodata, don't strlen() them
Browse files Browse the repository at this point in the history
Signed-off-by: Ahelenia Ziemiańska <[email protected]>
  • Loading branch information
nabijaczleweli committed Dec 17, 2023
1 parent b06259a commit 20c52ee
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions module/zcommon/zfs_prop.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

/*
Expand Down

0 comments on commit 20c52ee

Please sign in to comment.