2002-01-14 18:50:52

by Matt Domsch

[permalink] [raw]
Subject: struct gendisk max_p gone in 2.5.x

The max_p member of struct gendisk was deleted in 2.5.x. Is there a
different preferred method for partition detection code to know the maximum
number of partitions it's allowed to present? Previously I was using this
field in the GPT detection code to only present the first max_p partitions
(because GPT allows an unlimited number of partitions). For SCSI disks with
the current major/minor numbering scheme, it shouldn't create more than 15
partitions; for IDE, 63.

Thanks,
Matt

--
Matt Domsch
Sr. Software Engineer
Dell Linux Solutions http://www.dell.com/linux
#1 US Linux Server provider with 24.5% (IDC Dec 2001)
#2 Worldwide Linux Server provider with 18.2% (IDC Dec 2001)


2002-01-14 19:31:53

by Matt Domsch

[permalink] [raw]
Subject: RE: struct gendisk max_p gone in 2.5.x

> The max_p member of struct gendisk was deleted in 2.5.x.

I found it. 1 << gd->minor_shift, per Andries Brouwer's patch of June 2001.
-Matt
--
Matt Domsch
Sr. Software Engineer
Dell Linux Solutions http://www.dell.com/linux
#1 US Linux Server provider with 24.5% (IDC Dec 2001)
#2 Worldwide Linux Server provider with 18.2% (IDC Dec 2001)

2002-01-15 20:31:40

by Andries E. Brouwer

[permalink] [raw]
Subject: Re: struct gendisk max_p gone in 2.5.x

> The max_p member of struct gendisk was deleted in 2.5.x.
> Is there a different preferred method for partition detection code
> to know the maximum number of partitions it's allowed to present?

Instead of using g->max_p you can use 1<<g->minor_shift .

Andries