Allow to specify device size in bytes.

MFC after:	1 week
This commit is contained in:
Pawel Jakub Dawidek 2005-01-22 20:02:01 +00:00
parent 0447ccf320
commit 0d79319a76
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=140627
2 changed files with 4 additions and 2 deletions

View File

@ -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

View File

@ -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')