diff options
author | trasz <trasz@FreeBSD.org> | 2015-10-18 14:52:31 +0000 |
---|---|---|
committer | trasz <trasz@FreeBSD.org> | 2015-10-18 14:52:31 +0000 |
commit | d3fb3a1ab26c790031581aa03fda3c00b29cfd4c (patch) | |
tree | f6bf76dab2947b461680cebbbc5ae5fa1048b68c /sbin | |
parent | 71228bfa842cbb3ff7cba8a27f18794bc9a46995 (diff) | |
download | FreeBSD-src-d3fb3a1ab26c790031581aa03fda3c00b29cfd4c.zip FreeBSD-src-d3fb3a1ab26c790031581aa03fda3c00b29cfd4c.tar.gz |
MFC r258909:
Tweak mdconfig(8) manual page, in particular revise the EXAMPLES
section. This removes stuff that doesn't really belong there,
and simplifies examples for the basic operations.
Sponsored by: The FreeBSD Foundation
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/mdconfig/mdconfig.8 | 4 | ||||
-rw-r--r-- | sbin/mdconfig/mdconfig.c | 10 |
2 files changed, 10 insertions, 4 deletions
diff --git a/sbin/mdconfig/mdconfig.8 b/sbin/mdconfig/mdconfig.8 index d9a0d1f..1faba2b 100644 --- a/sbin/mdconfig/mdconfig.8 +++ b/sbin/mdconfig/mdconfig.8 @@ -41,7 +41,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 26, 2013 +.Dd November 30, 2013 .Dt MDCONFIG 8 .Os .Sh NAME @@ -122,6 +122,8 @@ Using backing is generally preferred instead of using .Cm malloc backing. +.It Cm null +Bitsink; all writes do nothing, all reads return zeroes. .El .It Fl f Ar file Filename to use for the vnode type memory disk. diff --git a/sbin/mdconfig/mdconfig.c b/sbin/mdconfig/mdconfig.c index 4257dd7..d741c77 100644 --- a/sbin/mdconfig/mdconfig.c +++ b/sbin/mdconfig/mdconfig.c @@ -155,6 +155,9 @@ main(int argc, char **argv) } else if (!strcmp(optarg, "swap")) { mdio.md_type = MD_SWAP; mdio.md_options |= MD_CLUSTER | MD_AUTOUNIT | MD_COMPRESS; + } else if (!strcmp(optarg, "null")) { + mdio.md_type = MD_NULL; + mdio.md_options |= MD_CLUSTER | MD_AUTOUNIT | MD_COMPRESS; } else errx(1, "unknown type: %s", optarg); break; @@ -287,9 +290,10 @@ main(int argc, char **argv) } } - if ((mdio.md_type == MD_MALLOC || mdio.md_type == MD_SWAP) && - sflag == NULL) - errx(1, "must specify -s for -t malloc or -t swap"); + if ((mdio.md_type == MD_MALLOC || mdio.md_type == MD_SWAP || + mdio.md_type == MD_NULL) && sflag == NULL) + errx(1, "must specify -s for -t malloc, -t swap, " + "or -t null"); if (mdio.md_type == MD_VNODE && mdio.md_file[0] == '\0') errx(1, "must specify -f for -t vnode"); } else { |