[Oberon] Updated FAT Filesystem Driver

Bernhard Egger bernhard at aces.snu.ac.kr
Fri Jan 12 10:02:11 MET 2007


An updated version of Bluebottle's FAT filesystem driver can be 
downloaded from
   http://aces.snu.ac.kr/~bernhard/bluebottle/AosFATFs.zip

The index bug reported by Patrick a couple of days ago has been fixed.

At the same location, a simple filesystem stress test module can be found
   http://aces.snu.ac.kr/~bernhard/bluebottle/FStress.zip

Open the module source and scroll to the end of the file to see examples 
on how to use it.

As for the error with duplicate filenames: I have not been able to 
reproduce it (FStress contains a command to trigger it, but it works 
fine for me). Maybe somebody who actually encounters the error can show 
me the source related to the FS handling that triggers the incorrect 
behavior.


Note: I strongly advise against using thousands of files in one 
directory. VFAT, that is FAT with long file names, still uses the old 
8.3 filenames for backwards compatibility. For each filename, 
AosFATFiles therefore has to generate an appropriate and unique 8.3 
filename. FAT solves the problem by using "~x" suffixes, for example
   ThisIsALongFileName.Text     ==> THISIS~1.TEX
   ThisIsAlsoALongFileName.Text ==> THISIS~2.TEX

If you have many of those, you'll end up with something like
   ThisIsALongFileName7777.Text ==> TH~12345.TEX

Whenever a 8.3 filename has to be generated, the FAT FS driver has to 
enumerate the whole directory, compare each files short name, extract 
the tail (the "~xxx" part), and remember that this tail number has been 
taken. After enumerating all files and extracting all relevant tails 
values, a free tail number is searched and the short name can be generated.
Inevitably, the performance of this algorithm degrades quite much the 
more files you have in one directory. I used the FStress.Filename test 
on Bluebottle in VMWare to create 11'000 files in one directory. Below I 
list the time to create x files:
  Files  Time (delta)   Time/file
    [#]     [s]           [s]
    100       1          0.01
   1000      19          0.02
   2000      82          0.08
   3000     156          0.16
   5000     412          0.21
  10000    2188          0.44
  11000    1046          1.05


--Bernhard

PS: Bluebottle maintainers, please update the FAT driver in the release!


More information about the Oberon mailing list