Lines Matching refs:BLOCKSIZE

75 static constexpr size_t BLOCKSIZE = 4096;  variable
249 return tgt_.blocks() * BLOCKSIZE - bytes_written_; in AvailableSpace()
306 off64_t offset = static_cast<off64_t>(range.first) * BLOCKSIZE; in SeekToOutputRange()
307 current_range_left_ = (range.second - range.first) * BLOCKSIZE; in SeekToOutputRange()
485 if (!check_lseek(fd, static_cast<off64_t>(begin) * BLOCKSIZE, SEEK_SET)) { in ReadBlocks()
489 size_t size = (end - begin) * BLOCKSIZE; in ReadBlocks()
505 off64_t offset = static_cast<off64_t>(begin) * BLOCKSIZE; in WriteBlocks()
506 size_t size = (end - begin) * BLOCKSIZE; in WriteBlocks()
608 CHECK_LE((buffer_index + 1) * BLOCKSIZE, buffer.size()); in PrintHashForCorruptedSourceBlocks()
611 SHA1(buffer.data() + buffer_index * BLOCKSIZE, BLOCKSIZE, digest); in PrintHashForCorruptedSourceBlocks()
623 CHECK_EQ(src.blocks() * BLOCKSIZE, buffer.size()); in PrintHashForCorruptedStashedBlocks()
629 SHA1(buffer.data() + i * BLOCKSIZE, BLOCKSIZE, digest); in PrintHashForCorruptedStashedBlocks()
645 std::vector<uint8_t> buffer(src.blocks() * BLOCKSIZE); in PrintHashForMissingStashedBlocks()
658 SHA1(data, blocks * BLOCKSIZE, digest); in VerifyBlocks()
742 allocate(src.blocks() * BLOCKSIZE, buffer); in LoadStash()
772 if ((sb.st_size % BLOCKSIZE) != 0) { in LoadStash()
773 LOG(ERROR) << fn << " size " << sb.st_size << " not multiple of block size " << BLOCKSIZE; in LoadStash()
792 size_t blocks = sb.st_size / BLOCKSIZE; in LoadStash()
815 if (checkspace && !CheckAndFreeSpaceOnCache(blocks * BLOCKSIZE)) { in WriteStash()
854 if (!android::base::WriteFully(fd, buffer.data(), blocks * BLOCKSIZE)) { in WriteStash()
856 PLOG(ERROR) << "Failed to write " << blocks * BLOCKSIZE << " bytes of data"; in WriteStash()
892 size_t max_stash_size = maxblocks * BLOCKSIZE; in CreateStash()
972 memmove(to + (it->first * BLOCKSIZE), from + (start * BLOCKSIZE), blocks * BLOCKSIZE); in MoveRange()
1005 allocate(*src_blocks * BLOCKSIZE, &params.buffer); in LoadSourceBlocks()
1115 std::vector<uint8_t> tgtbuffer(tgt->blocks() * BLOCKSIZE); in LoadSrcTgtVersion3()
1231 allocate(blocks * BLOCKSIZE, &params.buffer); in PerformCommandStash()
1286 allocate(BLOCKSIZE, &params.buffer); in PerformCommandZero()
1287 memset(params.buffer.data(), 0, BLOCKSIZE); in PerformCommandZero()
1291 off64_t offset = static_cast<off64_t>(begin) * BLOCKSIZE; in PerformCommandZero()
1292 size_t size = (end - begin) * BLOCKSIZE; in PerformCommandZero()
1302 if (!android::base::WriteFully(params.fd, params.buffer.data(), BLOCKSIZE)) { in PerformCommandZero()
1304 PLOG(ERROR) << "Failed to write " << BLOCKSIZE << " bytes of data"; in PerformCommandZero()
1338 LOG(ERROR) << "missing " << (tgt.blocks() * BLOCKSIZE - params.nti.writer->BytesWritten()) in PerformCommandNew()
1400 if (ApplyImagePatch(params.buffer.data(), blocks * BLOCKSIZE, patch_value, in PerformCommandDiff()
1409 if (ApplyBSDiffPatch(params.buffer.data(), blocks * BLOCKSIZE, patch_value, 0, in PerformCommandDiff()
1469 off64_t offset = static_cast<off64_t>(begin) * BLOCKSIZE; in PerformCommandErase()
1470 size_t size = (end - begin) * BLOCKSIZE; in PerformCommandErase()
1532 HashTreeBuilder builder(BLOCKSIZE, hash_function); in PerformCommandComputeHashTree()
1533 if (!builder.Initialize(static_cast<int64_t>(source_ranges.blocks()) * BLOCKSIZE, salt)) { in PerformCommandComputeHashTree()
1542 uint8_t buffer[BLOCKSIZE]; in PerformCommandComputeHashTree()
1543 if (!check_lseek(params.fd, static_cast<off64_t>(begin) * BLOCKSIZE, SEEK_SET)) { in PerformCommandComputeHashTree()
1549 if (!android::base::ReadFully(params.fd, buffer, BLOCKSIZE)) { in PerformCommandComputeHashTree()
1555 if (!builder.Update(reinterpret_cast<unsigned char*>(buffer), BLOCKSIZE)) { in PerformCommandComputeHashTree()
1574 uint64_t write_offset = static_cast<uint64_t>(hash_tree_ranges.GetBlockNumber(0)) * BLOCKSIZE; in PerformCommandComputeHashTree()
1927 static_cast<uint64_t>(params.written) * BLOCKSIZE)); in PerformBlockImageUpdate()
1930 static_cast<uint64_t>(params.stashed) * BLOCKSIZE), in PerformBlockImageUpdate()
2112 std::vector<uint8_t> buffer(BLOCKSIZE); in RangeSha1Fn()
2114 if (!check_lseek(fd, static_cast<off64_t>(begin) * BLOCKSIZE, SEEK_SET)) { in RangeSha1Fn()
2121 if (!android::base::ReadFully(fd, buffer.data(), BLOCKSIZE)) { in RangeSha1Fn()
2128 SHA1_Update(&ctx, buffer.data(), BLOCKSIZE); in RangeSha1Fn()
2178 std::vector<uint8_t> block0_buffer(BLOCKSIZE); in CheckFirstBlockFn()
2267 uint8_t buffer[BLOCKSIZE]; in BlockImageRecoverFn()
2271 if (status.data_size <= static_cast<uint64_t>(j) * BLOCKSIZE) { in BlockImageRecoverFn()
2275 if (fh.pread(buffer, BLOCKSIZE, static_cast<off64_t>(j) * BLOCKSIZE) != BLOCKSIZE) { in BlockImageRecoverFn()