aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-10-18 14:53:51 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-10-18 14:53:51 -0400
commitd3dc366bbaf07c125561e90d6da4bb147741101a (patch)
tree6eb7e79a8ec9df1fa705393c6d15ccea3d104661 /drivers/block
parent511c41d9e6665a07aca94eb00983cf6d77dd87ff (diff)
parente19a8a0ad2d255316830ead05b59c5a704434cbb (diff)
Merge branch 'for-3.18/core' of git://git.kernel.dk/linux-block
Pull core block layer changes from Jens Axboe: "This is the core block IO pull request for 3.18. Apart from the new and improved flush machinery for blk-mq, this is all mostly bug fixes and cleanups. - blk-mq timeout updates and fixes from Christoph. - Removal of REQ_END, also from Christoph. We pass it through the ->queue_rq() hook for blk-mq instead, freeing up one of the request bits. The space was overly tight on 32-bit, so Martin also killed REQ_KERNEL since it's no longer used. - blk integrity updates and fixes from Martin and Gu Zheng. - Update to the flush machinery for blk-mq from Ming Lei. Now we have a per hardware context flush request, which both cleans up the code should scale better for flush intensive workloads on blk-mq. - Improve the error printing, from Rob Elliott. - Backing device improvements and cleanups from Tejun. - Fixup of a misplaced rq_complete() tracepoint from Hannes. - Make blk_get_request() return error pointers, fixing up issues where we NULL deref when a device goes bad or missing. From Joe Lawrence. - Prep work for drastically reducing the memory consumption of dm devices from Junichi Nomura. This allows creating clone bio sets without preallocating a lot of memory. - Fix a blk-mq hang on certain combinations of queue depths and hardware queues from me. - Limit memory consumption for blk-mq devices for crash dump scenarios and drivers that use crazy high depths (certain SCSI shared tag setups). We now just use a single queue and limited depth for that" * 'for-3.18/core' of git://git.kernel.dk/linux-block: (58 commits) block: Remove REQ_KERNEL blk-mq: allocate cpumask on the home node bio-integrity: remove the needless fail handle of bip_slab creating block: include func name in __get_request prints block: make blk_update_request print prefix match ratelimited prefix blk-merge: don't compute bi_phys_segments from bi_vcnt for cloned bio block: fix alignment_offset math that assumes io_min is a power-of-2 blk-mq: Make bt_clear_tag() easier to read blk-mq: fix potential hang if rolling wakeup depth is too high block: add bioset_create_nobvec() block: use bio_clone_fast() in blk_rq_prep_clone() block: misplaced rq_complete tracepoint sd: Honor block layer integrity handling flags block: Replace strnicmp with strncasecmp block: Add T10 Protection Information functions block: Don't merge requests if integrity flags differ block: Integrity checksum flag block: Relocate bio integrity flags block: Add a disk flag to block integrity profile block: Add prefix to block integrity profile flags ...
Diffstat (limited to 'drivers/block')
-rw-r--r--drivers/block/mtip32xx/mtip32xx.c9
-rw-r--r--drivers/block/null_blk.c7
-rw-r--r--drivers/block/paride/pd.c2
-rw-r--r--drivers/block/pktcdvd.c2
-rw-r--r--drivers/block/sx8.c2
-rw-r--r--drivers/block/virtio_blk.c8
6 files changed, 21 insertions, 9 deletions
diff --git a/drivers/block/mtip32xx/mtip32xx.c b/drivers/block/mtip32xx/mtip32xx.c
index 5c8e7fe07745..6b7e8d0fba99 100644
--- a/drivers/block/mtip32xx/mtip32xx.c
+++ b/drivers/block/mtip32xx/mtip32xx.c
@@ -247,7 +247,7 @@ static void mtip_async_complete(struct mtip_port *port,
247 if (unlikely(cmd->unaligned)) 247 if (unlikely(cmd->unaligned))
248 up(&port->cmd_slot_unal); 248 up(&port->cmd_slot_unal);
249 249
250 blk_mq_end_io(rq, status ? -EIO : 0); 250 blk_mq_end_request(rq, status ? -EIO : 0);
251} 251}
252 252
253/* 253/*
@@ -3739,7 +3739,7 @@ static int mtip_submit_request(struct blk_mq_hw_ctx *hctx, struct request *rq)
3739 int err; 3739 int err;
3740 3740
3741 err = mtip_send_trim(dd, blk_rq_pos(rq), blk_rq_sectors(rq)); 3741 err = mtip_send_trim(dd, blk_rq_pos(rq), blk_rq_sectors(rq));
3742 blk_mq_end_io(rq, err); 3742 blk_mq_end_request(rq, err);
3743 return 0; 3743 return 0;
3744 } 3744 }
3745 3745
@@ -3775,13 +3775,16 @@ static bool mtip_check_unal_depth(struct blk_mq_hw_ctx *hctx,
3775 return false; 3775 return false;
3776} 3776}
3777 3777
3778static int mtip_queue_rq(struct blk_mq_hw_ctx *hctx, struct request *rq) 3778static int mtip_queue_rq(struct blk_mq_hw_ctx *hctx, struct request *rq,
3779 bool last)
3779{ 3780{
3780 int ret; 3781 int ret;
3781 3782
3782 if (unlikely(mtip_check_unal_depth(hctx, rq))) 3783 if (unlikely(mtip_check_unal_depth(hctx, rq)))
3783 return BLK_MQ_RQ_QUEUE_BUSY; 3784 return BLK_MQ_RQ_QUEUE_BUSY;
3784 3785
3786 blk_mq_start_request(rq);
3787
3785 ret = mtip_submit_request(hctx, rq); 3788 ret = mtip_submit_request(hctx, rq);
3786 if (likely(!ret)) 3789 if (likely(!ret))
3787 return BLK_MQ_RQ_QUEUE_OK; 3790 return BLK_MQ_RQ_QUEUE_OK;
diff --git a/drivers/block/null_blk.c b/drivers/block/null_blk.c
index 00d469c7f9f7..ac50a2931044 100644
--- a/drivers/block/null_blk.c
+++ b/drivers/block/null_blk.c
@@ -177,7 +177,7 @@ static void end_cmd(struct nullb_cmd *cmd)
177{ 177{
178 switch (queue_mode) { 178 switch (queue_mode) {
179 case NULL_Q_MQ: 179 case NULL_Q_MQ:
180 blk_mq_end_io(cmd->rq, 0); 180 blk_mq_end_request(cmd->rq, 0);
181 return; 181 return;
182 case NULL_Q_RQ: 182 case NULL_Q_RQ:
183 INIT_LIST_HEAD(&cmd->rq->queuelist); 183 INIT_LIST_HEAD(&cmd->rq->queuelist);
@@ -313,13 +313,16 @@ static void null_request_fn(struct request_queue *q)
313 } 313 }
314} 314}
315 315
316static int null_queue_rq(struct blk_mq_hw_ctx *hctx, struct request *rq) 316static int null_queue_rq(struct blk_mq_hw_ctx *hctx, struct request *rq,
317 bool last)
317{ 318{
318 struct nullb_cmd *cmd = blk_mq_rq_to_pdu(rq); 319 struct nullb_cmd *cmd = blk_mq_rq_to_pdu(rq);
319 320
320 cmd->rq = rq; 321 cmd->rq = rq;
321 cmd->nq = hctx->driver_data; 322 cmd->nq = hctx->driver_data;
322 323
324 blk_mq_start_request(rq);
325
323 null_handle_cmd(cmd); 326 null_handle_cmd(cmd);
324 return BLK_MQ_RQ_QUEUE_OK; 327 return BLK_MQ_RQ_QUEUE_OK;
325} 328}
diff --git a/drivers/block/paride/pd.c b/drivers/block/paride/pd.c
index fea7e76a00de..d48715b287e6 100644
--- a/drivers/block/paride/pd.c
+++ b/drivers/block/paride/pd.c
@@ -722,6 +722,8 @@ static int pd_special_command(struct pd_unit *disk,
722 int err = 0; 722 int err = 0;
723 723
724 rq = blk_get_request(disk->gd->queue, READ, __GFP_WAIT); 724 rq = blk_get_request(disk->gd->queue, READ, __GFP_WAIT);
725 if (IS_ERR(rq))
726 return PTR_ERR(rq);
725 727
726 rq->cmd_type = REQ_TYPE_SPECIAL; 728 rq->cmd_type = REQ_TYPE_SPECIAL;
727 rq->special = func; 729 rq->special = func;
diff --git a/drivers/block/pktcdvd.c b/drivers/block/pktcdvd.c
index 758ac442c5b5..09e628dafd9d 100644
--- a/drivers/block/pktcdvd.c
+++ b/drivers/block/pktcdvd.c
@@ -704,6 +704,8 @@ static int pkt_generic_packet(struct pktcdvd_device *pd, struct packet_command *
704 704
705 rq = blk_get_request(q, (cgc->data_direction == CGC_DATA_WRITE) ? 705 rq = blk_get_request(q, (cgc->data_direction == CGC_DATA_WRITE) ?
706 WRITE : READ, __GFP_WAIT); 706 WRITE : READ, __GFP_WAIT);
707 if (IS_ERR(rq))
708 return PTR_ERR(rq);
707 blk_rq_set_block_pc(rq); 709 blk_rq_set_block_pc(rq);
708 710
709 if (cgc->buflen) { 711 if (cgc->buflen) {
diff --git a/drivers/block/sx8.c b/drivers/block/sx8.c
index d5e2d12b9d9e..5d552857de41 100644
--- a/drivers/block/sx8.c
+++ b/drivers/block/sx8.c
@@ -568,7 +568,7 @@ static struct carm_request *carm_get_special(struct carm_host *host)
568 return NULL; 568 return NULL;
569 569
570 rq = blk_get_request(host->oob_q, WRITE /* bogus */, GFP_KERNEL); 570 rq = blk_get_request(host->oob_q, WRITE /* bogus */, GFP_KERNEL);
571 if (!rq) { 571 if (IS_ERR(rq)) {
572 spin_lock_irqsave(&host->lock, flags); 572 spin_lock_irqsave(&host->lock, flags);
573 carm_put_request(host, crq); 573 carm_put_request(host, crq);
574 spin_unlock_irqrestore(&host->lock, flags); 574 spin_unlock_irqrestore(&host->lock, flags);
diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c
index 930fee886917..c6a27d54ad62 100644
--- a/drivers/block/virtio_blk.c
+++ b/drivers/block/virtio_blk.c
@@ -129,7 +129,7 @@ static inline void virtblk_request_done(struct request *req)
129 req->errors = (error != 0); 129 req->errors = (error != 0);
130 } 130 }
131 131
132 blk_mq_end_io(req, error); 132 blk_mq_end_request(req, error);
133} 133}
134 134
135static void virtblk_done(struct virtqueue *vq) 135static void virtblk_done(struct virtqueue *vq)
@@ -158,14 +158,14 @@ static void virtblk_done(struct virtqueue *vq)
158 spin_unlock_irqrestore(&vblk->vqs[qid].lock, flags); 158 spin_unlock_irqrestore(&vblk->vqs[qid].lock, flags);
159} 159}
160 160
161static int virtio_queue_rq(struct blk_mq_hw_ctx *hctx, struct request *req) 161static int virtio_queue_rq(struct blk_mq_hw_ctx *hctx, struct request *req,
162 bool last)
162{ 163{
163 struct virtio_blk *vblk = hctx->queue->queuedata; 164 struct virtio_blk *vblk = hctx->queue->queuedata;
164 struct virtblk_req *vbr = blk_mq_rq_to_pdu(req); 165 struct virtblk_req *vbr = blk_mq_rq_to_pdu(req);
165 unsigned long flags; 166 unsigned long flags;
166 unsigned int num; 167 unsigned int num;
167 int qid = hctx->queue_num; 168 int qid = hctx->queue_num;
168 const bool last = (req->cmd_flags & REQ_END) != 0;
169 int err; 169 int err;
170 bool notify = false; 170 bool notify = false;
171 171
@@ -199,6 +199,8 @@ static int virtio_queue_rq(struct blk_mq_hw_ctx *hctx, struct request *req)
199 } 199 }
200 } 200 }
201 201
202 blk_mq_start_request(req);
203
202 num = blk_rq_map_sg(hctx->queue, vbr->req, vbr->sg); 204 num = blk_rq_map_sg(hctx->queue, vbr->req, vbr->sg);
203 if (num) { 205 if (num) {
204 if (rq_data_dir(vbr->req) == WRITE) 206 if (rq_data_dir(vbr->req) == WRITE)