libfdisk: add FDISK_LABEL_FL_REQUIRE_GEOMETRY

Signed-off-by: Karel Zak <kzak@redhat.com>
This commit is contained in:
Karel Zak 2013-06-14 14:33:51 +02:00
parent 04d83a9251
commit caad858324
6 changed files with 11 additions and 6 deletions

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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 */

View File

@ -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.
*/

View File

@ -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;
}

View File

@ -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;
}