devfs
[Top] [All Lists]

Re: Removeable Media, partitions and devfs?

To: "Kevin P. Fleming" <kevin@xxxxxxxxxxxxx>
Subject: Re: Removeable Media, partitions and devfs?
From: Richard Gooch <rgooch@xxxxxxxxxxxxxxx>
Date: Sat, 15 Dec 2001 10:56:12 -0700
Cc: "Paul Bristow" <paul@xxxxxxxxxxxxxxx>, <Andrej.Borsenkow@xxxxxxxxxxxxxx>, <devfs@xxxxxxxxxxx>
In-reply-to: <000b01c1858e$acd2c930$6caaa8c0@kevin>
References: <3C0C9AC5.4080504@xxxxxxxxxxxxxxx> <001801c17d15$758b6760$c8aaa8c0@kevin> <3C0D588F.9000806@xxxxxxxxxxxxxxx> <03be01c17d20$5d1b72f0$c8aaa8c0@kevin> <200112050639.fB56d0a05344@xxxxxxxxxxxxxxxxxxxxxxxx> <00e901c17dd2$8ccffe50$c8aaa8c0@kevin> <200112060633.fB66XoZ22006@xxxxxxxxxxxxxxxxxxxxxxxx> <3C0FED36.9050506@xxxxxxxxxxxxxxx> <010b01c17f4f$87b478a0$c8aaa8c0@kevin> <200112090303.fB933vw04632@xxxxxxxxxxxxxxxxxxxxxxxx> <001501c181ba$fdb65650$6caaa8c0@kevin> <200112140650.fBE6oN201769@xxxxxxxxxxxxxxxxxxxxxxxx> <003401c184bc$107efb80$6caaa8c0@kevin> <200112141810.fBEIA6k05971@xxxxxxxxxxxxxxxxxxxxxxxx> <000b01c1858e$acd2c930$6caaa8c0@kevin>
Sender: owner-devfs@xxxxxxxxxxx
Kevin P. Fleming writes:
> > OK, I've looked at this, and the appended patch should fix this. This
> > superceeds my earlier patch. Now, if the driver passes size==0 and it
> > flags the media as removable, then the device directory and "disc"
> > entry will be created (if not already), and any old partitions are
> > removed. Please try this out and let me know how it goes. I hope it
> > works, because I've hit the 20 line patch limit I imposed :-)
> >
> > Regards,
> >
> > Richard....
> > Permanent: rgooch@xxxxxxxxxxxxx
> > Current:   rgooch@xxxxxxxxxxxxxxx
> >
> > --- check.c~ Thu Oct 11 18:25:10 2001
> > +++ check.c Fri Dec 14 11:02:19 2001
> > @@ -338,7 +338,8 @@
> >   if (!unregister)
> >   devfs_register_disc (dev, minor);
> >   for (part = 1; part < dev->max_p; part++) {
> > - if ( unregister || (dev->part[part + minor].nr_sects < 1) ) {
> > + if ( unregister || (dev->part[minor].nr_sects < 1) ||
> > +      (dev->part[part + minor].nr_sects < 1) ) {
> >   devfs_unregister (dev->part[part + minor].de);
> >   dev->part[part + minor].de = NULL;
> >   continue;
> > @@ -383,6 +384,8 @@
> >
> >   dev->part[first_minor].nr_sects = size;
> >   /* No such device or no minors to use for partitions */
> > + if ( !size && dev->flags && (dev->flags[drive] & GENHD_FL_REMOVABLE) )
> > + devfs_register_partitions (dev, first_minor, 0);
> >   if (!size || minors == 1)
> >   return;
> 
> Sorry, this code never gets called... grok_partitions doesn't call
> check_partition when "size" is zero, and check_partition is the only
> function that calls devfs_register_partitions, which is where this
> change was made. Want to make another attempt? :-)

?!?!?!? My patch has two hunks. One which modifies
devfs_register_partitions(), and another which modifies
grok_partitions() to call devfs_register_partitions() when size==0 for
removable media devices. This should work.

Did you actually try this?

                                Regards,

                                        Richard....
Permanent: rgooch@xxxxxxxxxxxxx
Current:   rgooch@xxxxxxxxxxxxxxx

<Prev in Thread] Current Thread [Next in Thread>