libsnapshot: Eliminate per-snapshot flocks.
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
Loading
Please register or sign in to comment