Lines Matching refs:sectorsize
71 static void speeddisk(int fd, off_t mediasize, u_int sectorsize);
72 static void commandtime(int fd, off_t mediasize, u_int sectorsize);
73 static void iopsbench(int fd, off_t mediasize, u_int sectorsize);
75 static void slogbench(int fd, int isreg, off_t mediasize, u_int sectorsize);
91 u_int sectorsize, fwsectors, fwheads, zoned = 0, isreg; in main() local
168 sectorsize = S_BLKSIZE; in main()
203 error = ioctl(fd, DIOCGSECTORSIZE, §orsize); in main()
227 printf("\t%u", sectorsize); in main()
229 printf("\t%jd", (intmax_t)mediasize/sectorsize); in main()
234 (fwsectors * fwheads * sectorsize)); in main()
242 printf("\t%-12u\t# sectorsize\n", sectorsize); in main()
246 (intmax_t)mediasize/sectorsize); in main()
251 (fwsectors * fwheads * sectorsize)); in main()
276 commandtime(fd, mediasize, sectorsize); in main()
278 speeddisk(fd, mediasize, sectorsize); in main()
280 iopsbench(fd, mediasize, sectorsize); in main()
282 slogbench(fd, isreg, mediasize, sectorsize); in main()
324 rdsect(int fd, off_t blockno, u_int sectorsize) in rdsect() argument
328 if (lseek(fd, (off_t)blockno * sectorsize, SEEK_SET) == -1) in rdsect()
330 error = read(fd, buf, sectorsize); in rdsect()
333 if (error != (int)sectorsize) in rdsect()
416 speeddisk(int fd, off_t mediasize, u_int sectorsize) in speeddisk() argument
425 sectorcount = mediasize / sectorsize; in speeddisk()
443 rdsect(fd, b0, sectorsize); in speeddisk()
445 rdsect(fd, b1, sectorsize); in speeddisk()
455 rdsect(fd, b0, sectorsize); in speeddisk()
457 rdsect(fd, b1, sectorsize); in speeddisk()
466 rdsect(fd, b0, sectorsize); in speeddisk()
468 rdsect(fd, b1, sectorsize); in speeddisk()
477 rdsect(fd, b0, sectorsize); in speeddisk()
486 rdsect(fd, b0, sectorsize); in speeddisk()
495 rdsect(fd, b0, sectorsize); in speeddisk()
504 rdsect(fd, b0, sectorsize); in speeddisk()
511 rdsect(fd, 0, sectorsize); in speeddisk()
519 b0 = sectorcount / 2 - bulk * (1024*1024 / sectorsize) / 2 - 1; in speeddisk()
520 rdsect(fd, b0, sectorsize); in speeddisk()
528 b0 = sectorcount - bulk * (1024*1024 / sectorsize) - 1; in speeddisk()
529 rdsect(fd, b0, sectorsize); in speeddisk()
540 commandtime(int fd, off_t mediasize, u_int sectorsize) in commandtime() argument
547 rdsect(fd, 0, sectorsize); in commandtime()
556 rdsect(fd, 0, sectorsize); in commandtime()
559 rdsect(fd, 0, sectorsize); in commandtime()
571 iops(int fd, off_t mediasize, u_int sectorsize) in iops() argument
578 sectorcount = mediasize / sectorsize; in iops()
583 aiop->aio_buf = malloc(sectorsize); in iops()
593 aiop->aio_offset = (random() % (sectorcount)) * sectorsize; in iops()
594 aiop->aio_nbytes = sectorsize; in iops()
608 if (ret != (ssize_t)sectorsize) in iops()
615 aiop->aio_offset = (random() % (sectorcount)) * sectorsize; in iops()
616 aiop->aio_nbytes = sectorsize; in iops()
632 iopsbench(int fd, off_t mediasize, u_int sectorsize) in iopsbench() argument
637 iops(fd, mediasize, sectorsize); in iopsbench()
639 if (sectorsize != 4096) { in iopsbench()
691 slogbench(int fd, int isreg, off_t mediasize, u_int sectorsize) in slogbench() argument
698 for (size = sectorsize; size <= MAXTX; size *= 2) { in slogbench()