diff options
| author | Poul-Henning Kamp <phk@FreeBSD.org> | 2003-03-03 13:05:00 +0000 |
|---|---|---|
| committer | Poul-Henning Kamp <phk@FreeBSD.org> | 2003-03-03 13:05:00 +0000 |
| commit | ebe789d61c70e3c9dc31441e9d59f051b40ba30b (patch) | |
| tree | ebeb4dc8a6258d6e27bf80318a7c535c404b73c1 /sys/dev | |
| parent | a8b182112da70fe234189b384a13d8f3bcb36731 (diff) | |
Notes
Diffstat (limited to 'sys/dev')
| -rw-r--r-- | sys/dev/md/md.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/sys/dev/md/md.c b/sys/dev/md/md.c index c03d10eeb6a5..7b754cba3313 100644 --- a/sys/dev/md/md.c +++ b/sys/dev/md/md.c @@ -746,6 +746,8 @@ mdcreate_malloc(struct md_ioctl *mdio) return (EINVAL); if (mdio->md_options & ~(MD_AUTOUNIT | MD_COMPRESS | MD_RESERVE)) return (EINVAL); + if (mdio->md_secsize != 0 && !powerof2(mdio->md_secsize)) + return (EINVAL); /* Compression doesn't make sense if we have reserved space */ if (mdio->md_options & MD_RESERVE) mdio->md_options &= ~MD_COMPRESS; @@ -760,8 +762,12 @@ mdcreate_malloc(struct md_ioctl *mdio) return (EBUSY); } sc->type = MD_MALLOC; - sc->secsize = DEV_BSIZE; + if (mdio->md_secsize != 0) + sc->secsize = mdio->md_secsize; + else + sc->secsize = DEV_BSIZE; sc->nsect = mdio->md_size; + sc->nsect /= (sc->secsize / DEV_BSIZE); sc->flags = mdio->md_options & (MD_COMPRESS | MD_FORCE); sc->indir = dimension(sc->nsect); sc->uma = uma_zcreate(sc->name, sc->secsize, |
