• Home
  • Raw
  • Download

Lines Matching refs:part

91 static void lba2chs(unsigned long lba_addr, CHS *chs, PARTITION *part)  in lba2chs()  argument
96 abss = (lba_addr >> 9) + part->start; in lba2chs()
97 chs->cyl = abss / (part->sects * part->heads); in lba2chs()
98 chs->head = (abss / part->sects) % part->heads; in lba2chs()
99 chs->sector = (abss % part->sects) + 1; in lba2chs()
150 static io_channel alloc_io_channel(PARTITION *part) in alloc_io_channel() argument
160 ioch->name = (char *)malloc(strlen(part->dev)+1); in alloc_io_channel()
165 strcpy(ioch->name, part->dev); in alloc_io_channel()
166 ioch->private_data = part; in alloc_io_channel()
184 PARTITION *part; in dos_open() local
215 part = (PARTITION*)malloc(sizeof(PARTITION)); in dos_open()
216 if (!part) in dos_open()
240 part->phys = 0x80; in dos_open()
241 part->phys += toupper(tmp[2]) - 'A'; in dos_open()
246 part->pno = isdigit((int)tmp[3]) ? tmp[3] - '0' - 1: 0; in dos_open()
248 part->pno = 0xFF; in dos_open()
253 part->phys = isdigit((int)tmp[2]) ? tmp[2] - '0' : 0; in dos_open()
255 part->phys = 0x00; /* We'll assume /dev/fd0 */ in dos_open()
263 if(part->phys < 0x80) in dos_open()
270 part->dev = strdup(dev); in dos_open()
276 part->phys, in dos_open()
286 free(part->dev); in dos_open()
287 free(part); in dos_open()
294 part->cyls = (unsigned short)(((sec[0] >> 6) << 8) + sec[1] + 1); in dos_open()
295 part->heads = sec[3] + 1; in dos_open()
296 part->sects = sec[0] & 0x3F; in dos_open()
301 _dio_hw_error = biosdisk(DISK_READ, part->phys, 0, 0, 1, 1, sec); in dos_open()
306 free(part->dev); in dos_open()
307 free(part); in dos_open()
312 pent = scan_partition_table(pent, part->phys, &part->pno); in dos_open()
316 _dio_error = part->pno == 0xFE ? ERR_EMPTYPART : in dos_open()
317 part->pno == 0xFD ? ERR_LINUXSWAP : ERR_NOTEXT2FS; in dos_open()
318 free(part->dev); in dos_open()
319 free(part); in dos_open()
332 part->start = fsec + fhead * part->sects + fcyl * in dos_open()
333 (part->heads * part->sects) - 1; in dos_open()
334 part->len = pent->size; in dos_open()
342 free(part); in dos_open()
346 partitions[npart++] = active = part; in dos_open()
376 PARTITION *part; in dos_read_blk() local
382 part = (PARTITION*)channel->private_data; in dos_read_blk()
387 lba2chs(loc, &chs, part); in dos_read_blk()
394 part->phys, in dos_read_blk()
413 PARTITION *part; in dos_write_blk() local
419 part = (PARTITION*)channel->private_data; in dos_write_blk()
432 lba2chs(loc, &chs, part); in dos_write_blk()
434 part->phys, in dos_write_blk()