blk-mq: remove REQ_END

Pass an explicit parameter for the last request in a batch to ->queue_rq
instead of using a request flag.  Besides being a cleaner and non-stateful
interface this is also required for the next patch, which fixes the blk-mq
I/O submission code to not start a time too early.

Signed-off-by: Christoph Hellwig <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
This commit is contained in:
Christoph Hellwig 2014-09-13 16:40:08 -07:00 • committed by Jens Axboe
commit bf57229745
7 changed files with 14 additions and 25 deletions

View file

@ -3775,7 +3775,8 @@ static bool mtip_check_unal_depth(struct blk_mq_hw_ctx *hctx,
return false;
}
static int mtip_queue_rq(struct blk_mq_hw_ctx *hctx, struct request *rq)
static int mtip_queue_rq(struct blk_mq_hw_ctx *hctx, struct request *rq,
bool last)
{
int ret;

View file

@ -313,7 +313,8 @@ static void null_request_fn(struct request_queue *q)
}
}
static int null_queue_rq(struct blk_mq_hw_ctx *hctx, struct request *rq)
static int null_queue_rq(struct blk_mq_hw_ctx *hctx, struct request *rq,
bool last)
{
struct nullb_cmd *cmd = blk_mq_rq_to_pdu(rq);

View file

@ -164,14 +164,14 @@ static void virtblk_done(struct virtqueue *vq)
spin_unlock_irqrestore(&vblk->vqs[qid].lock, flags);
}
static int virtio_queue_rq(struct blk_mq_hw_ctx *hctx, struct request *req)
static int virtio_queue_rq(struct blk_mq_hw_ctx *hctx, struct request *req,
bool last)
{
struct virtio_blk *vblk = hctx->queue->queuedata;
struct virtblk_req *vbr = blk_mq_rq_to_pdu(req);
unsigned long flags;
unsigned int num;
int qid = hctx->queue_num;
const bool last = (req->cmd_flags & REQ_END) != 0;
int err;
bool notify = false;