This actually isn't a good idea at this time. The problem is that the implementation detail that storageDirs is an ordered list leaked out into many other places in the code and is now relied on. Many places expect the iterator over the list to traverse it in the order the storage dirs were added to it, not by the path name associated with the storage (the most reasonable key to a map). For instance, in FSEditLog.java, divertFileStreams is expecting to find corresponding storage dirs and edit streams to work over. Of the 27 or so times that the DirIterator is used (which is based on this ArrayList), only one is actually searching for something like a pathname.
There's certainly room to correct this but it should be done as a larger clean up of the fsimage code. Thoughts?