Lines Matching defs:offset

329 void check_buffers(unsigned offset, unsigned size)
337 if (memcmp(good_buf + offset, temp_buf, size) != 0) {
338 prt("READ BAD DATA: offset = 0x%x, size = 0x%x\n",
339 offset, size);
342 c = good_buf[offset];
347 prt("%#07x\t%#06x\t%#06x", offset,
348 short_at(&good_buf[offset]), bad);
349 op = temp_buf[offset & 1 ? i + 1 : i];
352 badoff = offset;
354 offset++;
552 output_line(struct test_file *tf, int op, unsigned offset,
570 (offset + size > monitorstart &&
571 (monitorend == -1 || offset <= monitorend)))))))
580 offset, op == OP_TRUNCATE ? " to " : "thru",
581 offset + size - 1, size);
584 void doread(unsigned offset, unsigned size)
592 offset -= offset % readbdy;
597 log4(OP_SKIPPED, OP_READ, offset, size, &t);
600 if (size + offset > file_size) {
603 log4(OP_SKIPPED, OP_READ, offset, size, &t);
607 log4(OP_READ, offset, size, 0, &t);
612 output_line(tf, OP_READ, offset, size, &t);
614 ret = lseek(fd, (off_t) offset, SEEK_SET);
622 (offset + size > monitorstart &&
623 (monitorend == -1 || offset <= monitorend))))) {
635 check_buffers(offset, size);
638 void domapread(unsigned offset, unsigned size)
647 offset -= offset % readbdy;
652 log4(OP_SKIPPED, OP_MAPREAD, offset, size, &t);
655 if (size + offset > file_size) {
658 log4(OP_SKIPPED, OP_MAPREAD, offset, size, &t);
662 log4(OP_MAPREAD, offset, size, 0, &t);
667 output_line(tf, OP_MAPREAD, offset, size, &t);
669 pg_offset = offset & page_mask;
673 (off_t) (offset - pg_offset))) == MAP_FAILED) {
679 (offset + size > monitorstart &&
680 (monitorend == -1 || offset <= monitorend))))) {
687 (offset + size > monitorstart &&
688 (monitorend == -1 || offset <= monitorend))))) {
698 (offset + size > monitorstart &&
699 (monitorend == -1 || offset <= monitorend))))) {
704 check_buffers(offset, size);
707 void gendata(char *original_buf, char *good_buf, unsigned offset, unsigned size)
710 good_buf[offset] = testcalls % 256;
711 if (offset % 2)
712 good_buf[offset] += original_buf[offset];
713 offset++;
717 void dowrite(unsigned offset, unsigned size)
725 offset -= offset % writebdy;
730 log4(OP_SKIPPED, OP_WRITE, offset, size, &t);
734 log4(OP_WRITE, offset, size, file_size, &t);
736 gendata(original_buf, good_buf, offset, size);
737 if (file_size < offset + size) {
738 if (file_size < offset)
739 memset(good_buf + file_size, '\0', offset - file_size);
740 file_size = offset + size;
750 output_line(tf, OP_WRITE, offset, size, &t);
752 ret = lseek(fd, (off_t) offset, SEEK_SET);
757 iret = write(fd, good_buf + offset, size);
760 (offset + size > monitorstart &&
761 (monitorend == -1 || offset <= monitorend))))) {
775 void domapwrite(unsigned offset, unsigned size)
785 offset -= offset % writebdy;
790 log4(OP_SKIPPED, OP_MAPWRITE, offset, size, &t);
795 log4(OP_MAPWRITE, offset, size, 0, &t);
797 gendata(original_buf, good_buf, offset, size);
798 if (file_size < offset + size) {
799 if (file_size < offset)
800 memset(good_buf + file_size, '\0', offset - file_size);
801 file_size = offset + size;
811 output_line(tf, OP_MAPWRITE, offset, size, &t);
820 (offset + size > monitorstart &&
822 || offset <= monitorend))))) {
828 pg_offset = offset & page_mask;
833 fd, (off_t) (offset - pg_offset))) == MAP_FAILED) {
839 (offset + size > monitorstart &&
840 (monitorend == -1 || offset <= monitorend))))) {
844 memcpy(p + pg_offset, good_buf + offset, size);
847 (offset + size > monitorstart &&
848 (monitorend == -1 || offset <= monitorend))))) {
858 (offset + size > monitorstart &&
859 (monitorend == -1 || offset <= monitorend))))) {
869 (offset + size > monitorstart &&
870 (monitorend == -1 || offset <= monitorend))))) {
973 unsigned long offset;
1009 offset = random();
1011 offset %= maxfilelen;
1012 if (offset + size > maxfilelen)
1013 size = maxfilelen - offset;
1015 domapwrite(offset, size);
1017 dowrite(offset, size);
1020 offset %= file_size;
1022 offset = 0;
1023 if (offset + size > file_size)
1024 size = file_size - offset;
1026 domapread(offset, size);
1028 doread(offset, size);