Lines Matching refs:blocks

244     return tgt_.blocks() * BLOCKSIZE - bytes_written_;  in AvailableSpace()
589 locs = RangeSet(std::vector<Range>{ Range{ 0, src.blocks() } }); in PrintHashForCorruptedSourceBlocks()
596 CHECK_EQ(src.blocks(), locs.blocks()); in PrintHashForCorruptedSourceBlocks()
599 LOG(INFO) << "printing hash in hex for " << src.blocks() << " source blocks"; in PrintHashForCorruptedSourceBlocks()
600 for (size_t i = 0; i < src.blocks(); i++) { in PrintHashForCorruptedSourceBlocks()
618 CHECK_EQ(src.blocks() * BLOCKSIZE, buffer.size()); in PrintHashForCorruptedStashedBlocks()
620 for (size_t i = 0; i < src.blocks(); i++) { in PrintHashForCorruptedStashedBlocks()
640 std::vector<uint8_t> buffer(src.blocks() * BLOCKSIZE); in PrintHashForMissingStashedBlocks()
649 const size_t blocks, bool printerror) { in VerifyBlocks() argument
653 SHA1(data, blocks * BLOCKSIZE, digest); in VerifyBlocks()
737 allocate(src.blocks() * BLOCKSIZE, buffer); in LoadStash()
743 if (VerifyBlocks(id, *buffer, src.blocks(), true) != 0) { in LoadStash()
787 size_t blocks = sb.st_size / BLOCKSIZE; in LoadStash() local
788 if (verify && VerifyBlocks(id, *buffer, blocks, true) != 0) { in LoadStash()
804 static int WriteStash(const std::string& base, const std::string& id, int blocks, in WriteStash() argument
810 if (checkspace && !CheckAndFreeSpaceOnCache(blocks * BLOCKSIZE)) { in WriteStash()
826 LOG(INFO) << " skipping " << blocks << " existing blocks in " << cn; in WriteStash()
834 LOG(INFO) << " writing " << blocks << " blocks to " << cn; in WriteStash()
849 if (!android::base::WriteFully(fd, buffer.data(), blocks * BLOCKSIZE)) { in WriteStash()
851 PLOG(ERROR) << "Failed to write " << blocks * BLOCKSIZE << " bytes of data"; in WriteStash()
962 size_t start = locs.blocks(); in MoveRange()
965 size_t blocks = it->second - it->first; in MoveRange() local
966 start -= blocks; in MoveRange()
967 memmove(to + (it->first * BLOCKSIZE), from + (start * BLOCKSIZE), blocks * BLOCKSIZE); in MoveRange()
1110 std::vector<uint8_t> tgtbuffer(tgt->blocks() * BLOCKSIZE); in LoadSrcTgtVersion3()
1116 if (VerifyBlocks(tgthash, tgtbuffer, tgt->blocks(), false) == 0) { in LoadSrcTgtVersion3()
1168 size_t blocks = 0; in PerformCommandMove() local
1170 int status = LoadSrcTgtVersion3(params, &tgt, &blocks, true); in PerformCommandMove()
1188 LOG(INFO) << " moving " << blocks << " blocks"; in PerformCommandMove()
1194 LOG(INFO) << "skipping " << blocks << " already moved blocks"; in PerformCommandMove()
1203 params.written += tgt.blocks(); in PerformCommandMove()
1225 size_t blocks = src.blocks(); in PerformCommandStash() local
1226 allocate(blocks * BLOCKSIZE, &params.buffer); in PerformCommandStash()
1232 if (VerifyBlocks(id, params.buffer, blocks, true) != 0) { in PerformCommandStash()
1245 LOG(INFO) << "stashing " << blocks << " blocks to " << id; in PerformCommandStash()
1246 int result = WriteStash(params.stashbase, id, blocks, params.buffer, false, nullptr); in PerformCommandStash()
1248 params.stashed += blocks; in PerformCommandStash()
1279 LOG(INFO) << " zeroing " << tgt.blocks() << " blocks"; in PerformCommandZero()
1309 params.written += tgt.blocks(); in PerformCommandZero()
1325 LOG(INFO) << " writing " << tgt.blocks() << " blocks of new data"; in PerformCommandNew()
1333 LOG(ERROR) << "missing " << (tgt.blocks() * BLOCKSIZE - params.nti.writer->BytesWritten()) in PerformCommandNew()
1344 params.written += tgt.blocks(); in PerformCommandNew()
1369 size_t blocks = 0; in PerformCommandDiff() local
1370 int status = LoadSrcTgtVersion3(params, &tgt, &blocks, false); in PerformCommandDiff()
1388 LOG(INFO) << "patching " << blocks << " blocks to " << tgt.blocks(); in PerformCommandDiff()
1395 if (ApplyImagePatch(params.buffer.data(), blocks * BLOCKSIZE, patch_value, in PerformCommandDiff()
1404 if (ApplyBSDiffPatch(params.buffer.data(), blocks * BLOCKSIZE, patch_value, 0, in PerformCommandDiff()
1421 LOG(INFO) << "skipping " << blocks << " blocks already patched to " << tgt.blocks() << " [" in PerformCommandDiff()
1431 params.written += tgt.blocks(); in PerformCommandDiff()
1461 LOG(INFO) << " erasing " << tgt.blocks() << " blocks"; in PerformCommandErase()
1528 if (!builder.Initialize(static_cast<int64_t>(source_ranges.blocks()) * BLOCKSIZE, salt)) { in PerformCommandComputeHashTree()