aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/block')
-rw-r--r--drivers/block/virtio_blk.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c
index 6143337527e7..d2fe679519e4 100644
--- a/drivers/block/virtio_blk.c
+++ b/drivers/block/virtio_blk.c
@@ -152,9 +152,20 @@ static int virtblk_ioctl(struct inode *inode, struct file *filp,
152 (void __user *)data); 152 (void __user *)data);
153} 153}
154 154
155/* We provide getgeo only to please some old bootloader/partitioning tools */
156static int virtblk_getgeo(struct block_device *bd, struct hd_geometry *geo)
157{
158 /* some standard values, similar to sd */
159 geo->heads = 1 << 6;
160 geo->sectors = 1 << 5;
161 geo->cylinders = get_capacity(bd->bd_disk) >> 11;
162 return 0;
163}
164
155static struct block_device_operations virtblk_fops = { 165static struct block_device_operations virtblk_fops = {
156 .ioctl = virtblk_ioctl, 166 .ioctl = virtblk_ioctl,
157 .owner = THIS_MODULE, 167 .owner = THIS_MODULE,
168 .getgeo = virtblk_getgeo,
158}; 169};
159 170
160static int virtblk_probe(struct virtio_device *vdev) 171static int virtblk_probe(struct virtio_device *vdev)