]> git.baikalelectronics.ru Git - kernel.git/commit
aio: simplify cancellation
authorChristoph Hellwig <hch@lst.de>
Wed, 23 May 2018 12:11:02 +0000 (14:11 +0200)
committerChristoph Hellwig <hch@lst.de>
Sat, 26 May 2018 07:16:44 +0000 (09:16 +0200)
commit8646ca37e2850c8020ba56e426d972c11f9162be
treebd9a86d1a1740e9be765bde585a6212ad1802990
parentfb0926d671f8277a1f371d49dbb6f10d55b5c012
aio: simplify cancellation

With the current aio code there is no need for the magic KIOCB_CANCELLED
value, as a cancelation just kicks the driver to queue the completion
ASAP, with all actual completion handling done in another thread. Given
that both the completion path and cancelation take the context lock there
is no need for magic cmpxchg loops either.  If we remove iocbs from the
active list after calling ->ki_cancel (but with ctx_lock still held), we
can also rely on the invariant thay anything found on the list has a
->ki_cancel callback and can be cancelled, further simplifing the code.

Signed-off-by: Christoph Hellwig <hch@lst.de>
fs/aio.c