From caad858324b9d1311cbea64cd565854cd4f44fae Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Fri, 14 Jun 2013 14:33:51 +0200 Subject: [PATCH] libfdisk: add FDISK_LABEL_FL_REQUIRE_GEOMETRY Signed-off-by: Karel Zak --- fdisks/fdiskbsdlabel.c | 4 ++-- fdisks/fdiskdoslabel.c | 4 ++-- libfdisk/src/fdiskP.h | 3 ++- libfdisk/src/label.c | 2 +- libfdisk/src/sgi.c | 2 ++ libfdisk/src/sun.c | 2 ++ 6 files changed, 11 insertions(+), 6 deletions(-) diff --git a/fdisks/fdiskbsdlabel.c b/fdisks/fdiskbsdlabel.c index 8f891b0da4..23772673bf 100644 --- a/fdisks/fdiskbsdlabel.c +++ b/fdisks/fdiskbsdlabel.c @@ -1062,8 +1062,8 @@ struct fdisk_label *fdisk_new_bsd_label(struct fdisk_context *cxt) lb->parttypes = xbsd_fstypes; lb->nparttypes = ARRAY_SIZE(xbsd_fstypes); - /* don't ask for partition number for op->part_add() */ - lb->flags = FDISK_LABEL_FL_ADDPART_NOPARTNO; + lb->flags |= FDISK_LABEL_FL_ADDPART_NOPARTNO; + lb->flags |= FDISK_LABEL_FL_REQUIRE_GEOMETRY; return lb; } diff --git a/fdisks/fdiskdoslabel.c b/fdisks/fdiskdoslabel.c index 4b0a5cb4bc..361d599014 100644 --- a/fdisks/fdiskdoslabel.c +++ b/fdisks/fdiskdoslabel.c @@ -1561,8 +1561,8 @@ struct fdisk_label *fdisk_new_dos_label(struct fdisk_context *cxt) lb->parttypes = dos_parttypes; lb->nparttypes = ARRAY_SIZE(dos_parttypes); - /* don't ask for partition number for op->part_add() */ - lb->flags = FDISK_LABEL_FL_ADDPART_NOPARTNO; + lb->flags |= FDISK_LABEL_FL_ADDPART_NOPARTNO; + lb->flags |= FDISK_LABEL_FL_REQUIRE_GEOMETRY; return lb; } diff --git a/libfdisk/src/fdiskP.h b/libfdisk/src/fdiskP.h index adaa7c0e74..d20154b802 100644 --- a/libfdisk/src/fdiskP.h +++ b/libfdisk/src/fdiskP.h @@ -202,7 +202,8 @@ struct fdisk_label { /* label driver flags */ enum { - FDISK_LABEL_FL_ADDPART_NOPARTNO = (1 << 1) + FDISK_LABEL_FL_ADDPART_NOPARTNO = (1 << 1), + FDISK_LABEL_FL_REQUIRE_GEOMETRY = (1 << 2) }; /* label allocators */ diff --git a/libfdisk/src/label.c b/libfdisk/src/label.c index cabf3d751a..6c90e99301 100644 --- a/libfdisk/src/label.c +++ b/libfdisk/src/label.c @@ -121,7 +121,7 @@ int fdisk_list_disklabel(struct fdisk_context *cxt) * @cxt: fdisk context * @t: partition type to create or NULL for label-specific default * - * Creates a new partition, with number @partnum and type @parttype. + * Creates a new partition with type @parttype. * * Returns 0. */ diff --git a/libfdisk/src/sgi.c b/libfdisk/src/sgi.c index d16691aa89..32a531c58d 100644 --- a/libfdisk/src/sgi.c +++ b/libfdisk/src/sgi.c @@ -1178,5 +1178,7 @@ struct fdisk_label *fdisk_new_sgi_label(struct fdisk_context *cxt) lb->parttypes = sgi_parttypes; lb->nparttypes = ARRAY_SIZE(sgi_parttypes); + lb->flags |= FDISK_LABEL_FL_REQUIRE_GEOMETRY; + return lb; } diff --git a/libfdisk/src/sun.c b/libfdisk/src/sun.c index a8d200fb28..eb1ba74a4e 100644 --- a/libfdisk/src/sun.c +++ b/libfdisk/src/sun.c @@ -1011,5 +1011,7 @@ struct fdisk_label *fdisk_new_sun_label(struct fdisk_context *cxt) lb->parttypes = sun_parttypes; lb->nparttypes = ARRAY_SIZE(sun_parttypes); + lb->flags |= FDISK_LABEL_FL_REQUIRE_GEOMETRY; + return lb; } -- 2.47.2