fs: relax memory alignment restriction for O_DIRECT
authorJens Axboe <axboe@kernel.dk>
Thu, 11 Feb 2021 15:35:06 +0000 (08:35 -0700)
committerJens Axboe <axboe@kernel.dk>
Mon, 15 Feb 2021 15:39:23 +0000 (08:39 -0700)
commit056ad0bb3710562ad38ce831d4d412fd6b8d954f
tree56b92b5cfe57c0ad2769fb024974e1b4cfbff1ec
parente0756cfc7d7cd08c98a53b6009c091a3f6a50be6
fs: relax memory alignment restriction for O_DIRECT

We currently require blocksize alignment for both position/length and the
memory range. The latter is overly restrictive, as most devices can do DMA
at a much finer granularity.

Honor the bdev setting for DMA alignment, and use that for checking if we
can process the IO or need to error it.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/block_dev.c
fs/direct-io.c