Commit 4dbe13c7 authored by Jens Axboe's avatar Jens Axboe
Browse files

Merge tag 'pull-getgeo' of...

Merge tag 'pull-getgeo' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs

 into for-6.18/block

Pull struct block_device getgeo changes from Al.

"switching ->getgeo() from struct block_device to struct gendisk

 Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk&gt;">

* tag 'pull-getgeo' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
  block: switch ->getgeo() to struct gendisk
  scsi: switch ->bios_param() to passing gendisk
  scsi: switch scsi_bios_ptable() and scsi_partsize() to gendisk
parents b0b4518c 4fc8728a
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -443,7 +443,7 @@ prototypes::
	int (*direct_access) (struct block_device *, sector_t, void **,
				unsigned long *);
	void (*unlock_native_capacity) (struct gendisk *);
	int (*getgeo)(struct block_device *, struct hd_geometry *);
	int (*getgeo)(struct gendisk *, struct hd_geometry *);
	void (*swap_slot_free_notify) (struct block_device *, unsigned long);

locking rules:
+4 −4
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)


    /**
@@ -623,7 +623,7 @@ Details::
    *      bios_param - fetch head, sector, cylinder info for a disk
    *      @sdev: pointer to scsi device context (defined in
    *             include/scsi/scsi_device.h)
    *      @bdev: pointer to block device context (defined in fs.h)
    *      @disk: pointer to gendisk (defined in blkdev.h)
    *      @capacity:  device size (in 512 byte sectors)
    *      @params: three element array to place output:
    *              params[0] number of heads (max 255)
@@ -643,7 +643,7 @@ Details::
    *
    *      Optionally defined in: LLD
    **/
	int bios_param(struct scsi_device * sdev, struct block_device *bdev,
	int bios_param(struct scsi_device * sdev, struct gendisk *disk,
		    sector_t capacity, int params[3])


+2 −2
Original line number Diff line number Diff line
@@ -77,9 +77,9 @@ static void nfhd_submit_bio(struct bio *bio)
	bio_endio(bio);
}

static int nfhd_getgeo(struct block_device *bdev, struct hd_geometry *geo)
static int nfhd_getgeo(struct gendisk *disk, struct hd_geometry *geo)
{
	struct nfhd_device *dev = bdev->bd_disk->private_data;
	struct nfhd_device *dev = disk->private_data;

	geo->cylinders = dev->blocks >> (6 - dev->bshift);
	geo->heads = 4;
+3 −3
Original line number Diff line number Diff line
@@ -108,7 +108,7 @@ static DEFINE_MUTEX(ubd_lock);

static int ubd_ioctl(struct block_device *bdev, blk_mode_t mode,
		     unsigned int cmd, unsigned long arg);
static int ubd_getgeo(struct block_device *bdev, struct hd_geometry *geo);
static int ubd_getgeo(struct gendisk *disk, struct hd_geometry *geo);

#define MAX_DEV (16)

@@ -1324,9 +1324,9 @@ static blk_status_t ubd_queue_rq(struct blk_mq_hw_ctx *hctx,
	return res;
}

static int ubd_getgeo(struct block_device *bdev, struct hd_geometry *geo)
static int ubd_getgeo(struct gendisk *disk, struct hd_geometry *geo)
{
	struct ubd *ubd_dev = bdev->bd_disk->private_data;
	struct ubd *ubd_dev = disk->private_data;

	geo->heads = 128;
	geo->sectors = 32;
+2 −2
Original line number Diff line number Diff line
@@ -481,7 +481,7 @@ static int blkdev_getgeo(struct block_device *bdev,
	 */
	memset(&geo, 0, sizeof(geo));
	geo.start = get_start_sect(bdev);
	ret = disk->fops->getgeo(bdev, &geo);
	ret = disk->fops->getgeo(disk, &geo);
	if (ret)
		return ret;
	if (copy_to_user(argp, &geo, sizeof(geo)))
@@ -515,7 +515,7 @@ static int compat_hdio_getgeo(struct block_device *bdev,
	 * want to override it.
	 */
	geo.start = get_start_sect(bdev);
	ret = disk->fops->getgeo(bdev, &geo);
	ret = disk->fops->getgeo(disk, &geo);
	if (ret)
		return ret;

Loading