fmap support
Adds basic fmap support to redoxfs. Work in progress PR to make sure I'm not doing things completely incorrectly so I don't waste more days on this approach if so.
Basic idea:
- Read file to buffer
- Write file back to buffer on
fsync
Limitations:
- There is a max amount of fmaps that can be open. This is because the memory can't reallocate - old references would be invalidated.
- Fmaps are shared, but only if their offsets/lengths fit within a previous fmap's (rounded to the page size). This is once again because nothing can be reallocated and therefore invalidated.
- Because they aren't always shared, it's unspecified which copy they will share with.
- Fmaps are not synced on funmap. This would be doable once the kernel sends a scheme event for that.
Current Limitations (that can be fixed sort of):
- Files are only written to with an explicit fsync. This could be fixed with some sort of timer or something idk
Edited by jD91mZM2