Upper layer (fs, etc.) may issue flush with something like:
bio_reset(bio, bdev, REQ_OP_FLUSH);
bio->bi_end_io = xxx;
submit_bio(bio);
op_is_flush(bio->bi_opf) should return true for this bio.
Signed-off-by: Song Liu <song@kernel.org>
---
include/linux/blk_types.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/include/linux/blk_types.h b/include/linux/blk_types.h
index d5c5e59ddbd2..338423da84ca 100644
--- a/include/linux/blk_types.h
+++ b/include/linux/blk_types.h
@@ -487,7 +487,8 @@ static inline bool op_is_write(blk_opf_t op)
*/
static inline bool op_is_flush(blk_opf_t op)
{
- return op & (REQ_FUA | REQ_PREFLUSH);
+ return op & (REQ_FUA | REQ_PREFLUSH) ||
+ (op & REQ_OP_MASK) == REQ_OP_FLUSH;
}
/*--
2.34.1