Lines Matching refs:tgt
152 RangeSinkWriter(int fd, const RangeSet& tgt)
154 tgt_(tgt),
158 CHECK_NE(tgt.size(), static_cast<size_t>(0));
405 static int WriteBlocks(const RangeSet& tgt, const std::vector<uint8_t>& buffer, int fd) {
407 for (const auto& range : tgt) {
906 * tgt is the target RangeSet for detecting overlaps. Any stashes required are loaded using
909 static int LoadSourceBlocks(CommandParameters& params, const RangeSet& tgt, size_t* src_blocks,
929 *overlap = src.Overlaps(tgt);
995 static int LoadSrcTgtVersion3(CommandParameters& params, RangeSet& tgt, size_t* src_blocks,
1026 tgt = RangeSet::Parse(params.tokens[params.cpos++]);
1028 tgt.blocks() * BLOCKSIZE);
1029 if (ReadBlocks(tgt, tgtbuffer, params.fd) == -1) {
1034 if (VerifyBlocks(tgthash, tgtbuffer, tgt.blocks(), false) == 0) {
1039 if (LoadSourceBlocks(params, tgt, src_blocks, overlap) == -1) {
1087 RangeSet tgt;
1088 int status = LoadSrcTgtVersion3(params, tgt, &blocks, true, &overlap);
1105 if (WriteBlocks(tgt, params.buffer, params.fd) == -1) {
1118 params.written += tgt.blocks();
1188 RangeSet tgt = RangeSet::Parse(params.tokens[params.cpos++]);
1190 LOG(INFO) << " zeroing " << tgt.blocks() << " blocks";
1196 for (const auto& range : tgt) {
1218 params.written += tgt.blocks();
1230 RangeSet tgt = RangeSet::Parse(params.tokens[params.cpos++]);
1233 LOG(INFO) << " writing " << tgt.blocks() << " blocks of new data";
1236 params.nti.writer = std::make_unique<RangeSinkWriter>(params.fd, tgt);
1241 LOG(ERROR) << "missing " << (tgt.blocks() * BLOCKSIZE - params.nti.writer->BytesWritten())
1252 params.written += tgt.blocks();
1276 RangeSet tgt;
1279 int status = LoadSrcTgtVersion3(params, tgt, &blocks, false, &overlap);
1294 LOG(INFO) << "patching " << blocks << " blocks to " << tgt.blocks();
1298 RangeSinkWriter writer(params.fd, tgt);
1319 // We expect the output of the patcher to fill the tgt ranges exactly.
1324 LOG(INFO) << "skipping " << blocks << " blocks already patched to " << tgt.blocks() << " ["
1334 params.written += tgt.blocks();
1360 RangeSet tgt = RangeSet::Parse(params.tokens[params.cpos++]);
1363 LOG(INFO) << " erasing " << tgt.blocks() << " blocks";
1365 for (const auto& range : tgt) {