git: e9a48e988e2d - stable/15 - nullfs_mount: use symbols instead of string literals for cache mount options
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 16 Oct 2025 02:22:30 UTC
The branch stable/15 has been updated by kib:
URL: https://cgit.FreeBSD.org/src/commit/?id=e9a48e988e2d65827d4278e3b3bf437aea400827
commit e9a48e988e2d65827d4278e3b3bf437aea400827
Author: Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2025-10-08 15:44:59 +0000
Commit: Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2025-10-16 02:22:20 +0000
nullfs_mount: use symbols instead of string literals for cache mount options
(cherry picked from commit 8e6f6a5fbde78bd8d19445ee6ebaf00b8f4f5aa9)
---
sys/fs/nullfs/null_vfsops.c | 7 +++++--
1 file 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) {