+40
−39
Loading
Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more
Per-snapshot locks don't solve any problems and add a great deal of complexity. Instead, refactor the Read/WriteSnapshotStatus methods so the caller just needs the snapshot name, and is not responsible for opening a file. As part of this change, callers of WriteSnapshotStatus must always take an exclusive flock on the update state file. This is enforced by adding a helper method to LockedFile to check the lock mode. Bug: 136678799 Test: libsnapshot_test gtest Change-Id: Icd580aaec7dfc916b3eed174d86b26688cd2291b