summaryrefslogtreecommitdiff
path: root/include/linux/aio.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/aio.h')
-rw-r--r--include/linux/aio.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/linux/aio.h b/include/linux/aio.h
index 985e664fb05d..9c3cfc551c64 100644
--- a/include/linux/aio.h
+++ b/include/linux/aio.h
@@ -8,6 +8,7 @@
#include <linux/rcupdate.h>
#include <linux/atomic.h>
#include <linux/batch_complete.h>
+#include <linux/blk_types.h>
struct kioctx;
struct kiocb;
@@ -105,6 +106,13 @@ static inline bool kiocb_cancelled(struct kiocb *kiocb)
return kiocb->ki_cancel == KIOCB_CANCELLED;
}
+#ifdef CONFIG_BLOCK
+static inline bool bio_cancelled(struct bio *bio)
+{
+ return bio->bi_iocb && kiocb_cancelled(bio->bi_iocb);
+}
+#endif
+
static inline bool is_sync_kiocb(struct kiocb *kiocb)
{
return kiocb->ki_ctx == NULL;