diff options
| author | Christoph Hellwig <[email protected]> | 2017-01-27 08:30:47 -0700 |
|---|---|---|
| committer | Jens Axboe <[email protected]> | 2017-01-27 09:01:45 -0700 |
| commit | f73f44eb00cb136990cfb7d40e436c13d7669ec8 (patch) | |
| tree | e0a5cc16d9373eec0346538fe073f0c0b08133bf /include | |
| parent | c13660a08c8b3bb49def4374bfd414aaaa564662 (diff) | |
block: add a op_is_flush helper
This centralizes the checks for bios that needs to be go into the flush
state machine.
Signed-off-by: Christoph Hellwig <[email protected]>
Reviewed-by: Martin K. Petersen <[email protected]>
Reviewed-by: Bart Van Assche <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/blk_types.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/linux/blk_types.h b/include/linux/blk_types.h index 0e5b1cd5113c..37c9a43c5e78 100644 --- a/include/linux/blk_types.h +++ b/include/linux/blk_types.h @@ -221,6 +221,15 @@ static inline bool op_is_write(unsigned int op) } /* + * Check if the bio or request is one that needs special treatment in the + * flush state machine. + */ +static inline bool op_is_flush(unsigned int op) +{ + return op & (REQ_FUA | REQ_PREFLUSH); +} + +/* * 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. |