12 if (ioctl(0, FIGETBSZ, &bs) < 0)
17 printf("Block size is %d\n", bs);
18 long long len = lseek64(0, 0, SEEK_END);
19 printf("File size is %Ld\n", len);
20 int blx = (len+bs-1)/bs;
21 printf("... that is %d blocks\n", blx);
26 for (blk=0; blk<blx; blk++)
29 if (ioctl(0, FIBMAP, &pos) < 0)
34 printf("%d\t%d\n", blk, pos);
37 if (pos == last_pos+1)
39 else if (pos >= last_pos && pos < last_pos + 1024)
46 printf("Gaps: %d small, %d large\n", small_gaps, large_gaps);