* [PATCH] sysace: HDIO_GETGEO has it's own method for ages
@ 2007-07-30 22:00 Christoph Hellwig
2007-08-01 12:57 ` Grant Likely
0 siblings, 1 reply; 2+ messages in thread
From: Christoph Hellwig @ 2007-07-30 22:00 UTC (permalink / raw)
To: grant.likely; +Cc: linux-kernel
The way this driver triesto implement HDIO_GETGEO it'll never be
called. Then again on ppc it probably will never be called anyway
because it's utterly pointless.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Index: linux-2.6/drivers/block/xsysace.c
===================================================================
--- linux-2.6.orig/drivers/block/xsysace.c 2007-07-30 22:53:11.000000000 +0200
+++ linux-2.6/drivers/block/xsysace.c 2007-07-30 22:54:43.000000000 +0200
@@ -902,26 +902,17 @@ static int ace_release(struct inode *ino
return 0;
}
-static int ace_ioctl(struct inode *inode, struct file *filp,
- unsigned int cmd, unsigned long arg)
+static int ace_getgeo(struct block_device *bdev, struct hd_geometry *geo)
{
- struct ace_device *ace = inode->i_bdev->bd_disk->private_data;
- struct hd_geometry __user *geo = (struct hd_geometry __user *)arg;
- struct hd_geometry g;
- dev_dbg(ace->dev, "ace_ioctl()\n");
-
- switch (cmd) {
- case HDIO_GETGEO:
- g.heads = ace->cf_id.heads;
- g.sectors = ace->cf_id.sectors;
- g.cylinders = ace->cf_id.cyls;
- g.start = 0;
- return copy_to_user(geo, &g, sizeof(g)) ? -EFAULT : 0;
+ struct ace_device *ace = bdev->bd_disk->private_data;
- default:
- return -ENOTTY;
- }
- return -ENOTTY;
+ dev_dbg(ace->dev, "ace_getgeo()\n");
+
+ geo->heads = ace->cf_id.heads;
+ geo->sectors = ace->cf_id.sectors;
+ geo->cylinders = ace->cf_id.cyls;
+
+ return 0;
}
static struct block_device_operations ace_fops = {
@@ -930,7 +921,7 @@ static struct block_device_operations ac
.release = ace_release,
.media_changed = ace_media_changed,
.revalidate_disk = ace_revalidate_disk,
- .ioctl = ace_ioctl,
+ .getgeo = ace_getgeo,
};
/* --------------------------------------------------------------------
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] sysace: HDIO_GETGEO has it's own method for ages
2007-07-30 22:00 [PATCH] sysace: HDIO_GETGEO has it's own method for ages Christoph Hellwig
@ 2007-08-01 12:57 ` Grant Likely
0 siblings, 0 replies; 2+ messages in thread
From: Grant Likely @ 2007-08-01 12:57 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: linux-kernel
On 7/30/07, Christoph Hellwig <hch@lst.de> wrote:
> The way this driver triesto implement HDIO_GETGEO it'll never be
> called. Then again on ppc it probably will never be called anyway
> because it's utterly pointless.
>
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
Heh, that's what I get for following LDD3 exactly for writing my block
dev, and not keeping up with API changes.
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
>
> Index: linux-2.6/drivers/block/xsysace.c
> ===================================================================
> --- linux-2.6.orig/drivers/block/xsysace.c 2007-07-30 22:53:11.000000000 +0200
> +++ linux-2.6/drivers/block/xsysace.c 2007-07-30 22:54:43.000000000 +0200
> @@ -902,26 +902,17 @@ static int ace_release(struct inode *ino
> return 0;
> }
>
> -static int ace_ioctl(struct inode *inode, struct file *filp,
> - unsigned int cmd, unsigned long arg)
> +static int ace_getgeo(struct block_device *bdev, struct hd_geometry *geo)
> {
> - struct ace_device *ace = inode->i_bdev->bd_disk->private_data;
> - struct hd_geometry __user *geo = (struct hd_geometry __user *)arg;
> - struct hd_geometry g;
> - dev_dbg(ace->dev, "ace_ioctl()\n");
> -
> - switch (cmd) {
> - case HDIO_GETGEO:
> - g.heads = ace->cf_id.heads;
> - g.sectors = ace->cf_id.sectors;
> - g.cylinders = ace->cf_id.cyls;
> - g.start = 0;
> - return copy_to_user(geo, &g, sizeof(g)) ? -EFAULT : 0;
> + struct ace_device *ace = bdev->bd_disk->private_data;
>
> - default:
> - return -ENOTTY;
> - }
> - return -ENOTTY;
> + dev_dbg(ace->dev, "ace_getgeo()\n");
> +
> + geo->heads = ace->cf_id.heads;
> + geo->sectors = ace->cf_id.sectors;
> + geo->cylinders = ace->cf_id.cyls;
> +
> + return 0;
> }
>
> static struct block_device_operations ace_fops = {
> @@ -930,7 +921,7 @@ static struct block_device_operations ac
> .release = ace_release,
> .media_changed = ace_media_changed,
> .revalidate_disk = ace_revalidate_disk,
> - .ioctl = ace_ioctl,
> + .getgeo = ace_getgeo,
> };
>
> /* --------------------------------------------------------------------
>
--
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
grant.likely@secretlab.ca
(403) 399-0195
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-08-01 12:57 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-30 22:00 [PATCH] sysace: HDIO_GETGEO has it's own method for ages Christoph Hellwig
2007-08-01 12:57 ` Grant Likely
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox