[patch] some fixes for is_mounted detection

David Zeuthen david at fubar.dk
Mon Jul 5 12:08:07 PDT 2004


On Sun, 2004-07-04 at 21:01 +0200, Sjoerd Simons wrote:
> > >   Second at the end of block_class_pre_process both detect_media and
> > >   etc_mtab_process_all_block_devices are called, but these only work on
> > >   devices in the gdl and at that time the device is still in the tdl. So
> > >   they're basically nops there. To solve this i've adjusted the
> > >   ClassDeviceHandler stuff to also call the post_merge function. And let
> > >   the one for block devices call detect_media and
> > >   etc_mtab_process_all_block_devices..
> > 
> > This is a good point but it seems wrong to use post_merge for this.
> > Perhaps we should have an added_to_gdl method on both ClassDeviceHandler
> > and BusDeviceHandler that is called when it's in the GDL?
> 
> It depends on what exactly is ment by merge, if it's merging new info into a
> device a added_to_gdl is nicer. If it's merging new information (either
> properties updates of a new device) into the GDL, then using post_merge is fine.
> 
> Both meanings sound fine to me and the last one was the least work, so i choose
> that when writing the patch :)
> 

Ok, as discussed on IRC last night I've now added a in_gdl method to
both BusDeviceHandler and ClassDeviceHandler - for the latter it is only
invoked for class devices we add into the tree, so it sort of
complements post_merge that only applies to class devices merged onto
bus devices. So that's nice.

With this it was trivial to move the detect_media() and
etc_mtab_process_all_block_devices() function calls into the new in_gdl
method and I believe this fixes the bug you had? Anyway, if you can test
the latest from CVS, I'd appreciate it!

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()?

Cheers,
David 



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



More information about the Hal mailing list