Lines Matching defs:vtoc
37 #include <sys/vtoc.h>
42 * To copy each field of vtoc individually for copying extvtoc
43 * to 32 bit vtoc and vs.
81 read_vtoc(int fd, struct vtoc *vtoc)
86 * Read the vtoc.
88 if (ioctl(fd, DKIOCGVTOC, (caddr_t)vtoc) == -1) {
105 * Sanity-check the vtoc.
107 if (vtoc->v_sanity != VTOC_SANE) {
112 * Convert older-style vtoc's.
114 switch (vtoc->v_version) {
117 * No vtoc information. Install default
123 vtoc->v_version = V_VERSION;
124 if (vtoc->v_nparts == 0)
125 vtoc->v_nparts = V_NUMPAR;
126 if (vtoc->v_sectorsz == 0)
127 vtoc->v_sectorsz = DEV_BSIZE;
161 write_vtoc(int fd, struct vtoc *vtoc)
165 * Sanity-check the vtoc
167 if (vtoc->v_sanity != VTOC_SANE || vtoc->v_nparts > V_NUMPAR) {
177 for (i = 0; i < (int)vtoc->v_nparts; i++)
178 if (vtoc->v_part[i].p_size > 0)
180 if (i == (int)vtoc->v_nparts)
184 * Write the vtoc
186 if (ioctl(fd, DKIOCSVTOC, (caddr_t)vtoc) == -1) {
208 struct vtoc oldvtoc;
209 struct vtoc *oldvtocp = &oldvtoc;
213 * Read the vtoc.
233 * 64-bit vtoc and extvtoc have the same field sizes
250 * Sanity-check the vtoc.
259 * For pre-version 1 vtoc keep same functionality
304 struct vtoc oldvtoc;
305 struct vtoc *oldvtocp = &oldvtoc;
307 * Sanity-check the vtoc
342 * 64-bit vtoc and extvtoc have the same field sizes
345 bcopy(extvtoc, oldvtocp, sizeof (struct vtoc));
347 bzero(oldvtocp, sizeof (struct vtoc));