mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2025-01-28 02:44:30 +03:00
freebsd: libshare/nfs: constify static const data
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz> Closes #13165
This commit is contained in:
parent
45588be285
commit
5f0c1c4ebd
@ -78,9 +78,9 @@ static sa_fstype_t *nfs_fstype;
|
|||||||
static char *
|
static char *
|
||||||
translate_opts(const char *shareopts)
|
translate_opts(const char *shareopts)
|
||||||
{
|
{
|
||||||
static const char *known_opts[] = { "ro", "maproot", "mapall", "mask",
|
static const char *const known_opts[] = { "ro", "maproot", "mapall",
|
||||||
"network", "sec", "alldirs", "public", "webnfs", "index", "quiet",
|
"mask", "network", "sec", "alldirs", "public", "webnfs", "index",
|
||||||
NULL };
|
"quiet" };
|
||||||
static char newopts[OPTSSIZE];
|
static char newopts[OPTSSIZE];
|
||||||
char oldopts[OPTSSIZE];
|
char oldopts[OPTSSIZE];
|
||||||
char *o, *s = NULL;
|
char *o, *s = NULL;
|
||||||
@ -93,7 +93,7 @@ translate_opts(const char *shareopts)
|
|||||||
while ((o = strsep(&s, "-, ")) != NULL) {
|
while ((o = strsep(&s, "-, ")) != NULL) {
|
||||||
if (o[0] == '\0')
|
if (o[0] == '\0')
|
||||||
continue;
|
continue;
|
||||||
for (i = 0; known_opts[i] != NULL; i++) {
|
for (i = 0; i < ARRAY_SIZE(known_opts); ++i) {
|
||||||
len = strlen(known_opts[i]);
|
len = strlen(known_opts[i]);
|
||||||
if (strncmp(known_opts[i], o, len) == 0 &&
|
if (strncmp(known_opts[i], o, len) == 0 &&
|
||||||
(o[len] == '\0' || o[len] == '=')) {
|
(o[len] == '\0' || o[len] == '=')) {
|
||||||
|
Loading…
Reference in New Issue
Block a user