Lines Matching refs:parts
110 static void free_subpart(struct cmdline_parts *parts) in free_subpart() argument
114 while (parts->subpart) { in free_subpart()
115 subpart = parts->subpart; in free_subpart()
116 parts->subpart = subpart->next_subpart; in free_subpart()
121 static int parse_parts(struct cmdline_parts **parts, const char *bdevdef) in parse_parts() argument
130 *parts = NULL; in parse_parts()
173 *parts = newparts; in parse_parts()
182 static void cmdline_parts_free(struct cmdline_parts **parts) in cmdline_parts_free() argument
186 while (*parts) { in cmdline_parts_free()
187 next_parts = (*parts)->next_parts; in cmdline_parts_free()
188 free_subpart(*parts); in cmdline_parts_free()
189 kfree(*parts); in cmdline_parts_free()
190 *parts = next_parts; in cmdline_parts_free()
194 static int cmdline_parts_parse(struct cmdline_parts **parts, in cmdline_parts_parse() argument
203 *parts = NULL; in cmdline_parts_parse()
209 next_parts = parts; in cmdline_parts_parse()
226 if (!*parts) { in cmdline_parts_parse()
238 cmdline_parts_free(parts); in cmdline_parts_parse()
242 static struct cmdline_parts *cmdline_parts_find(struct cmdline_parts *parts, in cmdline_parts_find() argument
245 while (parts && strncmp(bdev, parts->name, sizeof(parts->name))) in cmdline_parts_find()
246 parts = parts->next_parts; in cmdline_parts_find()
247 return parts; in cmdline_parts_find()
266 info = &state->parts[slot].info; in add_part()
276 state->parts[slot].has_info = true; in add_part()
281 static int cmdline_parts_set(struct cmdline_parts *parts, sector_t disk_size, in cmdline_parts_set() argument
288 for (subpart = parts->subpart; subpart; in cmdline_parts_set()
349 for (; slot < state->limit && state->parts[slot].has_info; slot++) { in cmdline_parts_verifier()
350 for (i = slot+1; i < state->limit && state->parts[i].has_info; in cmdline_parts_verifier()
352 if (has_overlaps(state->parts[slot].from, in cmdline_parts_verifier()
353 state->parts[slot].size, in cmdline_parts_verifier()
354 state->parts[i].from, in cmdline_parts_verifier()
355 state->parts[i].size)) { in cmdline_parts_verifier()
362 state->parts[slot].info.volname, in cmdline_parts_verifier()
363 (u64)state->parts[slot].from << 9, in cmdline_parts_verifier()
364 (u64)state->parts[slot].size << 9, in cmdline_parts_verifier()
365 state->parts[i].info.volname, in cmdline_parts_verifier()
366 (u64)state->parts[i].from << 9, in cmdline_parts_verifier()
367 (u64)state->parts[i].size << 9); in cmdline_parts_verifier()
383 struct cmdline_parts *parts; in cmdline_partition() local
399 parts = cmdline_parts_find(bdev_parts, state->disk->disk_name); in cmdline_partition()
400 if (!parts) in cmdline_partition()
405 cmdline_parts_set(parts, disk_size, state); in cmdline_partition()