[patch] some fixes for is_mounted detection

David Zeuthen david at fubar.dk
Mon Jul 5 12:55:16 PDT 2004


On Mon, 2004-07-05 at 21:29 +0200, Kay Sievers wrote:
> > So, It actually turns out this fixes some problems I've had as well as
> > bringing a new one to the table! Now inserting a floppy into my USB
> > floppy drives makes volume_id_probe take a long time since floppies are
> > so slow. 
> > 
> > Now, I think I know how to solve this, basically, in volume_id.c:
> > volume_id_probe(), move the probe_vfat() call to the top of the ones we
> > try to probe for, but the call to get_buffer() still takes a long time -
> > Kay: can we postpone the get_buffer() call to after probe_vfat()?
> 
> Hmm, most of the floppys are legacy ones, so we will not poll and never
> notice a media change. 

True, to work around this today we actually add a volume HalDevice to
the legacy floppy HalDevice once we detect that it's mounted, e.g. when
it's in mtab. My USB floppy works fine with polling so HAL polls there.

And yes, floppies suck (and I've already broke one just for testing)

> Isn't it better not to read the label at all for
> the floppies?

It's not that expensive, see below.

> You can remove the first get_buffer in volume_id_probe():ALL comletely,
> and move the MSDOS and VFAT up, to test if it's getting faster.
> 
> I just thought it was a good idea to read the buffer first (have no
> floppy :))
> 

This speeds it up so it's acceptable. 

I think we should read the label, but probe_vfat() doesn't work on the
floppy. Sure you don't have a floppy to test with? I can email you the
image of the floppy if you want! :-)

Cheers,
David


_______________________________________________
hal mailing list
hal at freedesktop.org
http://freedesktop.org/mailman/listinfo/hal



More information about the Hal mailing list