Lines Matching full:od
84 struct open_disk *od; in ptblread() local
87 od = (struct open_disk *)dev->dd.d_opendata; in ptblread()
94 offset *= (od->sectorsize / 512); in ptblread()
100 blocks * od->sectorsize, (char *)buf, NULL)); in ptblread()
108 struct open_disk *od; in ptable_print() local
116 od = (struct open_disk *)pa->dev->dd.d_opendata; in ptable_print()
117 sectsize = od->sectorsize; in ptable_print()
165 struct open_disk *od; in disk_print() local
169 od = (struct open_disk *)dev->dd.d_opendata; in disk_print()
173 return (ptable_iterate(od->table, &pa, ptable_print)); in disk_print()
179 struct open_disk *od; in disk_read() local
182 od = (struct open_disk *)dev->dd.d_opendata; in disk_read()
184 blocks * od->sectorsize, buf, NULL); in disk_read()
192 struct open_disk *od; in disk_write() local
195 od = (struct open_disk *)dev->dd.d_opendata; in disk_write()
197 blocks * od->sectorsize, buf, NULL); in disk_write()
205 struct open_disk *od = dev->dd.d_opendata; in disk_ioctl() local
207 if (od == NULL) in disk_ioctl()
212 *(u_int *)data = od->sectorsize; in disk_ioctl()
216 *(uint64_t *)data = od->mediasize; in disk_ioctl()
218 *(uint64_t *)data = od->entrysize * od->sectorsize; in disk_ioctl()
231 struct open_disk *od; in disk_open() local
241 od = (struct open_disk *)malloc(sizeof(struct open_disk)); in disk_open()
242 if (od == NULL) { in disk_open()
246 dev->dd.d_opendata = od; in disk_open()
247 od->entrysize = 0; in disk_open()
248 od->mediasize = mediasize; in disk_open()
249 od->sectorsize = sectorsize; in disk_open()
265 dev->dd.d_unit, dev->d_slice, dev->d_partition, od); in disk_open()
268 od->table = ptable_open(&partdev, mediasize / sectorsize, sectorsize, in disk_open()
270 if (od->table == NULL) { in disk_open()
276 if (ptable_getsize(od->table, &mediasize) != 0) { in disk_open()
280 od->mediasize = mediasize; in disk_open()
282 if (ptable_gettype(od->table) == PTABLE_BSD && in disk_open()
285 rc = ptable_getpart(od->table, &part, partition); in disk_open()
288 od->entrysize = part.end - part.start + 1; in disk_open()
290 } else if (ptable_gettype(od->table) == PTABLE_ISO9660) { in disk_open()
292 od->entrysize = mediasize; in disk_open()
296 rc = ptable_getbestpart(od->table, &part); in disk_open()
298 rc = ptable_getpart(od->table, &part, slice); in disk_open()
302 od->entrysize = part.end - part.start + 1; in disk_open()
304 if (ptable_gettype(od->table) == PTABLE_GPT) { in disk_open()
333 od->sectorsize, ptblread); in disk_open()
353 od->entrysize = part.end - part.start + 1; in disk_open()
360 if (od->table != NULL) in disk_open()
361 ptable_close(od->table); in disk_open()
362 free(od); in disk_open()
369 (long long)dev->d_offset, od); in disk_open()
377 struct open_disk *od; in disk_close() local
379 od = (struct open_disk *)dev->dd.d_opendata; in disk_close()
380 DPRINTF("%s closed => %p", disk_fmtdev(dev), od); in disk_close()
381 ptable_close(od->table); in disk_close()
382 free(od); in disk_close()