OSDN Git Service

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)
commit888933f8fdf06ecbd5a476b312a37176ab29fb5e
treebd9a86d1a1740e9be765bde585a6212ad1802990
parentf3a2752a43de18eb2eafa869d06f6e423ff0ce61
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