Lines Matching refs:blocks

376                         size_t blocks, int printerror) {  in VerifyBlocks()  argument
385 SHA_hash(buffer, blocks * BLOCKSIZE, digest); in VerifyBlocks()
556 static int LoadStash(const char* base, const char* id, int verify, int* blocks, uint8_t** buffer, in LoadStash() argument
569 if (!blocks) { in LoadStash()
570 blocks = &blockcount; in LoadStash()
608 *blocks = st.st_size / BLOCKSIZE; in LoadStash()
610 if (verify && VerifyBlocks(id, *buffer, *blocks, 1) != 0) { in LoadStash()
630 static int WriteStash(const char* base, const char* id, int blocks, uint8_t* buffer, in WriteStash() argument
644 if (checkspace && CacheSizeCheck(blocks * BLOCKSIZE) != 0) { in WriteStash()
663 fprintf(stderr, " skipping %d existing blocks in %s\n", blocks, cn); in WriteStash()
672 fprintf(stderr, " writing %d blocks to %s\n", blocks, cn); in WriteStash()
681 if (write_all(fd, buffer, blocks * BLOCKSIZE) == -1) { in WriteStash()
819 int blocks = 0; in SaveStash() local
832 if (usehash && LoadStash(base, id, 1, &blocks, buffer, buffer_alloc, 0) == 0) { in SaveStash()
839 if (LoadSrcTgtVersion1(wordsave, NULL, &blocks, buffer, buffer_alloc, fd) == -1) { in SaveStash()
843 if (usehash && VerifyBlocks(id, *buffer, blocks, 1) != 0) { in SaveStash()
852 fprintf(stderr, "stashing %d blocks to %s\n", blocks, id); in SaveStash()
853 return WriteStash(base, id, blocks, *buffer, 0, NULL); in SaveStash()
883 int blocks = locs->pos[i*2+1] - locs->pos[i*2]; in MoveRange() local
884 start -= blocks; in MoveRange()
886 blocks * BLOCKSIZE); in MoveRange()
1124 int blocks = 0; in PerformCommandMove() local
1135 status = LoadSrcTgtVersion1(&params->cpos, &tgt, &blocks, &params->buffer, in PerformCommandMove()
1138 status = LoadSrcTgtVersion2(&params->cpos, &tgt, &blocks, &params->buffer, in PerformCommandMove()
1141 status = LoadSrcTgtVersion3(params, &tgt, &blocks, 1, &overlap); in PerformCommandMove()
1157 fprintf(stderr, " moving %d blocks\n", blocks); in PerformCommandMove()
1163 fprintf(stderr, "skipping %d already moved blocks\n", blocks); in PerformCommandMove()
1315 int blocks = 0; in PerformCommandDiff() local
1349 status = LoadSrcTgtVersion1(&params->cpos, &tgt, &blocks, &params->buffer, in PerformCommandDiff()
1352 status = LoadSrcTgtVersion2(&params->cpos, &tgt, &blocks, &params->buffer, in PerformCommandDiff()
1355 status = LoadSrcTgtVersion3(params, &tgt, &blocks, 0, &overlap); in PerformCommandDiff()
1371 fprintf(stderr, "patching %d blocks to %d\n", blocks, tgt->size); in PerformCommandDiff()
1387 ApplyImagePatch(params->buffer, blocks * BLOCKSIZE, &patch_value, in PerformCommandDiff()
1390 ApplyBSDiffPatch(params->buffer, blocks * BLOCKSIZE, &patch_value, in PerformCommandDiff()
1400 blocks, tgt->size, logparams); in PerformCommandDiff()
1430 uint64_t blocks[2]; in PerformCommandErase() local
1464 blocks[0] = tgt->pos[i * 2] * (uint64_t) BLOCKSIZE; in PerformCommandErase()
1466 blocks[1] = (tgt->pos[i * 2 + 1] - tgt->pos[i * 2]) * (uint64_t) BLOCKSIZE; in PerformCommandErase()
1468 if (ioctl(params->fd, BLKDISCARD, &blocks) == -1) { in PerformCommandErase()