* linux-next: manual merge of the block tree with the rr tree
@ 2010-07-06 4:25 Stephen Rothwell
0 siblings, 0 replies; 2+ messages in thread
From: Stephen Rothwell @ 2010-07-06 4:25 UTC (permalink / raw)
To: Jens Axboe
Cc: linux-next, linux-kernel, Christoph Hellwig, Rusty Russell,
FUJITA Tomonori
Hi Jens,
Today's linux-next merge of the block tree got a conflict in
drivers/block/virtio_blk.c between commit
0e41b2d3ea0f5bf472a2b163c54305f62ab7b776 ("virtio_blk: support barriers
without FLUSH feature") from the rr tree and commits
3789fdefa13bcaa7ad06d952ac6010f0a81bf04e ("virtio_blk: stop using
q->prepare_flush_fn") and 5e27e27e73b5bff903b3c30ffd5a0e17eb95c087
("block: remove q->prepare_flush_fn completely") from the block tree.
I fixed it up (see below) and can carry the fix as necessary.
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
diff --cc drivers/block/virtio_blk.c
index 23b7c48,0a3222f..0000000
--- a/drivers/block/virtio_blk.c
+++ b/drivers/block/virtio_blk.c
@@@ -377,32 -364,11 +375,31 @@@ static int __devinit virtblk_probe(stru
vblk->disk->driverfs_dev = &vdev->dev;
index++;
- /* If barriers are supported, tell block layer that queue is ordered */
- if (virtio_has_feature(vdev, VIRTIO_BLK_F_FLUSH))
+ if (virtio_has_feature(vdev, VIRTIO_BLK_F_FLUSH)) {
+ /*
+ * If the FLUSH feature is supported we do have support for
+ * flushing a volatile write cache on the host. Use that
+ * to implement write barrier support.
+ */
- blk_queue_ordered(q, QUEUE_ORDERED_DRAIN_FLUSH,
- virtblk_prepare_flush);
+ blk_queue_ordered(q, QUEUE_ORDERED_DRAIN_FLUSH);
- else if (virtio_has_feature(vdev, VIRTIO_BLK_F_BARRIER))
+ } else if (virtio_has_feature(vdev, VIRTIO_BLK_F_BARRIER)) {
+ /*
+ * If the BARRIER feature is supported the host expects us
+ * to order request by tags. This implies there is not
+ * volatile write cache on the host, and that the host
+ * never re-orders outstanding I/O. This feature is not
+ * useful for real life scenarious and deprecated.
+ */
- blk_queue_ordered(q, QUEUE_ORDERED_TAG, NULL);
+ blk_queue_ordered(q, QUEUE_ORDERED_TAG);
+ } else {
+ /*
+ * If the FLUSH feature is not supported we must assume that
+ * the host does not perform any kind of volatile write
+ * caching. We still need to drain the queue to provider
+ * proper barrier semantics.
+ */
- blk_queue_ordered(q, QUEUE_ORDERED_DRAIN, NULL);
++ blk_queue_ordered(q, QUEUE_ORDERED_DRAIN);
+ }
/* If disk is read-only in the host, the guest should obey */
if (virtio_has_feature(vdev, VIRTIO_BLK_F_RO))
^ permalink raw reply [flat|nested] 2+ messages in thread* linux-next: manual merge of the block tree with the rr tree
@ 2009-06-09 5:09 Stephen Rothwell
0 siblings, 0 replies; 2+ messages in thread
From: Stephen Rothwell @ 2009-06-09 5:09 UTC (permalink / raw)
To: Jens Axboe
Cc: linux-next, linux-kernel, Hannes Reinecke, john cooper, Rusty Russell
Hi Jens,
Today's linux-next merge of the block tree got conflicts in
drivers/block/virtio_blk.c and include/linux/virtio_blk.h between commit
a69a9b05d1050c24767d438bbe220157b7ff9250 ("Add serial number support for
virtio_blk, V4a") from the rr tree and commit
1cde26f928863d90e9e7c1217880c8450464d305 ("virtio_blk: SG_IO passthru
support") from the block tree.
I fixed it up (see below) and can carry the fix as necessary.
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
diff --cc drivers/block/virtio_blk.c
index ad8cb22,c4845b1..0000000
--- a/drivers/block/virtio_blk.c
+++ b/drivers/block/virtio_blk.c
@@@ -178,14 -175,16 +203,22 @@@ static int virtblk_ioctl(struct block_d
unsigned cmd, unsigned long data)
{
struct gendisk *disk = bdev->bd_disk;
+ void __user *argp = (void __user *)data;
+ struct virtio_blk *vblk = disk->private_data;
- /*
- * Only allow the generic SCSI ioctls if the host can support it.
- */
- if (!virtio_has_feature(vblk->vdev, VIRTIO_BLK_F_SCSI))
- return -ENOIOCTLCMD;
-
- return scsi_cmd_ioctl(disk->queue, disk, mode, cmd,
- (void __user *)data);
+ switch (cmd) {
+ case HDIO_GET_IDENTITY:
+ return virtblk_identify(disk, argp);
+ default:
++ /*
++ * Only allow the generic SCSI ioctls if the host
++ * can support it.
++ */
++ if (!virtio_has_feature(vblk->vdev, VIRTIO_BLK_F_SCSI))
++ return -ENOIOCTLCMD;
++
+ return scsi_cmd_ioctl(disk->queue, disk, mode, cmd, argp);
+ }
}
/* We provide getgeo only to please some old bootloader/partitioning tools */
@@@ -390,7 -390,7 +424,7 @@@ static struct virtio_device_id id_table
static unsigned int features[] = {
VIRTIO_BLK_F_BARRIER, VIRTIO_BLK_F_SEG_MAX, VIRTIO_BLK_F_SIZE_MAX,
VIRTIO_BLK_F_GEOMETRY, VIRTIO_BLK_F_RO, VIRTIO_BLK_F_BLK_SIZE,
- VIRTIO_BLK_F_IDENTIFY
- VIRTIO_BLK_F_SCSI,
++ VIRTIO_BLK_F_SCSI, VIRTIO_BLK_F_IDENTIFY,
};
static struct virtio_driver virtio_blk = {
diff --cc include/linux/virtio_blk.h
index eb470d5,4dbcbc1..0000000
--- a/include/linux/virtio_blk.h
+++ b/include/linux/virtio_blk.h
@@@ -15,9 -15,7 +15,10 @@@
#define VIRTIO_BLK_F_GEOMETRY 4 /* Legacy geometry available */
#define VIRTIO_BLK_F_RO 5 /* Disk is read-only */
#define VIRTIO_BLK_F_BLK_SIZE 6 /* Block size of disk is available*/
+ #define VIRTIO_BLK_F_SCSI 7 /* Supports scsi command passthru */
+#define VIRTIO_BLK_F_IDENTIFY 8 /* ATA IDENTIFY supported */
+
+#define VIRTIO_BLK_ID_BYTES (sizeof(__u16[256])) /* IDENTIFY DATA */
struct virtio_blk_config
{
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-07-06 4:26 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-07-06 4:25 linux-next: manual merge of the block tree with the rr tree Stephen Rothwell
-- strict thread matches above, loose matches on Subject: below --
2009-06-09 5:09 Stephen Rothwell
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®