Skip to content

Commit 8e6f6a5

Browse files
committed
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
1 parent 419f2fe commit 8e6f6a5

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

sys/fs/nullfs/null_vfsops.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@ nullfs_mount(struct mount *mp)
8585
char *target;
8686
int error, len;
8787
bool isvnunlocked;
88+
static const char cache_opt_name[] = "cache";
89+
static const char nocache_opt_name[] = "nocache";
8890

8991
NULLFSDEBUG("nullfs_mount(mp = %p)\n", (void *)mp);
9092

@@ -205,9 +207,10 @@ nullfs_mount(struct mount *mp)
205207
MNT_IUNLOCK(mp);
206208
}
207209

208-
if (vfs_getopt(mp->mnt_optnew, "cache", NULL, NULL) == 0) {
210+
if (vfs_getopt(mp->mnt_optnew, cache_opt_name, NULL, NULL) == 0) {
209211
xmp->nullm_flags |= NULLM_CACHE;
210-
} else if (vfs_getopt(mp->mnt_optnew, "nocache", NULL, NULL) == 0) {
212+
} else if (vfs_getopt(mp->mnt_optnew, nocache_opt_name, NULL,
213+
NULL) == 0) {
211214
;
212215
} else if (null_cache_vnodes &&
213216
(xmp->nullm_vfs->mnt_kern_flag & MNTK_NULL_NOCACHE) == 0) {

0 commit comments

Comments
 (0)