@Paras yes, I understand this won’t be exactly how file vault works. All I meant is the following:
- there is precedence to turn on encryption and have it slowly work in the background. There will of course be code for this, I know this is not how it works today.
- if you could give some sort of api that made a guesstimate of how much encryption has finished, that would be good for users (don’t think anyone needs super accuracy)
- from my understanding of badger, files are immutable (or append only) and badger is single process. So I’m guessing that files which have to be encrypted aren’t being updated, so updating them should be easy (and you can use some os level APIs to write to a temporary file then swap it out).
- Further, since encryption itself is side effect free, in case the particular file in-process of being encrypted, but it was going to be compacted or something like that, you can just throw away your encryption and start over.
I’m aware I’m oversimplifying this architecture probably. Most notably the part which records which files are encrypted and which are not. But I still feel it is possible.