sunvdc: compute vdisk geometry from capacity
authorAllen Pais <allen.pais@oracle.com>
Fri, 19 Sep 2014 13:42:26 +0000 (09:42 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 21 Nov 2014 17:23:00 +0000 (09:23 -0800)
commitb3c23e4a27492ae9321c6a719b9b3b6d7090d416
tree4e229f067fa7740d16c1c9b1ace40cd91ac94fff
parentcaa0a8a8bb14fd9a6a9d2544eab141f3a6469ba3
sunvdc: compute vdisk geometry from capacity

[ Upstream commit de5b73f08468b4fc5e2f6d1505f650262622f78b ]

The LDom diskserver doesn't return reliable geometry data. In addition,
the types for all fields in the vio_disk_geom are u16, which were being
truncated in the cast into the u8's of the Linux struct hd_geometry.

Modify vdc_getgeo() to compute the geometry from the disk's capacity in a
manner consistent with xen-blkfront::blkif_getgeo().

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/block/sunvdc.c