[maemo-developers] What's wrong with folder browsing?

From: Eero Tamminen eero.tamminen at nokia.com
Date: Tue May 22 18:30:26 EEST 2007
Hi,

ext Frantisek Dufka wrote:
>>> You can also do MD5 sum of directory listing (even output of ls -R or
>>> -lR) and do not scan files at all if listing hash is same.
>> this is easy, but not much faster than the stats... 
> 
> Sure if you stat directories recursively it is same. The idea was just 
> to avoid reading the file data as much as possible.  At least 
> metalayerc-crawler seems to be very dumb at this and recreates whole 
> database (haven't seen sources but it takes ages and does a lot of write 
> i/o after reboot or card reinsert whne there is no change in data on the 
> card).

I think it's supposed just to stat files and read them only if they have
changed.  If it's not doing this, please file a bug.


> Another hint could be to check free available space, if it is same like 
> before it is unlikely there was some change and even recursive scan can 
> be skipped.

This won't really work.  Although it's unlikely, all the content on
the MMC could have changed while the amount of used space is same.



> So the idea is not to have perfect implementation but fast one solving 
> most frequent cases (1. no change, 2. just files added/removed) with 
> possibility to do manual rescan.

Is it possible that some specific file(s) are triggering some bug
in libid3 that causes it to scan the whole mp3 instead of just the
metadata part?

If you notice with:
for p in $(pidof metalayer-crawler); do ls -l /proc/$p/fd/|grep mmc; done

That metalayer-crawler is spending an inordinate amount on some
specific files on the MMC, could you try removing that file and
checking whether the problem is triggered again?


	- Eero

More information about the maemo-developers mailing list