mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-04-28 01:58:08 -04:00
block, drivers: add REQ_OP_FLUSH operation
This adds a REQ_OP_FLUSH operation that is sent to request_fn based drivers by the block layer's flush code, instead of sending requests with the request->cmd_flags REQ_FLUSH bit set. Signed-off-by: Mike Christie <mchristi@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Hannes Reinecke <hare@suse.com> Signed-off-by: Jens Axboe <axboe@fb.com>
This commit is contained in:
committed by
Jens Axboe
parent
4e1b2d52a8
commit
3a5e02ced1
@@ -249,9 +249,10 @@ enum req_op {
|
||||
REQ_OP_WRITE,
|
||||
REQ_OP_DISCARD, /* request to discard sectors */
|
||||
REQ_OP_WRITE_SAME, /* write same block many times */
|
||||
REQ_OP_FLUSH, /* request for cache flush */
|
||||
};
|
||||
|
||||
#define REQ_OP_BITS 2
|
||||
#define REQ_OP_BITS 3
|
||||
|
||||
typedef unsigned int blk_qc_t;
|
||||
#define BLK_QC_T_NONE -1U
|
||||
|
||||
@@ -666,6 +666,9 @@ static inline bool rq_mergeable(struct request *rq)
|
||||
if (rq->cmd_type != REQ_TYPE_FS)
|
||||
return false;
|
||||
|
||||
if (req_op(rq) == REQ_OP_FLUSH)
|
||||
return false;
|
||||
|
||||
if (rq->cmd_flags & REQ_NOMERGE_FLAGS)
|
||||
return false;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user