Skip to content

Commit 4dbe13c

Browse files
committed
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: Al Viro <viro@zeniv.linux.org.uk>" * 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
2 parents b0b4518 + 4fc8728 commit 4dbe13c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+135
-134
lines changed

Documentation/filesystems/locking.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,7 @@ prototypes::
443443
int (*direct_access) (struct block_device *, sector_t, void **,
444444
unsigned long *);
445445
void (*unlock_native_capacity) (struct gendisk *);
446-
int (*getgeo)(struct block_device *, struct hd_geometry *);
446+
int (*getgeo)(struct gendisk *, struct hd_geometry *);
447447
void (*swap_slot_free_notify) (struct block_device *, unsigned long);
448448

449449
locking rules:

Documentation/scsi/scsi_mid_low_api.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ Details::
380380

381381
/**
382382
* scsi_bios_ptable - return copy of block device's partition table
383-
* @dev: pointer to block device
383+
* @dev: pointer to gendisk
384384
*
385385
* Returns pointer to partition table, or NULL for failure
386386
*
@@ -390,7 +390,7 @@ Details::
390390
*
391391
* Defined in: drivers/scsi/scsicam.c
392392
**/
393-
unsigned char *scsi_bios_ptable(struct block_device *dev)
393+
unsigned char *scsi_bios_ptable(struct gendisk *dev)
394394

395395

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

649649

arch/m68k/emu/nfblock.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,9 @@ static void nfhd_submit_bio(struct bio *bio)
7777
bio_endio(bio);
7878
}
7979

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

8484
geo->cylinders = dev->blocks >> (6 - dev->bshift);
8585
geo->heads = 4;

arch/um/drivers/ubd_kern.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ static DEFINE_MUTEX(ubd_lock);
108108

109109
static int ubd_ioctl(struct block_device *bdev, blk_mode_t mode,
110110
unsigned int cmd, unsigned long arg);
111-
static int ubd_getgeo(struct block_device *bdev, struct hd_geometry *geo);
111+
static int ubd_getgeo(struct gendisk *disk, struct hd_geometry *geo);
112112

113113
#define MAX_DEV (16)
114114

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

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

13311331
geo->heads = 128;
13321332
geo->sectors = 32;

block/ioctl.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,7 @@ static int blkdev_getgeo(struct block_device *bdev,
481481
*/
482482
memset(&geo, 0, sizeof(geo));
483483
geo.start = get_start_sect(bdev);
484-
ret = disk->fops->getgeo(bdev, &geo);
484+
ret = disk->fops->getgeo(disk, &geo);
485485
if (ret)
486486
return ret;
487487
if (copy_to_user(argp, &geo, sizeof(geo)))
@@ -515,7 +515,7 @@ static int compat_hdio_getgeo(struct block_device *bdev,
515515
* want to override it.
516516
*/
517517
geo.start = get_start_sect(bdev);
518-
ret = disk->fops->getgeo(bdev, &geo);
518+
ret = disk->fops->getgeo(disk, &geo);
519519
if (ret)
520520
return ret;
521521

block/partitions/ibm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ int ibm_partition(struct parsed_partitions *state)
358358
goto out_nolab;
359359
/* set start if not filled by getgeo function e.g. virtblk */
360360
geo->start = get_start_sect(bdev);
361-
if (disk->fops->getgeo(bdev, geo))
361+
if (disk->fops->getgeo(disk, geo))
362362
goto out_freeall;
363363
if (!fn || fn(disk, info)) {
364364
kfree(info);

drivers/ata/libata-scsi.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ EXPORT_SYMBOL_GPL(ata_common_sdev_groups);
351351
/**
352352
* ata_std_bios_param - generic bios head/sector/cylinder calculator used by sd.
353353
* @sdev: SCSI device for which BIOS geometry is to be determined
354-
* @bdev: block device associated with @sdev
354+
* @unused: gendisk associated with @sdev
355355
* @capacity: capacity of SCSI device
356356
* @geom: location to which geometry will be output
357357
*
@@ -366,7 +366,7 @@ EXPORT_SYMBOL_GPL(ata_common_sdev_groups);
366366
* RETURNS:
367367
* Zero.
368368
*/
369-
int ata_std_bios_param(struct scsi_device *sdev, struct block_device *bdev,
369+
int ata_std_bios_param(struct scsi_device *sdev, struct gendisk *unused,
370370
sector_t capacity, int geom[])
371371
{
372372
geom[0] = 255;

drivers/block/amiflop.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1523,13 +1523,13 @@ static blk_status_t amiflop_queue_rq(struct blk_mq_hw_ctx *hctx,
15231523
return BLK_STS_OK;
15241524
}
15251525

1526-
static int fd_getgeo(struct block_device *bdev, struct hd_geometry *geo)
1526+
static int fd_getgeo(struct gendisk *disk, struct hd_geometry *geo)
15271527
{
1528-
int drive = MINOR(bdev->bd_dev) & 3;
1528+
struct amiga_floppy_struct *p = disk->private_data;
15291529

1530-
geo->heads = unit[drive].type->heads;
1531-
geo->sectors = unit[drive].dtype->sects * unit[drive].type->sect_mult;
1532-
geo->cylinders = unit[drive].type->tracks;
1530+
geo->heads = p->type->heads;
1531+
geo->sectors = p->dtype->sects * p->type->sect_mult;
1532+
geo->cylinders = p->type->tracks;
15331533
return 0;
15341534
}
15351535

drivers/block/aoe/aoeblk.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -269,9 +269,9 @@ static blk_status_t aoeblk_queue_rq(struct blk_mq_hw_ctx *hctx,
269269
}
270270

271271
static int
272-
aoeblk_getgeo(struct block_device *bdev, struct hd_geometry *geo)
272+
aoeblk_getgeo(struct gendisk *disk, struct hd_geometry *geo)
273273
{
274-
struct aoedev *d = bdev->bd_disk->private_data;
274+
struct aoedev *d = disk->private_data;
275275

276276
if ((d->flags & DEVFL_UP) == 0) {
277277
printk(KERN_ERR "aoe: disk not up\n");

drivers/block/floppy.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3361,9 +3361,9 @@ static int get_floppy_geometry(int drive, int type, struct floppy_struct **g)
33613361
return 0;
33623362
}
33633363

3364-
static int fd_getgeo(struct block_device *bdev, struct hd_geometry *geo)
3364+
static int fd_getgeo(struct gendisk *disk, struct hd_geometry *geo)
33653365
{
3366-
int drive = (long)bdev->bd_disk->private_data;
3366+
int drive = (long)disk->private_data;
33673367
int type = ITYPE(drive_state[drive].fd_device);
33683368
struct floppy_struct *g;
33693369
int ret;

0 commit comments

Comments
 (0)