b1187595d6
"Recursion" here just refers to the ability to remove entries in a directory while iterating over it. This is very useful when you just want a directory gone, and can be extended to a "true" recursive remove straightforwardly. This mainly tests that mid/rid updates in opened mdirs are correct. To make this work, we need to update opened dirs differently than files, since opened dirs do not get marked as removed when its rid is removed and contain an additional position in the dir that needs to be updated. To keep track of the different types, littlefs now contains 2 linked-lists for opened mdirs. Maybe these should be correctly typed, but by hiding the specific types behind an array of mdir linked-lists, we can more efficiently iterate over both lists when necessary. We should probably compare this approach to the type-tagged approach in the previous littlefs implementation, but I think the idea of an array of type-hidden linked-lists just didn't come to me then. There was also a bit more room in the mdir structs to hide a 1-bit type field. The mdir structs here are getting pretty squeezed since they are used everywhere.