Lines Matching defs:pi
66 int pmon_getdisklabel(struct pmon_iodata *pi);
72 struct pmon_iodata *pi = (struct pmon_iodata *)f;
84 offs = ((daddr_t)dblk + pi->partoff) * DEV_BSIZE;
85 if (offs != pi->curpos) {
86 pos = pmon_lseek(pi->fd, offs, 0 /* SEEK_SET */);
92 rc = pmon_read(pi->fd, buf, size);
94 pi->curpos += rc;
108 struct pmon_iodata *pi;
113 pi = alloc(sizeof *pi);
114 if (pi == NULL)
116 bzero(pi, sizeof *pi);
117 f->f_devdata = pi;
134 pi->fd = rc;
140 if (pmon_getdisklabel(pi) != 0) {
145 if (part >= pi->label.d_npartitions) {
150 if (memcmp(pi->label.d_uid, zero, sizeof(pi->label.d_uid)) != 0) {
151 const u_char *duid = pi->label.d_uid;
159 pi->partoff = DL_GETPOFFSET(&pi->label.d_partitions[part]);
160 pi->curpos = 0;
168 struct pmon_iodata *pi;
172 pi = (struct pmon_iodata *)f->f_devdata;
173 rc = pmon_close(pi->fd);
174 free(pi, sizeof *pi);
186 pmon_getdisklabel(struct pmon_iodata *pi)
191 struct disklabel *lp = &pi->label;
200 if (pmon_iostrategy(pi, F_READ, DOSBBSECTOR, DEV_BSIZE, buf, &rsize))
220 if (pmon_iostrategy(pi, F_READ, sector + DOS_LABELSECTOR, DEV_BSIZE,