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,
138 sector_t sector_size = bdev_logical_block_size(state->bdev) / 512;
149 if (state->next == state->limit)
151 data = read_part_sector(state, this_sector, §);
192 put_partition(state, state->next, next, size);
193 set_info(state, state->next, disksig);
195 state->parts[state->next].flags = ADDPART_FLAG_RAID;
197 if (++state->next == state->limit)
249 static void parse_solaris_x86(struct parsed_partitions *state,
258 v = read_part_sector(state, offset + 1, §);
268 snprintf(tmp, sizeof(tmp), " %s%d: <solaris:", state->name, origin);
269 strlcat(state->pp_buf, tmp, PAGE_SIZE);
276 strlcat(state->pp_buf, tmp, PAGE_SIZE);
282 for (i = 0; i < max_nparts && state->next < state->limit; i++) {
289 strlcat(state->pp_buf, tmp, PAGE_SIZE);
292 put_partition(state, state->next++,
297 strlcat(state->pp_buf, " >\n", PAGE_SIZE);
354 static void parse_bsd(struct parsed_partitions *state,
363 l = read_part_sector(state, offset + 1, §);
371 snprintf(tmp, sizeof(tmp), " %s%d: <%s:", state->name, origin, flavour);
372 strlcat(state->pp_buf, tmp, PAGE_SIZE);
379 if (state->next == state->limit)
393 strlcat(state->pp_buf, "bad subpartition - ignored\n", PAGE_SIZE);
396 put_partition(state, state->next++, bsd_start, bsd_size);
402 strlcat(state->pp_buf, tmp, PAGE_SIZE);
404 strlcat(state->pp_buf, " >\n", PAGE_SIZE);
408 static void parse_freebsd(struct parsed_partitions *state,
412 parse_bsd(state, offset, size, origin, "bsd", BSD_MAXPARTITIONS);
416 static void parse_netbsd(struct parsed_partitions *state,
420 parse_bsd(state, offset, size, origin, "netbsd", BSD_MAXPARTITIONS);
424 static void parse_openbsd(struct parsed_partitions *state,
428 parse_bsd(state, offset, size, origin, "openbsd",
482 static void parse_unixware(struct parsed_partitions *state,
490 l = read_part_sector(state, offset + 29, §);
501 snprintf(tmp, sizeof(tmp), " %s%d: <unixware:", state->name, origin);
502 strlcat(state->pp_buf, tmp, PAGE_SIZE);
507 if (state->next == state->limit)
511 put_partition(state, state->next++,
517 strlcat(state->pp_buf, " >\n", PAGE_SIZE);
528 static void parse_minix(struct parsed_partitions *state,
537 data = read_part_sector(state, offset, §);
550 snprintf(tmp, sizeof(tmp), " %s%d: <minix:", state->name, origin);
551 strlcat(state->pp_buf, tmp, PAGE_SIZE);
553 if (state->next == state->limit)
557 put_partition(state, state->next++,
560 strlcat(state->pp_buf, " >\n", PAGE_SIZE);
580 int msdos_partition(struct parsed_partitions *state)
582 sector_t sector_size = bdev_logical_block_size(state->bdev) / 512;
590 data = read_part_sector(state, 0, §);
598 if (aix_magic_present(state, data)) {
601 return aix_partition(state);
603 strlcat(state->pp_buf, " [AIX]", PAGE_SIZE);
630 strlcat(state->pp_buf, "\n", PAGE_SIZE);
660 state->next = 5;
677 put_partition(state, slot, start, n);
679 strlcat(state->pp_buf, " <", PAGE_SIZE);
680 parse_extended(state, start, size, disksig);
681 strlcat(state->pp_buf, " >", PAGE_SIZE);
684 put_partition(state, slot, start, size);
685 set_info(state, slot, disksig);
687 state->parts[slot].flags = ADDPART_FLAG_RAID;
689 strlcat(state->pp_buf, "[DM]", PAGE_SIZE);
691 strlcat(state->pp_buf, "[EZD]", PAGE_SIZE);
694 strlcat(state->pp_buf, "\n", PAGE_SIZE);
710 subtypes[n].parse(state, start_sect(p) * sector_size,