DragonFly's malloc only guarentees X alignment when X is a power of 2,
authorMatthew Dillon <dillon@dragonflybsd.org>
Mon, 12 Sep 2005 21:38:34 +0000 (21:38 +0000)
committerMatthew Dillon <dillon@dragonflybsd.org>
Mon, 12 Sep 2005 21:38:34 +0000 (21:38 +0000)
commita2f0dcc5adcad57d3ea7d08657ce68c06f140c28
treed1c0f834814777f741598ad181e1db14e796af30
parent1319408982ba5826458361b8d6f1f94d967131b0
DragonFly's malloc only guarentees X alignment when X is a power of 2,
otherwise we would have to use contigalloc, which is nasty.

Use malloc and adjust the allocation request from a multiple of 512 to the
nearest power of 2 greater or equal to 512 and greater or equal to the
request size.

Once a filesystem is mounted I/O operates on 512 byte boundaries anyway, so
this bug fix only effects programs that operates directly on the block device
such as 'newfs' and 'fsck'.
sys/dev/raid/twa/twa_freebsd.c
sys/dev/raid/twe/twe_freebsd.c