summaryrefslogtreecommitdiff
path: root/include/linux/bio.h
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2016-11-01 07:40:11 -0600
committerJens Axboe <axboe@fb.com>2016-11-01 09:43:26 -0600
commitd38499530e5f170d30f32d3841fade204e63081d (patch)
tree931cc16c86ab8d7b07dcda66febb6b1af21e2234 /include/linux/bio.h
parent70fd76140a6cb63262bd47b68d57b42e889c10ee (diff)
fs: decouple READ and WRITE from the block layer ops
Move READ and WRITE to kernel.h and don't define them in terms of block layer ops; they are our generic data direction indicators these days and have no more resemblance with the block layer ops. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'include/linux/bio.h')
-rw-r--r--include/linux/bio.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/bio.h b/include/linux/bio.h
index 87ce64dafb93..fe9a17017608 100644
--- a/include/linux/bio.h
+++ b/include/linux/bio.h
@@ -63,6 +63,12 @@
#define bio_end_sector(bio) ((bio)->bi_iter.bi_sector + bio_sectors((bio)))
/*
+ * Return the data direction, READ or WRITE.
+ */
+#define bio_data_dir(bio) \
+ (op_is_write(bio_op(bio)) ? WRITE : READ)
+
+/*
* Check whether this bio carries any data or not. A NULL bio is allowed.
*/
static inline bool bio_has_data(struct bio *bio)