platform_system_core/fs_mgr/include
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
..
fs_mgr Introduce inotify-based replacements for fs_mgr_wait_for_file. 2019-06-18 15:27:09 -07:00
fs_mgr.h Only store result of mount_all that mounted userdata 2020-09-08 21:58:43 +01:00
fs_mgr_dm_linear.h fs_mgr: CreateDmTable takes CreateLogicalPartitionParams 2019-09-11 18:32:57 -07:00
fs_mgr_overlayfs.h Refactor fs_mgr_overlayfs_teardown() 2020-10-28 16:05:09 +08:00
fs_mgr_vendor_overlay.h Mount vendor overlay from the system partition 2018-11-01 10:26:12 +09:00