Lines Matching defs:blk
186 static s64 loclogblk(CONTEXT *ctx, unsigned int blk)
193 ((s64)blk << blockbits) >> clusterbits);
196 if (((s64)blk << blockbits) >= logfilesz)
200 + ((s64)blk << blockbits);
2385 static void showheadrcrd(u32 blk, const RECORD_PAGE_HEADER *rph)
2396 if (blk < 4)
2453 static u16 overlapshow(CONTEXT *ctx, u16 k, u32 blk, const struct BUFFER *buf,
2470 if (nextbuf && (blk >= BASEBLKS)) {
2492 (long)blk,(int)space,likely);
2526 midbuf = read_buffer(ctx, blk + i);
2542 midbuf = read_buffer(ctx, blk + skip + 1);
2559 (long)blk,(int)space,likely);
2577 (long)(blk + skip + 1),next);
2581 " after block %d\n",blk);
2593 (int)blk);
2612 static u16 forward_rcrd(CONTEXT *ctx, u32 blk, u16 pos,
2625 showheadrcrd(blk, rph);
2636 (int)pos,(int)blk);
2640 (unsigned long)blk);
2692 k = overlapshow(ctx, k, blk,
2816 static BOOL dorest(CONTEXT *ctx, unsigned long blk,
2865 (long)blk,(long)blk,
2866 (long long)loclogblk(ctx, blk));
2869 printf("restart %ld\n",(long)blk);
2923 int blk;
2927 for (blk=0; blk<BASEBLKS2; blk++)
2928 redirect[blk] = 0;
3316 static u16 dorcrd(CONTEXT *ctx, u32 blk, u16 pos, const struct BUFFER *buf,
3324 (long)blk,(long)blk,
3325 (long long)loclogblk(ctx, blk),(int)pos);
3328 printf("block %ld\n",(long)blk);
3330 return (forward_rcrd(ctx, blk, pos, buf, nextbuf));
3337 static TRISTATE backoverlap(CONTEXT *ctx, int blk,
3373 mblk = blk + 1;
3401 (long)blk,(int)space,(state == T_OK));
3420 (long)size,(long)blk);
3425 (long)blk);
3432 static TRISTATE backward_rcrd(CONTEXT *ctx, u32 blk, int skipped,
3461 if (buf->rnum != blk)
3464 (long)blk,(long)blk,(long)buf->rnum,
3465 (long long)loclogblk(ctx, blk));
3468 (long)blk,(long)blk,
3469 (long long)loclogblk(ctx, blk));
3472 printf("block %ld\n",(long)blk);
3474 showheadrcrd(blk, rph);
3501 (int)blk);
3518 (long)size,(long)blk,(int)k);
3544 if (nextbuf && (blk >= BASEBLKS)) {
3546 state = backoverlap(ctx, blk,
3583 static int walkback(CONTEXT *ctx, const struct BUFFER *buf, u32 blk,
3592 if ((log_major >= 2) && (buf->rnum != blk))
3594 (int)buf->rnum,(int)blk,
3597 printf("\n* block %d at 0x%llx\n",(int)blk,
3598 (long long)loclogblk(ctx, blk));
3604 state = backward_rcrd(ctx, blk, 0, buf,
3607 && !((blk > stopblk) && (prevblk <= stopblk))
3613 blk = prevblk;
3618 if (prevblk < blk)
3619 skipped = blk - prevblk - 1;
3621 skipped = blk - prevblk - 1
3643 (long)blk,
3644 (long long)loclogblk(ctx, blk),
3648 && (buf->rnum != blk))
3651 (long)blk,
3656 (long)blk,
3658 ctx, blk));
3660 state = backward_rcrd(ctx, blk, skipped,
3668 if ((blk > stopblk) && (prevblk <= stopblk))
3759 int blk;
3769 for (blk=RSTBLKS; 2*blk<(RSTBLKS+BASEBLKS2); blk++) {
3772 buf = read_buffer(ctx, blk);
3781 buf = read_buffer(ctx, blk + (BASEBLKS2 - RSTBLKS)/2);
3797 latest_blk = blk;
3802 latest_blk = blk + (BASEBLKS2 - RSTBLKS)/2;
3832 blk = (final_lsn & offset_mask) >> (blockbits - 3);
3834 printf("final lsn %llx in blk %d\n",(long long)final_lsn,blk);
3835 return (blk);
3847 u32 blk;
3866 blk = 0;
3872 printf("\n* block %d at 0x%llx\n",(int)blk,
3873 (long long)loclogblk(ctx, blk));
3879 nextblk = blk + 1;
3905 dirty = dorest(ctx, blk, &buf->block.restart,
3909 if (blk < BASEBLKS)
3911 pos = dorcrd(ctx, blk, pos, buf, nextbuf);
3924 if (nextblk != (blk + 1)) {
3939 if (blk >= RSTBLKS) {
3948 blk = nextblk;
3965 if ((blk >= endblk) && (blk > lastblk))
3969 if (blk*blocksz >= logfilesz)
3975 if (blk >= RSTBLKS)
3978 if (blk >= BASEBLKS)
3983 if (blk >= RSTBLKS && blk < BASEBLKS) {
3998 printf("\n* block %d at 0x%llx\n",(int)blk,
3999 (long long)loclogblk(ctx, blk));
4005 blk = finalblk;
4013 nextbuf = read_buffer(ctx, blk+1);
4016 /* nextbuf is better, show blk */
4019 (int)blk,
4020 (long long)loclogblk(ctx, blk));
4024 showheadrcrd(blk, &buf->block.record);
4026 blk++;
4029 /* buf is better, show blk + 1 */
4032 (int)(blk + 1),
4034 blk + 1));
4038 showheadrcrd(blk + 1,
4044 blk, startbuf);
4049 buf = startbuf = read_buffer(ctx, blk);
4085 err = walkback(ctx, buf, blk,