Re: problems with alloc_disk in genhd.c

From: viro
Date: Wed Jun 23 2004 - 17:11:56 EST


On Wed, Jun 23, 2004 at 04:55:12PM -0500, mikem@xxxxxxxxxxxxxxxxxxxxxxx wrote:
> On Wed, Jun 23, 2004 at 10:24:59PM +0100, viro@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx wrote:
> > On Wed, Jun 23, 2004 at 04:18:29PM -0500, mikem@xxxxxxxxxxxxxxxxxxxxxxx wrote:
> > > In the ioctl we are doing
> > >
> > > /* count partitions 1 to 15 with sizes > 0 */
> > > for(i=0; i <MAX_PART; i++) {
> >
> > ... followed by what?
> Here's the actual code, I typoed this first time.
> /* count partitions 1 to 15 with sizes > 0 */
> for(i=1; i <MAX_PART; i++) {
> if (!disk->part[i])
> continue;
> if (disk->part[i]->nr_sects != 0)
> luninfo.num_parts++;
> We're trying to figure how many partitions are physically on the disk. We do
> this for one of our utilities. Is there a kernel API that will return this
> data for us?

A bunch of those, starting with readdir on /sys/block/<whatever>. Why do
you want that as a driver-specific ioctl?

That stuff has no business being in the driver. At all.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/