Lines Matching refs:part
89 static void lba2chs(unsigned long lba_addr, CHS *chs, PARTITION *part) in lba2chs() argument
94 abss = (lba_addr >> 9) + part->start; in lba2chs()
95 chs->cyl = abss / (part->sects * part->heads); in lba2chs()
96 chs->head = (abss / part->sects) % part->heads; in lba2chs()
97 chs->sector = (abss % part->sects) + 1; in lba2chs()
148 static io_channel alloc_io_channel(PARTITION *part) in alloc_io_channel() argument
158 ioch->name = (char *)malloc(strlen(part->dev)+1); in alloc_io_channel()
163 strcpy(ioch->name, part->dev); in alloc_io_channel()
164 ioch->private_data = part; in alloc_io_channel()
182 PARTITION *part; in dos_open() local
213 part = (PARTITION*)malloc(sizeof(PARTITION)); in dos_open()
214 if (!part) in dos_open()
238 part->phys = 0x80; in dos_open()
239 part->phys += toupper(tmp[2]) - 'A'; in dos_open()
244 part->pno = isdigit((int)tmp[3]) ? tmp[3] - '0' - 1: 0; in dos_open()
246 part->pno = 0xFF; in dos_open()
251 part->phys = isdigit((int)tmp[2]) ? tmp[2] - '0' : 0; in dos_open()
253 part->phys = 0x00; /* We'll assume /dev/fd0 */ in dos_open()
261 if(part->phys < 0x80) in dos_open()
268 part->dev = strdup(dev); in dos_open()
274 part->phys, in dos_open()
284 free(part->dev); in dos_open()
285 free(part); in dos_open()
292 part->cyls = (unsigned short)(((sec[0] >> 6) << 8) + sec[1] + 1); in dos_open()
293 part->heads = sec[3] + 1; in dos_open()
294 part->sects = sec[0] & 0x3F; in dos_open()
299 _dio_hw_error = biosdisk(DISK_READ, part->phys, 0, 0, 1, 1, sec); in dos_open()
304 free(part->dev); in dos_open()
305 free(part); in dos_open()
310 pent = scan_partition_table(pent, part->phys, &part->pno); in dos_open()
314 _dio_error = part->pno == 0xFE ? ERR_EMPTYPART : in dos_open()
315 part->pno == 0xFD ? ERR_LINUXSWAP : ERR_NOTEXT2FS; in dos_open()
316 free(part->dev); in dos_open()
317 free(part); in dos_open()
330 part->start = fsec + fhead * part->sects + fcyl * in dos_open()
331 (part->heads * part->sects) - 1; in dos_open()
332 part->len = pent->size; in dos_open()
340 free(part); in dos_open()
344 partitions[npart++] = active = part; in dos_open()
374 PARTITION *part; in dos_read_blk() local
380 part = (PARTITION*)channel->private_data; in dos_read_blk()
385 lba2chs(loc, &chs, part); in dos_read_blk()
392 part->phys, in dos_read_blk()
411 PARTITION *part; in dos_write_blk() local
417 part = (PARTITION*)channel->private_data; in dos_write_blk()
430 lba2chs(loc, &chs, part); in dos_write_blk()
432 part->phys, in dos_write_blk()