platform_system_core/fastboot/device
Yo Chiang 66d0d96c89 Refactor fs_mgr_overlayfs_teardown()
Right now fs_mgr_overlayfs_teardown() does slightly different things
when called from the userspace or recovery. This is accomplished by many
runtime checks, runtime assumptions and conditional execution of code.

This makes the control flow of the function very hard to follow, and
assumptions becomes more fragile as the function becomes more complex.

This CL forks fs_mgr_overlayfs_teardown() and removes "recovery" bits
from it. A new entry point TeardownAllOverlayForMountPoint() is added
for recovery.

Recovery (fastbootd) should call TeardownAllOverlayForMountPoint() to
teardown overlays of all sources (cache dir, scratch device or DSU).
While fs_mgr_overlayfs_teardown() should only be called from the
userspace.

Also apply some linter suggestions.

Bug: 165925766
Test: adb-remount-test.sh
Change-Id: I7ff7e3409c910782e1ec207fcd02b967a9762bc1
2020-10-28 16:05:09 +08:00
..
commands.cpp fastboot: add new oem command for post wipe userdata 2020-10-01 05:09:26 +00:00
commands.h Merge "fastboot: Implement helper commands for Virtual A/B." 2019-10-31 01:11:49 +00:00
fastboot_device.cpp fastbootd: Add more logging for when the USB transport fails. 2020-10-12 15:55:48 -07:00
fastboot_device.h fastboot: add new oem command for post wipe userdata 2020-10-01 05:09:26 +00:00
flashing.cpp Refactor fs_mgr_overlayfs_teardown() 2020-10-28 16:05:09 +08:00
flashing.h fastbootd: Remove metadata merging code. 2018-10-26 13:34:40 -07:00
main.cpp Add fastbootd. 2018-08-02 09:43:23 -07:00
tcp_client.cpp fastbootd: Support TCP protocol. 2020-05-13 01:25:58 +00:00
tcp_client.h fastbootd: Support TCP protocol. 2020-05-13 01:25:58 +00:00
usb.cpp Move adbd's legacy USB implementation to fastboot. 2020-03-30 16:43:06 -07:00
usb.h Move adbd's legacy USB implementation to fastboot. 2020-03-30 16:43:06 -07:00
usb_client.cpp fastbootd: Add more logging for when the USB transport fails. 2020-10-12 15:55:48 -07:00
usb_client.h Move adbd's legacy USB implementation to fastboot. 2020-03-30 16:43:06 -07:00
utility.cpp fastboot: Mount /metadata before overlayfs teardown. 2019-12-30 13:42:57 -08:00
utility.h fastboot: Mount /metadata before overlayfs teardown. 2019-12-30 13:42:57 -08:00
variables.cpp fastbootd: exporting more properties 2020-01-22 23:29:07 +08:00
variables.h fastbootd: exporting more properties 2020-01-22 23:29:07 +08:00