summaryrefslogtreecommitdiffstats
path: root/include/linux/blk_types.h
diff options
context:
space:
mode:
authorChristoph Hellwig2016-11-01 14:40:08 +0100
committerJens Axboe2016-11-01 16:43:26 +0100
commitb685d3d65ac791406e0dfd8779cc9b3707fea5a3 (patch)
tree3c0697577f4ffcdbd325f2d966c7b998e215c267 /include/linux/blk_types.h
parentblock: don't use REQ_SYNC in the READ_SYNC definition (diff)
downloadkernel-qcow2-linux-b685d3d65ac791406e0dfd8779cc9b3707fea5a3.tar.gz
kernel-qcow2-linux-b685d3d65ac791406e0dfd8779cc9b3707fea5a3.tar.xz
kernel-qcow2-linux-b685d3d65ac791406e0dfd8779cc9b3707fea5a3.zip
block: treat REQ_FUA and REQ_PREFLUSH as synchronous
Instead of requiring everyone to specify the REQ_SYNC flag aѕ well. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'include/linux/blk_types.h')
-rw-r--r--include/linux/blk_types.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/include/linux/blk_types.h b/include/linux/blk_types.h
index 3fa62cabe8d2..107d23d18096 100644
--- a/include/linux/blk_types.h
+++ b/include/linux/blk_types.h
@@ -216,9 +216,15 @@ static inline bool op_is_write(unsigned int op)
return (op & 1);
}
+/*
+ * Reads are always treated as synchronous, as are requests with the FUA or
+ * PREFLUSH flag. Other operations may be marked as synchronous using the
+ * REQ_SYNC flag.
+ */
static inline bool op_is_sync(unsigned int op)
{
- return (op & REQ_OP_MASK) == REQ_OP_READ || (op & REQ_SYNC);
+ return (op & REQ_OP_MASK) == REQ_OP_READ ||
+ (op & (REQ_SYNC | REQ_FUA | REQ_PREFLUSH));
}
typedef unsigned int blk_qc_t;