summaryrefslogtreecommitdiffstats
path: root/drivers/block/xen-blkfront.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2016-07-26 18:37:51 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2016-07-26 18:37:51 -0400
commit3fc9d690936fb2e20e180710965ba2cc3a0881f8 (patch)
treeeaf4d9f788ee4d17cd40a116413873b7f80f9aa7 /drivers/block/xen-blkfront.c
parentd05d7f40791ccbb6e543cc5dd6a6aa08fc71d635 (diff)
parent13880f5b57adf34d050cf7e229a6326da45a7347 (diff)
Merge branch 'for-4.8/drivers' of git://git.kernel.dk/linux-block
Pull block driver updates from Jens Axboe: "This branch also contains core changes. I've come to the conclusion that from 4.9 and forward, I'll be doing just a single branch. We often have dependencies between core and drivers, and it's hard to always split them up appropriately without pulling core into drivers when that happens. That said, this contains: - separate secure erase type for the core block layer, from Christoph. - set of discard fixes, from Christoph. - bio shrinking fixes from Christoph, as a followup up to the op/flags change in the core branch. - map and append request fixes from Christoph. - NVMeF (NVMe over Fabrics) code from Christoph. This is pretty exciting! - nvme-loop fixes from Arnd. - removal of ->driverfs_dev from Dan, after providing a device_add_disk() helper. - bcache fixes from Bhaktipriya and Yijing. - cdrom subchannel read fix from Vchannaiah. - set of lightnvm updates from Wenwei, Matias, Johannes, and Javier. - set of drbd updates and fixes from Fabian, Lars, and Philipp. - mg_disk error path fix from Bart. - user notification for failed device add for loop, from Minfei. - NVMe in general: + NVMe delay quirk from Guilherme. + SR-IOV support and command retry limits from Keith. + fix for memory-less NUMA node from Masayoshi. + use UINT_MAX for discard sectors, from Minfei. + cancel IO fixes from Ming. + don't allocate unused major, from Neil. + error code fixup from Dan. + use constants for PSDT/FUSE from James. + variable init fix from Jay. + fabrics fixes from Ming, Sagi, and Wei. + various fixes" * 'for-4.8/drivers' of git://git.kernel.dk/linux-block: (115 commits) nvme/pci: Provide SR-IOV support nvme: initialize variable before logical OR'ing it block: unexport various bio mapping helpers scsi/osd: open code blk_make_request target: stop using blk_make_request block: simplify and export blk_rq_append_bio block: ensure bios return from blk_get_request are properly initialized virtio_blk: use blk_rq_map_kern memstick: don't allow REQ_TYPE_BLOCK_PC requests block: shrink bio size again block: simplify and cleanup bvec pool handling block: get rid of bio_rw and READA block: don't ignore -EOPNOTSUPP blkdev_issue_write_same block: introduce BLKDEV_DISCARD_ZERO to fix zeroout NVMe: don't allocate unused nvme_major nvme: avoid crashes when node 0 is memoryless node. nvme: Limit command retries loop: Make user notify for adding loop device failed nvme-loop: fix nvme-loop Kconfig dependencies nvmet: fix return value check in nvmet_subsys_alloc() ...
Diffstat (limited to 'drivers/block/xen-blkfront.c')
-rw-r--r--drivers/block/xen-blkfront.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c
index da05d3f9bad2..0b6682a33e3b 100644
--- a/drivers/block/xen-blkfront.c
+++ b/drivers/block/xen-blkfront.c
@@ -548,7 +548,7 @@ static int blkif_queue_discard_req(struct request *req, struct blkfront_ring_inf
548 ring_req->u.discard.nr_sectors = blk_rq_sectors(req); 548 ring_req->u.discard.nr_sectors = blk_rq_sectors(req);
549 ring_req->u.discard.id = id; 549 ring_req->u.discard.id = id;
550 ring_req->u.discard.sector_number = (blkif_sector_t)blk_rq_pos(req); 550 ring_req->u.discard.sector_number = (blkif_sector_t)blk_rq_pos(req);
551 if ((req->cmd_flags & REQ_SECURE) && info->feature_secdiscard) 551 if (req_op(req) == REQ_OP_SECURE_ERASE && info->feature_secdiscard)
552 ring_req->u.discard.flag = BLKIF_DISCARD_SECURE; 552 ring_req->u.discard.flag = BLKIF_DISCARD_SECURE;
553 else 553 else
554 ring_req->u.discard.flag = 0; 554 ring_req->u.discard.flag = 0;
@@ -844,7 +844,7 @@ static int blkif_queue_request(struct request *req, struct blkfront_ring_info *r
844 return 1; 844 return 1;
845 845
846 if (unlikely(req_op(req) == REQ_OP_DISCARD || 846 if (unlikely(req_op(req) == REQ_OP_DISCARD ||
847 req->cmd_flags & REQ_SECURE)) 847 req_op(req) == REQ_OP_SECURE_ERASE))
848 return blkif_queue_discard_req(req, rinfo); 848 return blkif_queue_discard_req(req, rinfo);
849 else 849 else
850 return blkif_queue_rw_req(req, rinfo); 850 return blkif_queue_rw_req(req, rinfo);
@@ -952,7 +952,7 @@ static int xlvbd_init_blk_queue(struct gendisk *gd, u16 sector_size,
952 rq->limits.discard_granularity = info->discard_granularity; 952 rq->limits.discard_granularity = info->discard_granularity;
953 rq->limits.discard_alignment = info->discard_alignment; 953 rq->limits.discard_alignment = info->discard_alignment;
954 if (info->feature_secdiscard) 954 if (info->feature_secdiscard)
955 queue_flag_set_unlocked(QUEUE_FLAG_SECDISCARD, rq); 955 queue_flag_set_unlocked(QUEUE_FLAG_SECERASE, rq);
956 } 956 }
957 957
958 /* Hard sector size and max sectors impersonate the equiv. hardware. */ 958 /* Hard sector size and max sectors impersonate the equiv. hardware. */
@@ -1134,7 +1134,6 @@ static int xlvbd_alloc_gendisk(blkif_sector_t capacity,
1134 gd->first_minor = minor; 1134 gd->first_minor = minor;
1135 gd->fops = &xlvbd_block_fops; 1135 gd->fops = &xlvbd_block_fops;
1136 gd->private_data = info; 1136 gd->private_data = info;
1137 gd->driverfs_dev = &(info->xbdev->dev);
1138 set_capacity(gd, capacity); 1137 set_capacity(gd, capacity);
1139 1138
1140 if (xlvbd_init_blk_queue(gd, sector_size, physical_sector_size, 1139 if (xlvbd_init_blk_queue(gd, sector_size, physical_sector_size,
@@ -1592,7 +1591,7 @@ static irqreturn_t blkif_interrupt(int irq, void *dev_id)
1592 info->feature_discard = 0; 1591 info->feature_discard = 0;
1593 info->feature_secdiscard = 0; 1592 info->feature_secdiscard = 0;
1594 queue_flag_clear(QUEUE_FLAG_DISCARD, rq); 1593 queue_flag_clear(QUEUE_FLAG_DISCARD, rq);
1595 queue_flag_clear(QUEUE_FLAG_SECDISCARD, rq); 1594 queue_flag_clear(QUEUE_FLAG_SECERASE, rq);
1596 } 1595 }
1597 blk_mq_complete_request(req, error); 1596 blk_mq_complete_request(req, error);
1598 break; 1597 break;
@@ -2106,11 +2105,14 @@ static int blkfront_resume(struct xenbus_device *dev)
2106 */ 2105 */
2107 if (req_op(shadow[i].request) == REQ_OP_FLUSH || 2106 if (req_op(shadow[i].request) == REQ_OP_FLUSH ||
2108 req_op(shadow[i].request) == REQ_OP_DISCARD || 2107 req_op(shadow[i].request) == REQ_OP_DISCARD ||
2109 shadow[j].request->cmd_flags & (REQ_FUA | REQ_SECURE)) { 2108 req_op(shadow[i].request) == REQ_OP_SECURE_ERASE ||
2110 2109 shadow[j].request->cmd_flags & REQ_FUA) {
2111 /* 2110 /*
2112 * Flush operations don't contain bios, so 2111 * Flush operations don't contain bios, so
2113 * we need to requeue the whole request 2112 * we need to requeue the whole request
2113 *
2114 * XXX: but this doesn't make any sense for a
2115 * write with the FUA flag set..
2114 */ 2116 */
2115 list_add(&shadow[j].request->queuelist, &info->requests); 2117 list_add(&shadow[j].request->queuelist, &info->requests);
2116 continue; 2118 continue;
@@ -2445,7 +2447,7 @@ static void blkfront_connect(struct blkfront_info *info)
2445 for (i = 0; i < info->nr_rings; i++) 2447 for (i = 0; i < info->nr_rings; i++)
2446 kick_pending_request_queues(&info->rinfo[i]); 2448 kick_pending_request_queues(&info->rinfo[i]);
2447 2449
2448 add_disk(info->gd); 2450 device_add_disk(&info->xbdev->dev, info->gd);
2449 2451
2450 info->is_ready = 1; 2452 info->is_ready = 1;
2451} 2453}