In recent days, I have been thinking about ways to predict when directory index caches will become ineffective (which should come as no suprise to readers of the previous article).
I realised that to model what the file system does, I'd need to read directory files directly (try saying that 10 times quickly). SIZE2 just happens to do this to figure out filesizes in directory trees.
So I pulled the code for SIZE2 out of the CMS library to grab the directory reading routine, and immediately found a bug in it.
For some unknown reason (probably because the field is called dir$b_flags
), I was checking all four bits when I should have only been checking three. This caused files that had the mysteriously undocumented fourth bit set to be skipped.
I have fixed the code and the new version is available for download to both of you people using it ;)
Posted at February 17, 2005 6:32 PMComments are closed