Lines Matching refs:state
72 static int aix_magic_present(struct parsed_partitions *state, unsigned char *p)
99 d = read_part_sector(state, 7, §);
108 static void set_info(struct parsed_partitions *state, int slot,
111 struct partition_meta_info *info = &state->parts[slot].info;
116 state->parts[slot].has_info = true;
130 static void parse_extended(struct parsed_partitions *state,
143 sector_size = queue_logical_block_size(state->disk->queue) / 512;
150 if (state->next == state->limit)
152 data = read_part_sector(state, this_sector, §);
193 put_partition(state, state->next, next, size);
194 set_info(state, state->next, disksig);
196 state->parts[state->next].flags = ADDPART_FLAG_RAID;
198 if (++state->next == state->limit)
250 static void parse_solaris_x86(struct parsed_partitions *state,
259 v = read_part_sector(state, offset + 1, §);
269 snprintf(tmp, sizeof(tmp), " %s%d: <solaris:", state->name, origin);
270 strlcat(state->pp_buf, tmp, PAGE_SIZE);
277 strlcat(state->pp_buf, tmp, PAGE_SIZE);
283 for (i = 0; i < max_nparts && state->next < state->limit; i++) {
290 strlcat(state->pp_buf, tmp, PAGE_SIZE);
293 put_partition(state, state->next++,
298 strlcat(state->pp_buf, " >\n", PAGE_SIZE);
355 static void parse_bsd(struct parsed_partitions *state,
364 l = read_part_sector(state, offset + 1, §);
372 snprintf(tmp, sizeof(tmp), " %s%d: <%s:", state->name, origin, flavour);
373 strlcat(state->pp_buf, tmp, PAGE_SIZE);
380 if (state->next == state->limit)
394 strlcat(state->pp_buf, "bad subpartition - ignored\n", PAGE_SIZE);
397 put_partition(state, state->next++, bsd_start, bsd_size);
403 strlcat(state->pp_buf, tmp, PAGE_SIZE);
405 strlcat(state->pp_buf, " >\n", PAGE_SIZE);
409 static void parse_freebsd(struct parsed_partitions *state,
413 parse_bsd(state, offset, size, origin, "bsd", BSD_MAXPARTITIONS);
417 static void parse_netbsd(struct parsed_partitions *state,
421 parse_bsd(state, offset, size, origin, "netbsd", BSD_MAXPARTITIONS);
425 static void parse_openbsd(struct parsed_partitions *state,
429 parse_bsd(state, offset, size, origin, "openbsd",
483 static void parse_unixware(struct parsed_partitions *state,
491 l = read_part_sector(state, offset + 29, §);
502 snprintf(tmp, sizeof(tmp), " %s%d: <unixware:", state->name, origin);
503 strlcat(state->pp_buf, tmp, PAGE_SIZE);
508 if (state->next == state->limit)
512 put_partition(state, state->next++,
518 strlcat(state->pp_buf, " >\n", PAGE_SIZE);
529 static void parse_minix(struct parsed_partitions *state,
538 data = read_part_sector(state, offset, §);
551 snprintf(tmp, sizeof(tmp), " %s%d: <minix:", state->name, origin);
552 strlcat(state->pp_buf, tmp, PAGE_SIZE);
554 if (state->next == state->limit)
558 put_partition(state, state->next++,
561 strlcat(state->pp_buf, " >\n", PAGE_SIZE);
581 int msdos_partition(struct parsed_partitions *state)
591 sector_size = queue_logical_block_size(state->disk->queue) / 512;
592 data = read_part_sector(state, 0, §);
600 if (aix_magic_present(state, data)) {
603 return aix_partition(state);
605 strlcat(state->pp_buf, " [AIX]", PAGE_SIZE);
632 strlcat(state->pp_buf, "\n", PAGE_SIZE);
662 state->next = 5;
679 put_partition(state, slot, start, n);
681 strlcat(state->pp_buf, " <", PAGE_SIZE);
682 parse_extended(state, start, size, disksig);
683 strlcat(state->pp_buf, " >", PAGE_SIZE);
686 put_partition(state, slot, start, size);
687 set_info(state, slot, disksig);
689 state->parts[slot].flags = ADDPART_FLAG_RAID;
691 strlcat(state->pp_buf, "[DM]", PAGE_SIZE);
693 strlcat(state->pp_buf, "[EZD]", PAGE_SIZE);
696 strlcat(state->pp_buf, "\n", PAGE_SIZE);
712 subtypes[n].parse(state, start_sect(p) * sector_size,