summaryrefslogtreecommitdiffstats
path: root/sbin/mdconfig
diff options
context:
space:
mode:
authorpjd <pjd@FreeBSD.org>2005-01-22 20:02:01 +0000
committerpjd <pjd@FreeBSD.org>2005-01-22 20:02:01 +0000
commitf7dfd80b65fabe2fd061d5ce63c8a7f933e8f940 (patch)
treef8f75f9a5da4677334b7fa13a9a4f59ed5612698 /sbin/mdconfig
parentc5c34ae422e9b7b65d96afd89dc938b862abbaae (diff)
downloadFreeBSD-src-f7dfd80b65fabe2fd061d5ce63c8a7f933e8f940.zip
FreeBSD-src-f7dfd80b65fabe2fd061d5ce63c8a7f933e8f940.tar.gz
Allow to specify device size in bytes.
MFC after: 1 week
Diffstat (limited to 'sbin/mdconfig')
-rw-r--r--sbin/mdconfig/mdconfig.84
-rw-r--r--sbin/mdconfig/mdconfig.c2
2 files changed, 4 insertions, 2 deletions
diff --git a/sbin/mdconfig/mdconfig.8 b/sbin/mdconfig/mdconfig.8
index 6df97aa..7e72275 100644
--- a/sbin/mdconfig/mdconfig.8
+++ b/sbin/mdconfig/mdconfig.8
@@ -114,11 +114,11 @@ md prefix.
Size of the memory disk.
.Ar Size
is the number of 512 byte sectors unless suffixed with a
-.Cm k , m , g ,
+.Cm b , k , m , g ,
or
.Cm t
which
-denotes kilobyte, megabyte, gigabyte and terabyte respectively.
+denotes byte, kilobyte, megabyte, gigabyte and terabyte respectively.
.It Fl S Ar sectorsize
Sectorsize to use for malloc backed device.
.It Fl x Ar sectors/track
diff --git a/sbin/mdconfig/mdconfig.c b/sbin/mdconfig/mdconfig.c
index 0e6d818..b2d9266 100644
--- a/sbin/mdconfig/mdconfig.c
+++ b/sbin/mdconfig/mdconfig.c
@@ -178,6 +178,8 @@ main(int argc, char **argv)
mdio.md_mediasize = (off_t)strtoumax(optarg, &p, 0);
if (p == NULL || *p == '\0')
mdio.md_mediasize *= DEV_BSIZE;
+ else if (*p == 'b' || *p == 'B')
+ ; /* do nothing */
else if (*p == 'k' || *p == 'K')
mdio.md_mediasize <<= 10;
else if (*p == 'm' || *p == 'M')
OpenPOWER on IntegriCloud