OSDN Git Service

libparted: add disk flag functions and PED_DISK_CYLINDER_ALIGNMENT flag
authorHans de Goede <hdegoede@redhat.com>
Wed, 9 Dec 2009 14:38:00 +0000 (15:38 +0100)
committerJim Meyering <meyering@redhat.com>
Thu, 10 Dec 2009 12:43:33 +0000 (13:43 +0100)
commit60e36b587b3f16ea09242aaf7235866493cb4e96
tree4646c99092fc006c8837f31b6efc046794a4a37f
parent206497ef8a85a0b56d1b5925c350ad89b40dbdcd
libparted: add disk flag functions and PED_DISK_CYLINDER_ALIGNMENT flag

Sometimes we want to be able to set flags at the disk level rather then
at the parition level, to influence how new partitions will be created
for example.  This patch adds functions to do this (modelled after the
partition flag functions), and adds a PED_DISK_CYLINDER_ALIGNMENT flag.

This flag (which defaults to true) controls if disk types for which
cylinder alignment is optional do cylinder alignment when a new
partition gets added. This flag is available for msdos and sun
disklabels (for sun labels it only controls the aligning of the end of
the partition).
* include/parted/disk.h (PedDiskFlag): New type
* include/parted/disk.h (ped_disk_set_flag, ped_disk_get_flag,
ped_disk_is_flag_available): new functions and PedDiskOps members
* include/parted/disk.h (ped_disk_flag_get_name,
ped_disk_flag_get_by_name, ped_disk_flag_next): new functions
* libparted/disk.c (ped_disk_set_flag, ped_disk_get_flag,
ped_disk_is_flag_available, ped_disk_flag_get_name,
ped_disk_flag_get_by_name, ped_disk_flag_next): new functions
include/parted/disk.h
libparted/disk.c