diff options
author | Kent Overstreet <koverstreet@google.com> | 2013-05-31 15:23:53 -0700 |
---|---|---|
committer | Kent Overstreet <koverstreet@google.com> | 2013-06-17 19:39:45 -0700 |
commit | 5be1ce5a6c33c74f0e1bffca7c215338be6411dc (patch) | |
tree | 8cad5b53cf6e6fd793d9e4ff60fe309d72ad484c /fs/lockd/svcshare.c | |
parent | 413156bc35c3d8eaa57e58a770f1c0c5d27a06e8 (diff) |
block: Bio cancellationaio-ida
If a bio is associated with a kiocb, allow it to be cancelled.
This is accomplished by adding a pointer to a kiocb in struct bio, and
when we go to dequeue a request we check if its bio has been cancelled -
if so, we end the request with -ECANCELED.
We don't currently try to cancel bios if IO has already been started -
that'd require a per bio callback function, and a way to find all the
outstanding bios for a given kiocb. Such a mechanism may or may not be
added in the future but this patch tries to start simple.
Currently this can only be triggered with aio and io_cancel(), but the
mechanism can be used for sync io too.
It can also be used for bios created by stacking drivers, and bio clones
in general - when cloning a bio, if the bi_iocb pointer is copied as
well the clone will then be cancellable. bio_clone() could be modified
to do this, but hasn't in this patch because all the bio_clone() users
would need to be auditied to make sure that it's safe. We can't blindly
make e.g. raid5 writes cancellable without the knowledge of the md code.
Initial patch by Anatol Pomazau (anatol@google.com).
Signed-off-by: Kent Overstreet <koverstreet@google.com>
Cc: Zach Brown <zab@redhat.com>
Cc: Joel Becker <jlbec@evilplan.org>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: Jeff Moyer <jmoyer@redhat.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Benjamin LaHaise <bcrl@kvack.org>
Diffstat (limited to 'fs/lockd/svcshare.c')
0 files changed, 0 insertions, 0 deletions