Teach mdmfs about tmpfs and use tmpfs in rc scripts

Ian Lepore ian at FreeBSD.org
Thu Mar 6 23:27:01 UTC 2014


A recent discussion on arm@ about using tmpfs instead of md(4) spurred
me to do something I've been wanting to do for a while:  enhance mdmfs
so that it can configure tmpfs as well as md+ffs, and update the rc
scripts to make use the the feature.

Attached are diffs to do this (man page updates not in there yet).

mdmfs recognizes two new values for the md-device argument: tmpfs and
auto.  If you request 'tmpfs' you get it, or it fails if tmpfs is not
present in the kernel.  If you request 'auto' it will use tmpfs if it's
present in the kernel and the other options don't include multilabel MAC
(which tmpfs doesn't handle, as near as I can tell).  Other options
which have no meaning with tmpfs (such as setting the number of inodes)
are silently ignored.

The rc scripts are updated to add a new mfs_type knob, which defaults to
"auto".  This in effect automatically updates folks to use tmpfs instead
of md as long as it's present and they aren't using the one option that
forbids it (multilabel MAC).

Thoughts?

-- Ian

-------------- next part --------------
A non-text attachment was scrubbed...
Name: mdmfs_tmpfs.diff
Type: text/x-patch
Size: 7210 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-arch/attachments/20140306/6278139f/attachment.bin>


More information about the freebsd-arch mailing list