summaryrefslogtreecommitdiff
path: root/scripts/blockdiff.py
diff options
context:
space:
mode:
authorAmin Hassani <ahassani@google.com>2017-08-25 15:32:13 -0700
committerchrome-bot <chrome-bot@chromium.org>2017-10-05 13:19:47 -0700
commitacd7be816579a0c13ac6f746a2555b7c73f95a3b (patch)
tree382abdddcea43068c8828241b3dabc9a8bbb603c /scripts/blockdiff.py
parent5192fe54e9ea90c3831a4beb799b8f19a9d061d0 (diff)
update_engine: Add CachedFileDescriptor
Currently there are operations in the delta_performer which are not efficient in writing into disk. For example BzipExtentWriter and XZExtentWriter write in 16KB buffers which is not very efficient for today's disks specially if we are writing with O_DSYNC flag. Another problem is operations such as bspatch which write in very small number of bytes in order of a few bytes to a few hundred bytes. Even though bspatch open's its own file descriptor and currently have no O_DSYNC added, writing in very small bytes into disk in general is not a good idea for the purpose of the update engine. This patch adds new wrapper for a FileDescriptor interface which caches all the writes into a large buffer (like 1MB) and writes it into disk when either a 'Flush' request comes or if the offset of the file has been changed to a different position than what it is writing now. This cached buffer can be wrapped around target_fd_ and every operation can write into it. This centralizes all write oprerations through one file descriptor and gives greater control on how writes should be performed. BUG=chromium:762815 TEST=FEATURES="test" emerge-amd-generic update_engine; brillo_update_payload verify Change-Id: I4911d917ec9362bf66c4dd2ed19d89440042733c Reviewed-on: https://chromium-review.googlesource.com/674164 Commit-Ready: Amin Hassani <ahassani@chromium.org> Tested-by: Amin Hassani <ahassani@chromium.org> Reviewed-by: Ben Chan <benchan@chromium.org>
Diffstat (limited to 'scripts/blockdiff.py')
0 files changed, 0 insertions, 0 deletions