Changeset View
Changeset View
Standalone View
Standalone View
head/sys/geom/part/g_part.c
Show First 20 Lines • Show All 361 Lines • ▼ Show 20 Lines | if (e1->gpe_end > table->gpt_last) { | ||||
failed++; | failed++; | ||||
} | } | ||||
if (pp->stripesize > 0) { | if (pp->stripesize > 0) { | ||||
offset = e1->gpe_start * pp->sectorsize; | offset = e1->gpe_start * pp->sectorsize; | ||||
if (e1->gpe_offset > offset) | if (e1->gpe_offset > offset) | ||||
offset = e1->gpe_offset; | offset = e1->gpe_offset; | ||||
if ((offset + pp->stripeoffset) % pp->stripesize) { | if ((offset + pp->stripeoffset) % pp->stripesize) { | ||||
DPRINTF("partition %d on (%s, %s) is not " | DPRINTF("partition %d on (%s, %s) is not " | ||||
"aligned on %u bytes\n", e1->gpe_index, | "aligned on %ju bytes\n", e1->gpe_index, | ||||
pp->name, table->gpt_scheme->name, | pp->name, table->gpt_scheme->name, | ||||
pp->stripesize); | (uintmax_t)pp->stripesize); | ||||
/* Don't treat this as a critical failure */ | /* Don't treat this as a critical failure */ | ||||
} | } | ||||
} | } | ||||
e2 = e1; | e2 = e1; | ||||
while ((e2 = LIST_NEXT(e2, gpe_entry)) != NULL) { | while ((e2 = LIST_NEXT(e2, gpe_entry)) != NULL) { | ||||
if (e2->gpe_deleted || e2->gpe_internal) | if (e2->gpe_deleted || e2->gpe_internal) | ||||
continue; | continue; | ||||
if (e1->gpe_start >= e2->gpe_start && | if (e1->gpe_start >= e2->gpe_start && | ||||
▲ Show 20 Lines • Show All 434 Lines • ▼ Show 20 Lines | g_part_ctl_add(struct gctl_req *req, struct g_part_parms *gpp) | ||||
g_part_new_provider(gp, table, entry); | g_part_new_provider(gp, table, entry); | ||||
/* Provide feedback if so requested. */ | /* Provide feedback if so requested. */ | ||||
if (gpp->gpp_parms & G_PART_PARM_OUTPUT) { | if (gpp->gpp_parms & G_PART_PARM_OUTPUT) { | ||||
sb = sbuf_new_auto(); | sb = sbuf_new_auto(); | ||||
G_PART_FULLNAME(table, entry, sb, gp->name); | G_PART_FULLNAME(table, entry, sb, gp->name); | ||||
if (pp->stripesize > 0 && entry->gpe_pp->stripeoffset != 0) | if (pp->stripesize > 0 && entry->gpe_pp->stripeoffset != 0) | ||||
sbuf_printf(sb, " added, but partition is not " | sbuf_printf(sb, " added, but partition is not " | ||||
"aligned on %u bytes\n", pp->stripesize); | "aligned on %ju bytes\n", (uintmax_t)pp->stripesize); | ||||
else | else | ||||
sbuf_cat(sb, " added\n"); | sbuf_cat(sb, " added\n"); | ||||
sbuf_finish(sb); | sbuf_finish(sb); | ||||
gctl_set_param(req, "output", sbuf_data(sb), sbuf_len(sb) + 1); | gctl_set_param(req, "output", sbuf_data(sb), sbuf_len(sb) + 1); | ||||
sbuf_delete(sb); | sbuf_delete(sb); | ||||
} | } | ||||
return (0); | return (0); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 1,583 Lines • Show Last 20 Lines |