Searched defs:sectorsize (Results 1 - 25 of 49) sorted by relevance

12

/freebsd-head/usr.sbin/fstyp/
H A Dgeli.c45 u_int sectorsize; local
52 error = ioctl(fileno(fp), DIOCGSECTORSIZE, &sectorsize);
55 buf = (u_char *)read_buf(fp, mediasize - sectorsize, sectorsize);
/freebsd-head/sys/geom/
H A Dgeom_slice.h46 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);
H A Dgeom_slice.c357 g_slice_config(struct g_geom *gp, u_int idx, int how, off_t offset, off_t length, u_int sectorsize, const char *fmt, ...) argument
389 gsl->sectorsize = sectorsize;
429 pp->sectorsize = gsl->sectorsize;
H A Dgeom_redboot.c246 int error, sectorsize, i; local
279 sectorsize = cp->provider->sectorsize;
287 __func__, (long) cp->provider->mediasize, sectorsize,
289 if (sectorsize < sizeof(struct fis_image_desc) ||
290 (sectorsize % sizeof(struct fis_image_desc)))
319 fd->offset, fd->size, sectorsize, "redboot/%s", fd->name);
H A Dgeom_map.c139 size_t sectorsize; local
150 sectorsize = cp->provider->sectorsize;
176 buf = g_read_data(cp, rounddown(search_offset, sectorsize),
177 roundup(strlen(search_key), sectorsize), NULL);
195 (search_offset % sectorsize)))[c];
200 if (memcmp(buf + search_offset % sectorsize,
328 dsize, cp->provider->sectorsize, "map/%s", name);
/freebsd-head/sbin/ggate/ggatel/
H A Dggatel.c58 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-head/lib/geom/raid3/
H A Dgeom_raid3.c92 { '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-head/sys/geom/bde/
H A Dg_bde.c122 u_int sectorsize; local
156 sectorsize = cp->provider->sectorsize;
164 mediasize, sectorsize, NULL);
171 kp->keys_per_sector = kp->sectorsize / G_BDE_SKEYLEN;
172 kp->zone_cont = kp->keys_per_sector * kp->sectorsize;
173 kp->zone_width = kp->zone_cont + kp->sectorsize;
175 G_BDE_MAXKEYS * kp->sectorsize;
180 sc->sectorsize = kp->sectorsize;
[all...]
H A Dg_bde_lock.c174 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...]
/freebsd-head/tools/tools/bootparttest/
H A Dbootparttest.c64 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-head/lib/libgeom/
H A Dgeom_util.c109 u_int sectorsize; local
111 if (g_ioctl_arg(fd, DIOCGSECTORSIZE, &sectorsize) == -1)
113 return ((ssize_t)sectorsize);
310 * Let try to get sectorsize, which will prove it is a GEOM provider.
/freebsd-head/stand/userboot/userboot/
H A Duserboot_disk.c44 uint16_t sectorsize; member in struct:userdisk_info
84 u_int sectorsize; local
94 &sectorsize) != 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-head/sbin/geom/misc/
H A Dsubr.c124 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-head/lib/geom/mirror/
H A Dgeom_mirror.c186 unsigned sectorsize; local
225 * Calculate sectorsize by finding least common multiple from
229 sectorsize = 0;
245 if (sectorsize == 0)
246 sectorsize = ssize;
248 sectorsize = g_lcm(sectorsize, ssize);
251 md.md_sectorsize = sectorsize;
/freebsd-head/sbin/newfs/
H A Dnewfs.c100 int sectorsize; /* bytes/sector */ variable
179 rval = expand_number_int(optarg, &sectorsize);
180 if (rval < 0 || sectorsize <= 0)
344 if (sectorsize == 0)
345 sectorsize = 512;
349 if (sectorsize == 0)
350 if (ioctl(disk.d_fd, DIOCGSECTORSIZE, &sectorsize) == -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...]
/freebsd-head/stand/common/
H A Ddisk.c50 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-head/sys/geom/eli/
H A Dg_eli_ctl.c259 intmax_t *keylen, *sectorsize; local
363 sectorsize = gctl_get_paraml(req, "sectorsize", sizeof(*sectorsize));
364 if (sectorsize == NULL) {
365 gctl_error(req, "No '%s' argument.", "sectorsize");
368 if (*sectorsize == 0)
369 md.md_sectorsize = pp->sectorsize;
371 if (*sectorsize < 0 || (*sectorsize
[all...]
/freebsd-head/sys/geom/virstor/
H A Dg_virstor.h92 off_t sectorsize; member in struct:g_virstor_softc
/freebsd-head/sbin/ggate/ggatec/
H A Dggatec.c71 static unsigned sectorsize = 0; variable
83 "[-q queue_size] [-R rcvbuf] [-S sndbuf] [-s sectorsize] "
354 if (sectorsize == 0)
355 sectorsize = sinit.gs_sectorsize;
457 ggioc.gctl_sectorsize = sectorsize;
577 sectorsize = strtoul(optarg, NULL, 10);
578 if (sectorsize == 0 && errno != 0)
579 errx(EXIT_FAILURE, "Invalid sectorsize.");
/freebsd-head/tools/regression/geom/MdLoad/
H A DMdLoad.c62 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-head/sbin/hastd/
H A Dactivemap.c146 uint32_t sectorsize, uint32_t keepdirty)
154 PJDLOG_ASSERT(sectorsize > 0);
155 PJDLOG_ASSERT(powerof2(sectorsize));
168 amp->am_diskmapsize = roundup2(amp->am_mapsize, sectorsize);
546 uint32_t sectorsize)
553 PJDLOG_ASSERT(sectorsize > 0);
554 PJDLOG_ASSERT(powerof2(sectorsize));
558 return (roundup2(mapsize, sectorsize));
145 activemap_init(struct activemap **ampp, uint64_t mediasize, uint32_t extentsize, uint32_t sectorsize, uint32_t keepdirty) argument
545 activemap_calc_ondisk_size(uint64_t mediasize, uint32_t extentsize, uint32_t sectorsize) argument
/freebsd-head/sys/dev/flash/
H A Dat45d.c307 int sectorsize; local
351 sectorsize = pagesize;
356 "freebsd,sectorsize", &size, sizeof(size)) > 0)
357 sectorsize = size;
361 "sectorsize", &sectorsize);
363 if ((sectorsize % pagesize) != 0) {
364 device_printf(sc->dev, "Invalid sectorsize %d, "
365 "must be a multiple of %d\n", sectorsize, pagesize);
379 sc->disk->d_sectorsize = sectorsize;
[all...]
H A Dn25q.c80 * Define the sectorsize to be a smaller size rather than the flash
90 unsigned int sectorsize; member in struct:n25q_flash_ident
224 * Enforce the disk read sectorsize not the erase sectorsize.
309 sc->sc_disk->d_mediasize = (ident->sectorsize * ident->sectorcount);
313 sc->sc_sectorsize = ident->sectorsize;
323 sc->sc_disk->d_stripesize = ident->sectorsize;
332 ident->name, ident->sectorsize, ident->sectorcount);
/freebsd-head/usr.sbin/makefs/ffs/
H A Dmkfs.c102 static int sectorsize; /* bytes/sector */ variable
130 fssize = fsopts->size / fsopts->sectorsize;
131 sectorsize = fsopts->sectorsize;
168 ffs_wtfs(fssize - 1, sectorsize, (char *)&sblock, fsopts);
196 if (sblock.fs_fsize < sectorsize) {
198 sblock.fs_fsize, sectorsize);
253 sblock.fs_fsbtodb = ilog2(sblock.fs_fsize / sectorsize);
270 sblock.fs_old_nspf = sblock.fs_fsize / sectorsize;
556 ffs_wtfs(fs->fs_sblockloc / sectorsize, sbsiz
[all...]
/freebsd-head/sys/geom/shsec/
H A Dg_shsec.c401 u_int no, sectorsize = 0; local
411 mediasize -= sc->sc_disks[0]->provider->sectorsize;
412 sectorsize = sc->sc_disks[0]->provider->sectorsize;
415 ms -= sc->sc_disks[no]->provider->sectorsize;
418 sectorsize = lcm(sectorsize,
419 sc->sc_disks[no]->provider->sectorsize);
421 sc->sc_provider->sectorsize = sectorsize;
[all...]

Completed in 131 milliseconds

12