Commit 3225beaba05d4f06087593f5e903ce867b6e118a
1 parent
e95646c3ec
Exists in
master
and in
20 other branches
virtio_blk: Revert serial number support
This reverts "Add serial number support for virtio_blk, V4a". Turns out that virtio_pci, lguest and s/390 all have an 8 bit limit on virtio config space, so noone could ever use this. This is coming back later in a cleaner form. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Cc: john cooper <john.cooper@redhat.com> Cc: Jens Axboe <jens.axboe@oracle.com>
Showing 2 changed files with 3 additions and 38 deletions Side-by-side Diff
drivers/block/virtio_blk.c
... | ... | @@ -182,34 +182,6 @@ |
182 | 182 | vblk->vq->vq_ops->kick(vblk->vq); |
183 | 183 | } |
184 | 184 | |
185 | -/* return ATA identify data | |
186 | - */ | |
187 | -static int virtblk_identify(struct gendisk *disk, void *argp) | |
188 | -{ | |
189 | - struct virtio_blk *vblk = disk->private_data; | |
190 | - void *opaque; | |
191 | - int err = -ENOMEM; | |
192 | - | |
193 | - opaque = kmalloc(VIRTIO_BLK_ID_BYTES, GFP_KERNEL); | |
194 | - if (!opaque) | |
195 | - goto out; | |
196 | - | |
197 | - err = virtio_config_buf(vblk->vdev, VIRTIO_BLK_F_IDENTIFY, | |
198 | - offsetof(struct virtio_blk_config, identify), opaque, | |
199 | - VIRTIO_BLK_ID_BYTES); | |
200 | - | |
201 | - if (err) | |
202 | - goto out_kfree; | |
203 | - | |
204 | - if (copy_to_user(argp, opaque, VIRTIO_BLK_ID_BYTES)) | |
205 | - err = -EFAULT; | |
206 | - | |
207 | -out_kfree: | |
208 | - kfree(opaque); | |
209 | -out: | |
210 | - return err; | |
211 | -} | |
212 | - | |
213 | 185 | static void virtblk_prepare_flush(struct request_queue *q, struct request *req) |
214 | 186 | { |
215 | 187 | req->cmd_type = REQ_TYPE_LINUX_BLOCK; |
216 | 188 | |
217 | 189 | |
... | ... | @@ -221,18 +193,15 @@ |
221 | 193 | { |
222 | 194 | struct gendisk *disk = bdev->bd_disk; |
223 | 195 | struct virtio_blk *vblk = disk->private_data; |
224 | - void __user *argp = (void __user *)data; | |
225 | 196 | |
226 | - if (cmd == HDIO_GET_IDENTITY) | |
227 | - return virtblk_identify(disk, argp); | |
228 | - | |
229 | 197 | /* |
230 | 198 | * Only allow the generic SCSI ioctls if the host can support it. |
231 | 199 | */ |
232 | 200 | if (!virtio_has_feature(vblk->vdev, VIRTIO_BLK_F_SCSI)) |
233 | 201 | return -ENOTTY; |
234 | 202 | |
235 | - return scsi_cmd_ioctl(disk->queue, disk, mode, cmd, argp); | |
203 | + return scsi_cmd_ioctl(disk->queue, disk, mode, cmd, | |
204 | + (void __user *)data); | |
236 | 205 | } |
237 | 206 | |
238 | 207 | /* We provide getgeo only to please some old bootloader/partitioning tools */ |
... | ... | @@ -443,7 +412,7 @@ |
443 | 412 | static unsigned int features[] = { |
444 | 413 | VIRTIO_BLK_F_BARRIER, VIRTIO_BLK_F_SEG_MAX, VIRTIO_BLK_F_SIZE_MAX, |
445 | 414 | VIRTIO_BLK_F_GEOMETRY, VIRTIO_BLK_F_RO, VIRTIO_BLK_F_BLK_SIZE, |
446 | - VIRTIO_BLK_F_SCSI, VIRTIO_BLK_F_IDENTIFY, VIRTIO_BLK_F_FLUSH | |
415 | + VIRTIO_BLK_F_SCSI, VIRTIO_BLK_F_FLUSH | |
447 | 416 | }; |
448 | 417 | |
449 | 418 | /* |
include/linux/virtio_blk.h
... | ... | @@ -14,11 +14,8 @@ |
14 | 14 | #define VIRTIO_BLK_F_RO 5 /* Disk is read-only */ |
15 | 15 | #define VIRTIO_BLK_F_BLK_SIZE 6 /* Block size of disk is available*/ |
16 | 16 | #define VIRTIO_BLK_F_SCSI 7 /* Supports scsi command passthru */ |
17 | -#define VIRTIO_BLK_F_IDENTIFY 8 /* ATA IDENTIFY supported */ | |
18 | 17 | #define VIRTIO_BLK_F_FLUSH 9 /* Cache flush command support */ |
19 | 18 | |
20 | -#define VIRTIO_BLK_ID_BYTES (sizeof(__u16[256])) /* IDENTIFY DATA */ | |
21 | - | |
22 | 19 | struct virtio_blk_config { |
23 | 20 | /* The capacity (in 512-byte sectors). */ |
24 | 21 | __u64 capacity; |
... | ... | @@ -34,7 +31,6 @@ |
34 | 31 | } geometry; |
35 | 32 | /* block size of device (if VIRTIO_BLK_F_BLK_SIZE) */ |
36 | 33 | __u32 blk_size; |
37 | - __u8 identify[VIRTIO_BLK_ID_BYTES]; | |
38 | 34 | } __attribute__((packed)); |
39 | 35 | |
40 | 36 | /* |