OSDN Git Service

/dev/mem: nowait zero/null ops
authorPavel Begunkov <asml.silence@gmail.com>
Wed, 8 Sep 2021 19:10:38 +0000 (20:10 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 14 Sep 2021 08:46:19 +0000 (10:46 +0200)
commite5f71d60ff167d0caa491659d65551a55ea6b406
tree3a6f7e0b1524aa1e77b4134b12104472a12aa4f1
parent6880fa6c56601bb8ed59df6c30fd390cc5f6dd8f
/dev/mem: nowait zero/null ops

Make read_iter_zero() to honor IOCB_NOWAIT, so /dev/zero can be
advertised as FMODE_NOWAIT. It's useful for io_uring, which needs it to
apply certain optimisations when doing I/O against the device.

Set FMODE_NOWAIT for /dev/null as well, it never waits and therefore
trivially meets the criteria.

Reviewed-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/f11090f97ddc2b2ce49ea1211258658ddfbc5563.1631127867.git.asml.silence@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/char/mem.c