* partitions
@ 2002-07-24 16:11 David Chow
2002-07-24 16:18 ` partitions Mr. James W. Laferriere
2002-07-24 18:47 ` partitions Andries Brouwer
0 siblings, 2 replies; 7+ messages in thread
From: David Chow @ 2002-07-24 16:11 UTC (permalink / raw)
To: linux-fsdevel
Hi all,
Is there any global variables or list in the kernel space that I can
find out which partitions are available in the system? Please give
pointer of information.
regards,
David
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: partitions
2002-07-24 16:11 partitions David Chow
@ 2002-07-24 16:18 ` Mr. James W. Laferriere
2002-07-24 16:32 ` partitions Randy.Dunlap
2002-07-24 18:47 ` partitions Andries Brouwer
1 sibling, 1 reply; 7+ messages in thread
From: Mr. James W. Laferriere @ 2002-07-24 16:18 UTC (permalink / raw)
To: David Chow; +Cc: linux-fsdevel
Hello David , /proc/partitions ? Hth , JimL
On Thu, 25 Jul 2002, David Chow wrote:
> Hi all,
> Is there any global variables or list in the kernel space that I can
> find out which partitions are available in the system? Please give
> pointer of information.
> regards,
> David
+------------------------------------------------------------------+
| James W. Laferriere | System Techniques | Give me VMS |
| Network Engineer | P.O. Box 854 | Give me Linux |
| babydr@baby-dragons.com | Coudersport PA 16915 | only on AXP |
+------------------------------------------------------------------+
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: partitions
2002-07-24 16:18 ` partitions Mr. James W. Laferriere
@ 2002-07-24 16:32 ` Randy.Dunlap
0 siblings, 0 replies; 7+ messages in thread
From: Randy.Dunlap @ 2002-07-24 16:32 UTC (permalink / raw)
To: Mr. James W. Laferriere; +Cc: David Chow, linux-fsdevel
On Wed, 24 Jul 2002, Mr. James W. Laferriere wrote:
| Hello David , /proc/partitions ? Hth , JimL
|
| On Thu, 25 Jul 2002, David Chow wrote:
| > Hi all,
| > Is there any global variables or list in the kernel space that I can
| > find out which partitions are available in the system? Please give
| > pointer of information.
um, I wouldn't call /proc/partitions "in the kernel space."
However, someone could clone the code that produces /proc/partitions
in kernel space.
in drivers/block/genhd.c::get_partition_list() [at least in 2.4.18/19]
--
~Randy
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: partitions
2002-07-24 16:11 partitions David Chow
2002-07-24 16:18 ` partitions Mr. James W. Laferriere
@ 2002-07-24 18:47 ` Andries Brouwer
2002-07-24 19:02 ` partitions Alexander Viro
1 sibling, 1 reply; 7+ messages in thread
From: Andries Brouwer @ 2002-07-24 18:47 UTC (permalink / raw)
To: David Chow; +Cc: linux-fsdevel
On Thu, Jul 25, 2002 at 12:11:08AM +0800, David Chow wrote:
> Is there any global variables or list in the kernel space that I can
> find out which partitions are available in the system?
Look at the struct gendisk chain.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: partitions
2002-07-24 18:47 ` partitions Andries Brouwer
@ 2002-07-24 19:02 ` Alexander Viro
2002-07-24 19:29 ` partitions Andries Brouwer
0 siblings, 1 reply; 7+ messages in thread
From: Alexander Viro @ 2002-07-24 19:02 UTC (permalink / raw)
To: Andries Brouwer; +Cc: David Chow, linux-fsdevel
On Wed, 24 Jul 2002, Andries Brouwer wrote:
> On Thu, Jul 25, 2002 at 12:11:08AM +0800, David Chow wrote:
>
> > Is there any global variables or list in the kernel space that I can
> > find out which partitions are available in the system?
>
> Look at the struct gendisk chain.
... and you will get a random set of things. E.g. you might very well
find a gendisk shared by hda (with its partitions) and hdb (either
unpartitioned disk or a CDROM; no way to tell which one it is). OTOH,
you will not find a SCSI CDROM. You will find IDE-floppy. You will not
find paride one. You will find a very odd gendisk for RAID devices
(even though they are not partitioned). You will not find one for loop
or nbd.
IOW, contents of /proc/partitions or (soon to be late) gendisk chain
is random - any code that relies on it to give you a meaningful set
of devices is buggered.
BTW, going through /proc/partitions and blindly opening all devices you
see is _NOT_ a good idea - it will show you absent devices if there is
something with the same major and higher minor. Why? Beats me.
Basically, gendisks are crap. Why on the earth they were created as
per-major objects instead of per-disk ones is a mistery, but whatever
reason it had, it had acted as serious source of mess. For many years.
Right now I'm cleaning that mess up in 2.5 and I have nothing nice to
say about the bright guys responsible for its creation. Sorry.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: partitions
2002-07-24 19:02 ` partitions Alexander Viro
@ 2002-07-24 19:29 ` Andries Brouwer
2002-07-25 12:09 ` partitions David Chow
0 siblings, 1 reply; 7+ messages in thread
From: Andries Brouwer @ 2002-07-24 19:29 UTC (permalink / raw)
To: Alexander Viro; +Cc: David Chow, linux-fsdevel
On Wed, Jul 24, 2002 at 03:02:50PM -0400, Alexander Viro wrote:
> Basically, gendisks are crap. Why on the earth they were created as
> per-major objects instead of per-disk ones is a mistery, but whatever
> reason it had, it had acted as serious source of mess. For many years.
> Right now I'm cleaning that mess up in 2.5 and I have nothing nice to
> say about the bright guys responsible for its creation. Sorry.
[amused] Good to see that you now understand that permanent
disk data is not stored in a struct block_device and that
the way to removal of the arrays is nearly independent of
struct block_device and instead dependent on a replacement
of struct gendisk.
[berating] However, your annoyed words are not fair to Drew Eckhardt.
Ten years ago, when he created struct gendisk, most of the problems
you mention did not exist yet.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: partitions
2002-07-24 19:29 ` partitions Andries Brouwer
@ 2002-07-25 12:09 ` David Chow
0 siblings, 0 replies; 7+ messages in thread
From: David Chow @ 2002-07-25 12:09 UTC (permalink / raw)
To: Andries Brouwer; +Cc: Alexander Viro, linux-fsdevel
Andries Brouwer wrote:
> On Wed, Jul 24, 2002 at 03:02:50PM -0400, Alexander Viro wrote:
>
>
>>Basically, gendisks are crap. Why on the earth they were created as
>>per-major objects instead of per-disk ones is a mistery, but whatever
>>reason it had, it had acted as serious source of mess. For many years.
>>Right now I'm cleaning that mess up in 2.5 and I have nothing nice to
>>say about the bright guys responsible for its creation. Sorry.
>
>
> [amused] Good to see that you now understand that permanent
> disk data is not stored in a struct block_device and that
> the way to removal of the arrays is nearly independent of
> struct block_device and instead dependent on a replacement
> of struct gendisk.
>
> [berating] However, your annoyed words are not fair to Drew Eckhardt.
> Ten years ago, when he created struct gendisk, most of the problems
> you mention did not exist yet.
Thanks for advice, it seems there are no standard solutions right? It
depends on what sort of device we are looking for... I think I rather
concentrate on finding local partitioncs, ide or scsi. But the case of
ide-floppy is in a gray area. I certainly don't want to make use of such
slow disk.
regards,
David
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2002-07-25 12:09 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-07-24 16:11 partitions David Chow
2002-07-24 16:18 ` partitions Mr. James W. Laferriere
2002-07-24 16:32 ` partitions Randy.Dunlap
2002-07-24 18:47 ` partitions Andries Brouwer
2002-07-24 19:02 ` partitions Alexander Viro
2002-07-24 19:29 ` partitions Andries Brouwer
2002-07-25 12:09 ` partitions David Chow
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox