svn commit: r242491 - user/alfred/9-alfred/sys/fs/tmpfs
Alfred Perlstein
alfred at FreeBSD.org
Fri Nov 2 20:36:42 UTC 2012
Author: alfred
Date: Fri Nov 2 20:36:41 2012
New Revision: 242491
URL: http://svn.freebsd.org/changeset/base/242491
Log:
Merge from stable, nfs export tmpfs.
svn merge -c 234346 ^/head/sys
Modified:
user/alfred/9-alfred/sys/fs/tmpfs/tmpfs.h
user/alfred/9-alfred/sys/fs/tmpfs/tmpfs_vfsops.c
Directory Properties:
user/alfred/9-alfred/sys/ (props changed)
user/alfred/9-alfred/sys/fs/ (props changed)
Modified: user/alfred/9-alfred/sys/fs/tmpfs/tmpfs.h
==============================================================================
--- user/alfred/9-alfred/sys/fs/tmpfs/tmpfs.h Fri Nov 2 20:23:41 2012 (r242490)
+++ user/alfred/9-alfred/sys/fs/tmpfs/tmpfs.h Fri Nov 2 20:36:41 2012 (r242491)
@@ -387,6 +387,9 @@ struct tmpfs_mount {
* tmpfs_pool.c. */
uma_zone_t tm_dirent_pool;
uma_zone_t tm_node_pool;
+
+ /* Read-only status. */
+ int tm_ronly;
};
#define TMPFS_LOCK(tm) mtx_lock(&(tm)->allnode_lock)
#define TMPFS_UNLOCK(tm) mtx_unlock(&(tm)->allnode_lock)
Modified: user/alfred/9-alfred/sys/fs/tmpfs/tmpfs_vfsops.c
==============================================================================
--- user/alfred/9-alfred/sys/fs/tmpfs/tmpfs_vfsops.c Fri Nov 2 20:23:41 2012 (r242490)
+++ user/alfred/9-alfred/sys/fs/tmpfs/tmpfs_vfsops.c Fri Nov 2 20:36:41 2012 (r242491)
@@ -82,6 +82,10 @@ static const char *tmpfs_opts[] = {
NULL
};
+static const char *tmpfs_updateopts[] = {
+ "from", "export", NULL
+};
+
/* --------------------------------------------------------------------- */
static int
@@ -193,10 +197,13 @@ tmpfs_mount(struct mount *mp)
return (EINVAL);
if (mp->mnt_flag & MNT_UPDATE) {
- /* XXX: There is no support yet to update file system
- * settings. Should be added. */
-
- return EOPNOTSUPP;
+ /* Only support update mounts for certain options. */
+ if (vfs_filteropt(mp->mnt_optnew, tmpfs_updateopts) != 0)
+ return (EOPNOTSUPP);
+ if (vfs_flagopt(mp->mnt_optnew, "ro", NULL, 0) !=
+ ((struct tmpfs_mount *)mp->mnt_data)->tm_ronly)
+ return (EOPNOTSUPP);
+ return (0);
}
vn_lock(mp->mnt_vnodecovered, LK_SHARED | LK_RETRY);
@@ -269,6 +276,7 @@ tmpfs_mount(struct mount *mp)
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;
/* Allocate the root node. */
error = tmpfs_alloc_node(tmp, VDIR, root_uid,
More information about the svn-src-user
mailing list