/freebsd-13-stable/usr.sbin/fstyp/ |
H A D | geli.c | 45 u_int sectorsize; local 52 error = ioctl(fileno(fp), DIOCGSECTORSIZE, §orsize); 55 buf = (u_char *)read_buf(fp, mediasize - sectorsize, sectorsize);
|
/freebsd-13-stable/sbin/geom/misc/ |
H A D | subr.c | 124 g_parse_lba(const char *lbastr, unsigned int sectorsize, off_t *sectors) argument 130 assert(sectorsize > 0); 138 unit = sectorsize; 170 unit = sectorsize; /* sector */ 185 if (number % sectorsize) 187 number /= sectorsize; 211 ssize_t sectorsize; local 217 sectorsize = g_sectorsize(fd); 218 if (sectorsize == -1) 219 sectorsize 230 ssize_t sectorsize; local 287 ssize_t sectorsize; local 333 ssize_t sectorsize; local [all...] |
/freebsd-13-stable/usr.sbin/diskinfo/ |
H A D | diskinfo.c | 70 static void speeddisk(int fd, off_t mediasize, u_int sectorsize); 71 static void commandtime(int fd, off_t mediasize, u_int sectorsize); 72 static void iopsbench(int fd, off_t mediasize, u_int sectorsize); 74 static void slogbench(int fd, int isreg, off_t mediasize, u_int sectorsize); 90 u_int sectorsize, fwsectors, fwheads, zoned = 0, isreg; local 164 sectorsize = S_BLKSIZE; 196 error = ioctl(fd, DIOCGSECTORSIZE, §orsize); 220 printf("\t%u", sectorsize); 222 printf("\t%jd", (intmax_t)mediasize/sectorsize); 227 (fwsectors * fwheads * sectorsize)); 317 rdsect(int fd, off_t blockno, u_int sectorsize) argument 409 speeddisk(int fd, off_t mediasize, u_int sectorsize) argument 534 commandtime(int fd, off_t mediasize, u_int sectorsize) argument 566 iops(int fd, off_t mediasize, u_int sectorsize) argument 629 iopsbench(int fd, off_t mediasize, u_int sectorsize) argument 688 slogbench(int fd, int isreg, off_t mediasize, u_int sectorsize) argument [all...] |
/freebsd-13-stable/tests/sys/geom/class/raid3/ |
H A D | 1_test.sh | 23 sectorsize=`diskinfo /dev/raid3/${name} | awk '{print $2}'` 24 if [ $sectorsize -eq 1024 ]; then
|
/freebsd-13-stable/tests/sys/geom/class/shsec/ |
H A D | 1_test.sh | 23 sectorsize=`diskinfo /dev/shsec/${name} | awk '{print $2}'` 24 if [ $sectorsize -eq 512 ]; then
|
/freebsd-13-stable/tools/tools/bootparttest/ |
H A D | bootparttest.c | 64 uint16_t sectorsize; member in struct:disk 84 (blk + dev->d_offset) * disk.sectorsize); 110 disk.sectorsize = 512; 117 disk.sectorsize = g_sectorsize(disk.fd); 125 disk.mediasize, disk.mediasize / disk.sectorsize, disk.sectorsize); 127 if (disk_open(&dev, disk.mediasize, disk.sectorsize) != 0)
|
/freebsd-13-stable/sbin/newfs/ |
H A D | newfs.c | 100 int sectorsize; /* bytes/sector */ variable 179 rval = expand_number_int(optarg, §orsize); 180 if (rval < 0 || sectorsize <= 0) 344 if (sectorsize == 0) 345 sectorsize = 512; 349 if (sectorsize == 0) 350 if (ioctl(disk.d_fd, DIOCGSECTORSIZE, §orsize) == -1) 351 sectorsize = 0; /* back out on error for safety */ 352 if (sectorsize && ioctl(disk.d_fd, DIOCGMEDIASIZE, &mediasize) != -1) 353 getfssize(&fssize, special, mediasize / sectorsize, reserve [all...] |
H A D | newfs.h | 49 * sectorsize <= DESFRAGSIZE <= DESBLKSIZE 94 extern int sectorsize; /* bytes/sector */
|
/freebsd-13-stable/sys/geom/bde/ |
H A D | g_bde_crypt.c | 131 for (n = 0; o < wp->length; n++, o += sc->sectorsize) { 137 AES_decrypt(&ci, &ki, d, d, sc->sectorsize); 165 for (n = 0; o < wp->length; n++, o += sc->sectorsize) { 170 AES_encrypt(&ci, &ki, s, d, sc->sectorsize); 209 * sectorsize is far more likely to be in the same range. 211 for (o = 0; o < wp->length; o += sc->sectorsize) { 212 arc4rand(d, sc->sectorsize, 0); 215 AES_encrypt(&ci, &ki, d, d, sc->sectorsize); 216 d += sc->sectorsize; 285 wp->ko = (zoff / kp->sectorsize) * G_BDE_SKEYLE [all...] |
H A D | g_bde_lock.c | 174 le32enc(p, gl->sectorsize); 244 gl->sectorsize = le32dec(p); 356 g_bde_decrypt_lockx(struct g_bde_softc *sc, u_char *meta, off_t mediasize, u_int sectorsize, u_int *nkey) argument 381 if (off % sectorsize > sectorsize - G_BDE_LOCKSIZE) 386 off - (off % sectorsize), 387 m * sectorsize, &error); 394 q = buf + off % sectorsize; 422 bzero(buf, sectorsize * m); 446 g_bde_decrypt_lock(struct g_bde_softc *sc, u_char *keymat, u_char *meta, off_t mediasize, u_int sectorsize, u_in argument [all...] |
H A D | g_bde.c | 122 u_int sectorsize; local 162 sectorsize = cp->provider->sectorsize; 170 mediasize, sectorsize, NULL); 177 kp->keys_per_sector = kp->sectorsize / G_BDE_SKEYLEN; 178 kp->zone_cont = kp->keys_per_sector * kp->sectorsize; 179 kp->zone_width = kp->zone_cont + kp->sectorsize; 181 G_BDE_MAXKEYS * kp->sectorsize; 186 sc->sectorsize = kp->sectorsize; [all...] |
/freebsd-13-stable/stand/common/ |
H A D | disk.c | 50 u_int sectorsize; member in struct:open_disk 61 display_size(uint64_t size, u_int sectorsize) argument 66 size = size * sectorsize / 1024; 96 offset *= (od->sectorsize / 512); 102 blocks * od->sectorsize, (char *)buf, NULL)); 119 sectsize = od->sectorsize; 186 blocks * od->sectorsize, buf, NULL); 199 blocks * od->sectorsize, buf, NULL); 214 *(u_int *)data = od->sectorsize; 220 *(uint64_t *)data = od->entrysize * od->sectorsize; 230 disk_open(struct disk_devdesc *dev, uint64_t mediasize, u_int sectorsize) argument [all...] |
/freebsd-13-stable/tools/regression/geom/MdLoad/ |
H A D | MdLoad.c | 62 int sectorsize; member in struct:simdisk_softc 102 sc->sp = calloc(1, sizeof(*sc->sp) + sc->sectorsize); 124 if (!strcasecmp(name, "sectorsize")) { 125 sc->sectorsize = strtoul(sbuf_data(sc->sbuf), &p, 0); 127 errx(1, "strtoul croaked on sectorsize"); 152 memset(sc->sp->data, j, sc->sectorsize); 156 for (i = 0; i < sc->sectorsize; i++) { 244 sc->mediasize = sc->lastsector + sc->sectorsize * 10; 245 if (sc->sectorsize == 0) 246 sc->sectorsize [all...] |
/freebsd-13-stable/sys/geom/part/ |
H A D | g_part_apm.c | 197 buf = g_read_data(cp, pp->sectorsize * blk, pp->sectorsize, &error); 201 swab(buf, pp->sectorsize); 262 if (pp->sectorsize != 512 || 263 pp->mediasize < (2 + 2 * basetable->gpt_entries) * pp->sectorsize) 267 last = MIN(pp->mediasize / pp->sectorsize, UINT32_MAX) - 1; 273 table->ddr.ddr_blksize = pp->sectorsize; 369 basetable->gpt_last = MIN(pp->mediasize / pp->sectorsize, 407 if (pp->mediasize < 4 * pp->sectorsize) 411 buf = g_read_data(cp, 0L, pp->sectorsize, [all...] |
H A D | g_part_bsd64.c | 318 blksize = pp->sectorsize < BLKSIZE ? BLKSIZE: pp->sectorsize; 342 table->d_bbase = ressize / pp->sectorsize; 344 ~blkmask) / pp->sectorsize; 346 basetable->gpt_first = pbase / pp->sectorsize; 363 if (pp->sectorsize > offsetof(struct disklabel64, d_magic)) 453 rounddown2(pp->mediasize - table->d_bbase * pp->sectorsize, 454 table->d_align) / pp->sectorsize; 482 v = rounddown2(pp->sectorsize + offsetof(struct disklabel64, d_magic), 483 pp->sectorsize); [all...] |
H A D | g_part_gpt.c | 344 MIN(pp->mediasize / pp->sectorsize - 1, UINT32_MAX)); 443 last = (pp->mediasize / pp->sectorsize) - 1; 454 buf = g_read_data(cp, table->lba[elt] * pp->sectorsize, pp->sectorsize, 464 if (sz < 92 || sz > pp->sectorsize) 511 howmany(hdr->hdr_entries * hdr->hdr_entsz, pp->sectorsize) - 1; 553 sectors = howmany(tblsz, pp->sectorsize); 554 buf = g_malloc(sectors * pp->sectorsize, M_WAITOK | M_ZERO); 555 for (idx = 0; idx < sectors; idx += maxphys / pp->sectorsize) { 556 size = (sectors - idx > maxphys / pp->sectorsize) [all...] |
/freebsd-13-stable/sbin/hastd/ |
H A D | activemap.h | 43 uint32_t extentsize, uint32_t sectorsize, uint32_t keepdirty); 62 uint32_t sectorsize);
|
/freebsd-13-stable/sys/geom/ |
H A D | geom_slice.h | 46 u_int sectorsize; member in struct:g_slice 74 int g_slice_config(struct g_geom *gp, u_int idx, int how, off_t offset, off_t length, u_int sectorsize, const char *fmt, ...) __printflike(7, 8);
|
/freebsd-13-stable/sys/geom/label/ |
H A D | g_label_ext2fs.c | 65 if ((EXT2FS_SB_OFFSET % pp->sectorsize) != 0) 68 fs = (e2sb_t *)g_read_data(cp, EXT2FS_SB_OFFSET, pp->sectorsize, NULL);
|
H A D | g_label_iso9660.c | 55 if ((ISO9660_OFFSET % pp->sectorsize) != 0) 57 sector = (char *)g_read_data(cp, ISO9660_OFFSET, pp->sectorsize,
|
/freebsd-13-stable/stand/userboot/userboot/ |
H A D | userboot_disk.c | 44 uint16_t sectorsize; member in struct:userdisk_info 84 u_int sectorsize; local 94 §orsize) != 0 || CALLBACK(diskioctl, i, 98 ud_info[i].sectorsize = sectorsize; 143 ud_info[i].sectorsize) == 0) { 173 ud_info[dev->dd.d_unit].sectorsize)); 216 off = dblk * ud_info[dev->dd.d_unit].sectorsize;
|
/freebsd-13-stable/lib/geom/raid3/ |
H A D | geom_raid3.c | 92 { 's', "sectorsize", "0", G_TYPE_NUMBER }, 149 unsigned sectorsize, ssize; local 193 * Calculate sectorsize by finding least common multiple from 197 sectorsize = gctl_get_intmax(req, "sectorsize"); 210 if (sectorsize == 0) 211 sectorsize = ssize; 213 sectorsize = g_lcm(sectorsize, ssize); 216 md.md_sectorsize = sectorsize * (narg [all...] |
/freebsd-13-stable/sbin/gbde/ |
H A D | gbde.c | 326 u_int sectorsize; local 330 error = ioctl(dfd, DIOCGSECTORSIZE, §orsize); 332 sectorsize = 512; 354 sectorsize, nkey); 375 sbuf = malloc(gl->sectorsize); 376 memset(sbuf, 0, gl->sectorsize); 377 offset = (gl->lsector[key] & ~(gl->sectorsize - 1)); 381 i = write(dfd, sbuf, gl->sectorsize); 383 if (i != (int)gl->sectorsize) 397 sbuf = malloc(gl->sectorsize); [all...] |
/freebsd-13-stable/sbin/ggate/ggatel/ |
H A D | ggatel.c | 58 static unsigned sectorsize = 0; variable 66 "[-s sectorsize] [-t timeout] [-u unit] <path>\n", getprogname()); 100 bsize = sectorsize; 182 if (sectorsize == 0) 183 sectorsize = g_gate_sectorsize(fd); 184 ggioc.gctl_sectorsize = sectorsize; 262 sectorsize = strtoul(optarg, NULL, 10); 263 if (sectorsize == 0 && errno != 0) 264 errx(EXIT_FAILURE, "Invalid sectorsize.");
|
/freebsd-13-stable/usr.sbin/makefs/ |
H A D | msdos.c | 165 if (fsopts->sectorsize == -1) 166 fsopts->sectorsize = 512; 167 msdos_opt->options.bytes_per_sector = fsopts->sectorsize; 168 } else if (fsopts->sectorsize == -1) { 169 fsopts->sectorsize = msdos_opt->options.bytes_per_sector; 170 } else if (fsopts->sectorsize != msdos_opt->options.bytes_per_sector) { 171 err(1, "inconsistent sectorsize -S %u" 173 fsopts->sectorsize, msdos_opt->options.bytes_per_sector);
|