Alignment of disk-I/O from userland.
Garrett Wollman
wollman at khavrinen.lcs.mit.edu
Mon Oct 6 14:46:54 PDT 2003
PHK writes:
>Most code which does disk I/O from userland uses malloc'ed buffers for
>the sectors and the alignment comes for free, but we currently have
>no requirement that it be so.
I believe that the Standard allows practically arbitrary restrictions
on what may be done with devices (since most devices, aside from ttys,
are outside the scope of the Standard anyway). It says that read()
may fail if:
[ENXIO] A request was made of a nonexistent device, or the request
was outside the capabilities of the device.
(I'm assuming you're talking about reads from devices, as opposed to
reads from files.)
I think that gives us plenary authority to require appropriate
alignment of data buffers used to access disk devices directly.
-GAWollman
More information about the freebsd-arch
mailing list