diff options
author | 2024-03-05 16:18:14 +0000 | |
---|---|---|
committer | 2024-03-25 15:01:42 +0000 | |
commit | 00fbc4047bd6a1984c333b93fc39e73e61a2521a (patch) | |
tree | 1ea128bd50230a40a75363a590a6af1d07301d2c /libartbase/base/bit_vector.cc | |
parent | c5e25a99840aeb9b60e914287573bdef16fcb292 (diff) |
Add and use FdFile::Rename on Android V+
Add the ability to change a file's path via the Rename function, and use
it when installing staging files during odrefresh. As the moved file
requires its SELinux label updated via `selinux_android_restorecon`
which odrefresh requires an updated SELinux policy to use, only perform
the rename on Android V+ and otherwise fallback to the existing copy and
delete approach.
On linux, the rename syscall requires the source and destination to be
on the same mounted filesystem. As this approach does not modify the
file's contents, this has the added benefit of ensuring the sparsity of
the resulting file in the destination path is preserved, thereby saving
disk space on systems that support sparse files.
As rename applies changes to parent directory metadata, FdFile now
supports flushing metadata in addition to data (via fsync), as well as
allowing read-only file descriptors to be flushed (required for
directories).
Bug: 323906594
Tested on oriole and shiba (ext4 and f2fs):
Test: odrefresh --force-compile
Test: art/tools/run-gtests.sh
Change-Id: I1d017552fbffcc728cac7a55a14d4d17d1770cb8
Diffstat (limited to 'libartbase/base/bit_vector.cc')
0 files changed, 0 insertions, 0 deletions