return res;
}
+/* apply label alignment setting to the context -- if not sure use
+ * fdisk_reset_alignment()
+ */
+int fdisk_apply_label_device_properties(struct fdisk_context *cxt)
+{
+ int rc = 0;
+
+ if (cxt->label && cxt->label->op->reset_alignment) {
+ DBG(CXT, ul_debugobj(cxt, "appling label device properties..."));
+ rc = cxt->label->op->reset_alignment(cxt);
+ }
+ return rc;
+}
+
/**
* fdisk_reset_alignment:
* @cxt: fdisk context
cxt->last_lba = cxt->total_sectors - 1;
/* overwrite default by label stuff */
- if (cxt->label && cxt->label->op->reset_alignment)
- rc = cxt->label->op->reset_alignment(cxt);
+ rc = fdisk_apply_label_device_properties(cxt);
DBG(CXT, ul_debugobj(cxt, "alignment reset to: "
"first LBA=%ju, last LBA=%ju, grain=%lu [rc=%d]",
fdisk_probe_labels(cxt);
+ fdisk_apply_label_device_properties(cxt);
+
/* warn about obsolete stuff on the device if we aren't in
* list-only mode and there is not PT yet */
if (!fdisk_is_listonly(cxt) && !fdisk_has_label(cxt) && check_collisions(cxt) < 0)
extern int fdisk_has_user_device_geometry(struct fdisk_context *cxt);
extern int fdisk_apply_user_device_properties(struct fdisk_context *cxt);
+extern int fdisk_apply_label_device_properties(struct fdisk_context *cxt);
extern void fdisk_zeroize_device_properties(struct fdisk_context *cxt);
/* utils.c */