Commit 1fd143c2 authored by Al Viro's avatar Al Viro
Browse files

scsi: switch scsi_bios_ptable() and scsi_partsize() to gendisk



Both helpers are reading the partition table of the disk specified
by block_device of some partition on it; result depends only upon
the disk in question, so we might as well pass the struct gendisk
instead.

Reviewed-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Acked-by: default avatarJens Axboe <axboe@kernel.dk>
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent 8f5ae30d
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -380,7 +380,7 @@ Details::

    /**
    * scsi_bios_ptable - return copy of block device's partition table
    * @dev:        pointer to block device
    * @dev:        pointer to gendisk
    *
    *      Returns pointer to partition table, or NULL for failure
    *
@@ -390,7 +390,7 @@ Details::
    *
    *      Defined in: drivers/scsi/scsicam.c
    **/
    unsigned char *scsi_bios_ptable(struct block_device *dev)
    unsigned char *scsi_bios_ptable(struct gendisk *dev)


    /**
+1 −1
Original line number Diff line number Diff line
@@ -3261,7 +3261,7 @@ static int blogic_diskparam(struct scsi_device *sdev, struct block_device *dev,
		diskparam->sectors = 32;
	}
	diskparam->cylinders = (unsigned long) capacity / (diskparam->heads * diskparam->sectors);
	buf = scsi_bios_ptable(dev);
	buf = scsi_bios_ptable(dev->bd_disk);
	if (buf == NULL)
		return 0;
	/*
+1 −1
Original line number Diff line number Diff line
@@ -324,7 +324,7 @@ static int aac_biosparm(struct scsi_device *sdev, struct block_device *bdev,
	 *	entry whose end_head matches one of the standard geometry
	 *	translations ( 64/32, 128/32, 255/63 ).
	 */
	buf = scsi_bios_ptable(bdev);
	buf = scsi_bios_ptable(bdev->bd_disk);
	if (!buf)
		return 0;
	if (*(__le16 *)(buf + 0x40) == cpu_to_le16(MSDOS_LABEL_MAGIC)) {
+1 −1
Original line number Diff line number Diff line
@@ -731,7 +731,7 @@ ahd_linux_biosparam(struct scsi_device *sdev, struct block_device *bdev,

	ahd = *((struct ahd_softc **)sdev->host->hostdata);

	if (scsi_partsize(bdev, capacity, geom))
	if (scsi_partsize(bdev->bd_disk, capacity, geom))
		return 0;

	heads = 64;
+1 −1
Original line number Diff line number Diff line
@@ -696,7 +696,7 @@ ahc_linux_biosparam(struct scsi_device *sdev, struct block_device *bdev,
	ahc = *((struct ahc_softc **)sdev->host->hostdata);
	channel = sdev_channel(sdev);

	if (scsi_partsize(bdev, capacity, geom))
	if (scsi_partsize(bdev->bd_disk, capacity, geom))
		return 0;

	heads = 64;
Loading