ligurio / unreliablefs

A FUSE-based fault injection filesystem.
https://ligurio.github.io/unreliablefs/unreliablefs.1.html
MIT License
173 stars 9 forks source link

Use hashmap instead of linked list #107

Open ligurio opened 2 years ago

ligurio commented 2 years ago

unreliablefs uses linked list for error injections, see https://github.com/ligurio/unreliablefs/blob/c6a6b1e7136de3ff25dacf2cf785406313a6b39f/unreliablefs_errinj.c#L183-L235 On each operation, it traverses a list with error injections, and it is not optimal from performance point of view, algorithmic complexity is O(N). It is better to use hashmap. For example, a static hashmap implemented by gperf^1.