Lines Matching refs:tgt

235   RangeSinkWriter(int fd, const RangeSet& tgt)  in RangeSinkWriter()  argument
237 tgt_(tgt), in RangeSinkWriter()
241 CHECK_NE(tgt.size(), static_cast<size_t>(0)); in RangeSinkWriter()
502 static int WriteBlocks(const RangeSet& tgt, const std::vector<uint8_t>& buffer, int fd) { in WriteBlocks() argument
504 for (const auto& [begin, end] : tgt) { in WriteBlocks()
993 static int LoadSourceBlocks(CommandParameters& params, const RangeSet& tgt, size_t* src_blocks, in LoadSourceBlocks() argument
1014 *overlap = src.Overlaps(tgt); in LoadSourceBlocks()
1082 static int LoadSrcTgtVersion3(CommandParameters& params, RangeSet* tgt, size_t* src_blocks, in LoadSrcTgtVersion3() argument
1112 *tgt = RangeSet::Parse(params.tokens[params.cpos++]); in LoadSrcTgtVersion3()
1113 CHECK(static_cast<bool>(*tgt)); in LoadSrcTgtVersion3()
1115 std::vector<uint8_t> tgtbuffer(tgt->blocks() * BLOCKSIZE); in LoadSrcTgtVersion3()
1116 if (ReadBlocks(*tgt, &tgtbuffer, params.fd) == -1) { in LoadSrcTgtVersion3()
1121 if (VerifyBlocks(tgthash, tgtbuffer, tgt->blocks(), false) == 0) { in LoadSrcTgtVersion3()
1127 if (LoadSourceBlocks(params, *tgt, src_blocks, &overlap) == -1) { in LoadSrcTgtVersion3()
1174 RangeSet tgt; in PerformCommandMove() local
1175 int status = LoadSrcTgtVersion3(params, &tgt, &blocks, true); in PerformCommandMove()
1195 if (WriteBlocks(tgt, params.buffer, params.fd) == -1) { in PerformCommandMove()
1208 params.written += tgt.blocks(); in PerformCommandMove()
1281 RangeSet tgt = RangeSet::Parse(params.tokens[params.cpos++]); in PerformCommandZero() local
1282 CHECK(static_cast<bool>(tgt)); in PerformCommandZero()
1284 LOG(INFO) << " zeroing " << tgt.blocks() << " blocks"; in PerformCommandZero()
1290 for (const auto& [begin, end] : tgt) { in PerformCommandZero()
1314 params.written += tgt.blocks(); in PerformCommandZero()
1326 RangeSet tgt = RangeSet::Parse(params.tokens[params.cpos++]); in PerformCommandNew() local
1327 CHECK(static_cast<bool>(tgt)); in PerformCommandNew()
1330 LOG(INFO) << " writing " << tgt.blocks() << " blocks of new data"; in PerformCommandNew()
1333 params.nti.writer = std::make_unique<RangeSinkWriter>(params.fd, tgt); in PerformCommandNew()
1338 LOG(ERROR) << "missing " << (tgt.blocks() * BLOCKSIZE - params.nti.writer->BytesWritten()) in PerformCommandNew()
1349 params.written += tgt.blocks(); in PerformCommandNew()
1373 RangeSet tgt; in PerformCommandDiff() local
1375 int status = LoadSrcTgtVersion3(params, &tgt, &blocks, false); in PerformCommandDiff()
1393 LOG(INFO) << "patching " << blocks << " blocks to " << tgt.blocks(); in PerformCommandDiff()
1398 RangeSinkWriter writer(params.fd, tgt); in PerformCommandDiff()
1426 LOG(INFO) << "skipping " << blocks << " blocks already patched to " << tgt.blocks() << " [" in PerformCommandDiff()
1436 params.written += tgt.blocks(); in PerformCommandDiff()
1462 RangeSet tgt = RangeSet::Parse(params.tokens[params.cpos++]); in PerformCommandErase() local
1463 CHECK(static_cast<bool>(tgt)); in PerformCommandErase()
1466 LOG(INFO) << " erasing " << tgt.blocks() << " blocks"; in PerformCommandErase()
1468 for (const auto& [begin, end] : tgt) { in PerformCommandErase()