From: Linus Torvalds <torvalds@linux-foundation.org>
Date: Sat, 16 Nov 2013 00:33:41 +0000 (-0800)
Subject: Merge branch 'for-linus' of git://git.kernel.dk/linux-block
X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=f412f2c60b480fa5140a4b4cb321cd48c64e1812;p=openwrt%2Fstaging%2Fblogic.git

Merge branch 'for-linus' of git://git.kernel.dk/linux-block

Pull second round of block driver updates from Jens Axboe:
 "As mentioned in the original pull request, the bcache bits were pulled
  because of their dependency on the immutable bio vecs.  Kent re-did
  this part and resubmitted it, so here's the 2nd round of (mostly)
  driver updates for 3.13.  It contains:

 - The bcache work from Kent.

 - Conversion of virtio-blk to blk-mq.  This removes the bio and request
   path, and substitutes with the blk-mq path instead.  The end result
   almost 200 deleted lines.  Patch is acked by Asias and Christoph, who
   both did a bunch of testing.

 - A removal of bootmem.h include from Grygorii Strashko, part of a
   larger series of his killing the dependency on that header file.

 - Removal of __cpuinit from blk-mq from Paul Gortmaker"

* 'for-linus' of git://git.kernel.dk/linux-block: (56 commits)
  virtio_blk: blk-mq support
  blk-mq: remove newly added instances of __cpuinit
  bcache: defensively handle format strings
  bcache: Bypass torture test
  bcache: Delete some slower inline asm
  bcache: Use ida for bcache block dev minor
  bcache: Fix sysfs splat on shutdown with flash only devs
  bcache: Better full stripe scanning
  bcache: Have btree_split() insert into parent directly
  bcache: Move spinlock into struct time_stats
  bcache: Kill sequential_merge option
  bcache: Kill bch_next_recurse_key()
  bcache: Avoid deadlocking in garbage collection
  bcache: Incremental gc
  bcache: Add make_btree_freeing_key()
  bcache: Add btree_node_write_sync()
  bcache: PRECEDING_KEY()
  bcache: bch_(btree|extent)_ptr_invalid()
  bcache: Don't bother with bucket refcount for btree node allocations
  bcache: Debug code improvements
  ...
---

f412f2c60b480fa5140a4b4cb321cd48c64e1812
diff --cc drivers/block/virtio_blk.c
index f3be496ac8fa,7455fe24bbbe..588479d58f52
--- a/drivers/block/virtio_blk.c
+++ b/drivers/block/virtio_blk.c
@@@ -284,39 -138,28 +138,30 @@@ static void virtblk_done(struct virtque
  	do {
  		virtqueue_disable_cb(vq);
  		while ((vbr = virtqueue_get_buf(vblk->vq, &len)) != NULL) {
- 			if (vbr->bio) {
- 				virtblk_bio_done(vbr);
- 				bio_done = true;
- 			} else {
- 				virtblk_request_done(vbr);
- 				req_done = true;
- 			}
+ 			virtblk_request_done(vbr);
+ 			req_done = true;
  		}
 +		if (unlikely(virtqueue_is_broken(vq)))
 +			break;
  	} while (!virtqueue_enable_cb(vq));
+ 	spin_unlock_irqrestore(&vblk->vq_lock, flags);
+ 
  	/* In case queue is stopped waiting for more buffers. */
  	if (req_done)
- 		blk_start_queue(vblk->disk->queue);
- 	spin_unlock_irqrestore(vblk->disk->queue->queue_lock, flags);
- 
- 	if (bio_done)
- 		wake_up(&vblk->queue_wait);
+ 		blk_mq_start_stopped_hw_queues(vblk->disk->queue);
  }
  
- static bool do_req(struct request_queue *q, struct virtio_blk *vblk,
- 		   struct request *req)
+ static int virtio_queue_rq(struct blk_mq_hw_ctx *hctx, struct request *req)
  {
+ 	struct virtio_blk *vblk = hctx->queue->queuedata;
+ 	struct virtblk_req *vbr = req->special;
+ 	unsigned long flags;
  	unsigned int num;
- 	struct virtblk_req *vbr;
+ 	const bool last = (req->cmd_flags & REQ_END) != 0;
  
- 	vbr = virtblk_alloc_req(vblk, GFP_ATOMIC);
- 	if (!vbr)
- 		/* When another request finishes we'll try again. */
- 		return false;
+ 	BUG_ON(req->nr_phys_segments + 2 > vblk->sg_elems);
  
  	vbr->req = req;
- 	vbr->bio = NULL;
  	if (req->cmd_flags & REQ_FLUSH) {
  		vbr->out_hdr.type = VIRTIO_BLK_T_FLUSH;
  		vbr->out_hdr.sector = 0;