tmpfs nfs exports?

Konstantin Belousov kostikbel at gmail.com
Tue Oct 30 12:00:31 UTC 2012


On Tue, Oct 30, 2012 at 02:38:16AM -0700, Alfred Perlstein wrote:
> Hey folks, any reason why not to include the following patch in 9.1? It 
> would be nice to have tmpfs be exportable.
> 
> I'm good to commit it, I can also wait until post 9.1.
It is too late for 9.1. Patch is fine for stable/9, but you merged at
the wrong point. Merge at sys/, not at the root of the sources.

> 
> $ svn diff
> Index: .
> ===================================================================
> --- .    (revision 242331)
> +++ .    (working copy)
> 
> Property changes on: .
> ___________________________________________________________________
> Modified: svn:mergeinfo
>     Merged /head:r234346
> Index: sys
> ===================================================================
> --- sys    (revision 242331)
> +++ sys    (working copy)
> 
> Property changes on: sys
> ___________________________________________________________________
> Modified: svn:mergeinfo
>     Merged /head/sys:r234346
> Index: sys/fs
> ===================================================================
> --- sys/fs    (revision 242331)
> +++ sys/fs    (working copy)
> 
> Property changes on: sys/fs
> ___________________________________________________________________
> Modified: svn:mergeinfo
>     Merged /head/sys/fs:r234346
> Index: sys/fs/tmpfs/tmpfs.h
> ===================================================================
> --- sys/fs/tmpfs/tmpfs.h    (revision 242331)
> +++ sys/fs/tmpfs/tmpfs.h    (working copy)
> @@ -387,6 +387,9 @@
>        * 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)
> Index: sys/fs/tmpfs/tmpfs_vfsops.c
> ===================================================================
> --- sys/fs/tmpfs/tmpfs_vfsops.c    (revision 242331)
> +++ sys/fs/tmpfs/tmpfs_vfsops.c    (working copy)
> @@ -82,6 +82,10 @@
>       NULL
>   };
> 
> +static const char *tmpfs_updateopts[] = {
> +    "from", "export", NULL
> +};
> +
>   /* 
> --------------------------------------------------------------------- */
> 
>   static int
> @@ -193,10 +197,13 @@
>           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_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,
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-stable/attachments/20121030/11c20f05/attachment.sig>


More information about the freebsd-stable mailing list