summaryrefslogtreecommitdiffstats
path: root/sbin/mdconfig
diff options
context:
space:
mode:
authortrasz <trasz@FreeBSD.org>2013-12-04 07:38:23 +0000
committertrasz <trasz@FreeBSD.org>2013-12-04 07:38:23 +0000
commitde454232c87d0a19908a3c7c6906bbce5ad1b9e9 (patch)
tree4a2354d11de8bae937258417b24a0a207b6c0825 /sbin/mdconfig
parent9e1f3b382bc2d9aa47a369be09162fbdaf6f1a25 (diff)
downloadFreeBSD-src-de454232c87d0a19908a3c7c6906bbce5ad1b9e9.zip
FreeBSD-src-de454232c87d0a19908a3c7c6906bbce5ad1b9e9.tar.gz
Add "null" backend to mdconfig(8). This does exactly what the name
suggests, and is somewhat useful for benchmarking. MFC after: 1 month No objections from: kib Sponsored by: The FreeBSD Foundation
Diffstat (limited to 'sbin/mdconfig')
-rw-r--r--sbin/mdconfig/mdconfig.84
-rw-r--r--sbin/mdconfig/mdconfig.c10
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 {
OpenPOWER on IntegriCloud