diff options
author | kib <kib@FreeBSD.org> | 2017-02-02 01:18:54 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2017-02-02 01:18:54 +0000 |
commit | 26bb17b098c1d6eafb5a0b254b1e8dc607cad1c5 (patch) | |
tree | 2abf64ea4115a0b71f819a7602b7e518d449b224 /sys/fs/tmpfs/tmpfs_vfsops.c | |
parent | 45a0f085cde44a165255c23d3c85e3f573f7e8b0 (diff) | |
download | FreeBSD-src-26bb17b098c1d6eafb5a0b254b1e8dc607cad1c5.zip FreeBSD-src-26bb17b098c1d6eafb5a0b254b1e8dc607cad1c5.tar.gz |
MFC r312432:
Add a mount option for tmpfs(5) to not use namecache.
Diffstat (limited to 'sys/fs/tmpfs/tmpfs_vfsops.c')
-rw-r--r-- | sys/fs/tmpfs/tmpfs_vfsops.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/fs/tmpfs/tmpfs_vfsops.c b/sys/fs/tmpfs/tmpfs_vfsops.c index 188e476..4b336ba 100644 --- a/sys/fs/tmpfs/tmpfs_vfsops.c +++ b/sys/fs/tmpfs/tmpfs_vfsops.c @@ -79,7 +79,7 @@ static void tmpfs_susp_clean(struct mount *); static const char *tmpfs_opts[] = { "from", "size", "maxfilesize", "inodes", "uid", "gid", "mode", "export", - "union", NULL + "union", "nonc", NULL }; static const char *tmpfs_updateopts[] = { @@ -138,6 +138,7 @@ tmpfs_mount(struct mount *mp) struct tmpfs_node *root; struct thread *td = curthread; int error; + bool nonc; /* Size counters. */ u_quad_t pages; off_t nodes_max, size_max, maxfilesize; @@ -186,6 +187,7 @@ tmpfs_mount(struct mount *mp) size_max = 0; if (vfs_getopt_size(mp->mnt_optnew, "maxfilesize", &maxfilesize) != 0) maxfilesize = 0; + nonc = vfs_getopt(mp->mnt_optnew, "nonc", NULL, NULL) == 0; /* Do not allow mounts if we do not have enough memory to preserve * the minimum reserved pages. */ @@ -236,6 +238,7 @@ tmpfs_mount(struct mount *mp) sizeof(struct tmpfs_node), tmpfs_node_ctor, tmpfs_node_dtor, tmpfs_node_init, tmpfs_node_fini, UMA_ALIGN_PTR, 0); tmp->tm_ronly = (mp->mnt_flag & MNT_RDONLY) != 0; + tmp->tm_nonc = nonc; /* Allocate the root node. */ error = tmpfs_alloc_node(mp, tmp, VDIR, root_uid, root_gid, |