summaryrefslogtreecommitdiff
path: root/block
diff options
context:
space:
mode:
authorMike Christie <mchristi@redhat.com>2016-06-05 22:32:15 +0300
committerJens Axboe <axboe@fb.com>2016-06-07 22:41:38 +0300
commit8fe0d473f5477e9916d3ac581a226acfe83142be (patch)
treea433795d1ad57cd0b2fdf64e6d3b7ae579abfd78 /block
parent63a4cc24867de73626e16767ce616c50dc5438d3 (diff)
downloadlinux-8fe0d473f5477e9916d3ac581a226acfe83142be.tar.xz
block: convert merge/insert code to check for REQ_OPs.
This patch converts the block layer merging code to use separate variables for the operation and flags, and to check req_op for the REQ_OP. 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>
Diffstat (limited to 'block')
-rw-r--r--block/blk-core.c2
-rw-r--r--block/blk-merge.c10
2 files changed, 7 insertions, 5 deletions
diff --git a/block/blk-core.c b/block/blk-core.c
index 090e55d7cad7..1333bb764b28 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -2161,7 +2161,7 @@ EXPORT_SYMBOL(submit_bio);
static int blk_cloned_rq_check_limits(struct request_queue *q,
struct request *rq)
{
- if (blk_rq_sectors(rq) > blk_queue_get_max_sectors(q, rq->cmd_flags)) {
+ if (blk_rq_sectors(rq) > blk_queue_get_max_sectors(q, req_op(rq))) {
printk(KERN_ERR "%s: over max size limit.\n", __func__);
return -EIO;
}
diff --git a/block/blk-merge.c b/block/blk-merge.c
index 5a03f967557a..c265348b75d1 100644
--- a/block/blk-merge.c
+++ b/block/blk-merge.c
@@ -649,7 +649,8 @@ static int attempt_merge(struct request_queue *q, struct request *req,
if (!rq_mergeable(req) || !rq_mergeable(next))
return 0;
- if (!blk_check_merge_flags(req->cmd_flags, next->cmd_flags))
+ if (!blk_check_merge_flags(req->cmd_flags, req_op(req), next->cmd_flags,
+ req_op(next)))
return 0;
/*
@@ -663,7 +664,7 @@ static int attempt_merge(struct request_queue *q, struct request *req,
|| req_no_special_merge(next))
return 0;
- if (req->cmd_flags & REQ_WRITE_SAME &&
+ if (req_op(req) == REQ_OP_WRITE_SAME &&
!blk_write_same_mergeable(req->bio, next->bio))
return 0;
@@ -751,7 +752,8 @@ bool blk_rq_merge_ok(struct request *rq, struct bio *bio)
if (!rq_mergeable(rq) || !bio_mergeable(bio))
return false;
- if (!blk_check_merge_flags(rq->cmd_flags, bio->bi_rw))
+ if (!blk_check_merge_flags(rq->cmd_flags, req_op(rq), bio->bi_rw,
+ bio_op(bio)))
return false;
/* different data direction or already started, don't merge */
@@ -767,7 +769,7 @@ bool blk_rq_merge_ok(struct request *rq, struct bio *bio)
return false;
/* must be using the same buffer */
- if (rq->cmd_flags & REQ_WRITE_SAME &&
+ if (req_op(rq) == REQ_OP_WRITE_SAME &&
!blk_write_same_mergeable(rq->bio, bio))
return false;