aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKonstantin Belousov <kib@FreeBSD.org>2025-10-08 15:44:59 +0000
committerKonstantin Belousov <kib@FreeBSD.org>2025-10-09 22:47:22 +0000
commit8e6f6a5fbde78bd8d19445ee6ebaf00b8f4f5aa9 (patch)
tree0e7230ee7ccdb8a09b73017fc076b18a4d342bd4
parent419f2fe6b70b1a409bf7eca7020d7c745558690f (diff)
nullfs_mount: use symbols instead of string literals for cache mount options
Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D52983
-rw-r--r--sys/fs/nullfs/null_vfsops.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/fs/nullfs/null_vfsops.c b/sys/fs/nullfs/null_vfsops.c
index e2dabd8e33cc..483d4182e65e 100644
--- a/sys/fs/nullfs/null_vfsops.c
+++ b/sys/fs/nullfs/null_vfsops.c
@@ -85,6 +85,8 @@ nullfs_mount(struct mount *mp)
char *target;
int error, len;
bool isvnunlocked;
+ static const char cache_opt_name[] = "cache";
+ static const char nocache_opt_name[] = "nocache";
NULLFSDEBUG("nullfs_mount(mp = %p)\n", (void *)mp);
@@ -205,9 +207,10 @@ nullfs_mount(struct mount *mp)
MNT_IUNLOCK(mp);
}
- if (vfs_getopt(mp->mnt_optnew, "cache", NULL, NULL) == 0) {
+ if (vfs_getopt(mp->mnt_optnew, cache_opt_name, NULL, NULL) == 0) {
xmp->nullm_flags |= NULLM_CACHE;
- } else if (vfs_getopt(mp->mnt_optnew, "nocache", NULL, NULL) == 0) {
+ } else if (vfs_getopt(mp->mnt_optnew, nocache_opt_name, NULL,
+ NULL) == 0) {
;
} else if (null_cache_vnodes &&
(xmp->nullm_vfs->mnt_kern_flag & MNTK_NULL_NOCACHE) == 0) {