summaryrefslogtreecommitdiffstats
path: root/fdisks/fdisksunlabel.c
diff options
context:
space:
mode:
authorDavidlohr Bueso2012-07-23 18:15:57 +0200
committerKarel Zak2012-07-23 18:15:57 +0200
commit61c4cb85309a62f343a74175b06984e0111f3fd8 (patch)
tree75b90d2eac1f98fde3dfda53101512c3c5d7aeff /fdisks/fdisksunlabel.c
parentfdisk: set label pointer in fdisk_create_default_disklabel() (diff)
downloadkernel-qcow2-util-linux-61c4cb85309a62f343a74175b06984e0111f3fd8.tar.gz
kernel-qcow2-util-linux-61c4cb85309a62f343a74175b06984e0111f3fd8.tar.xz
kernel-qcow2-util-linux-61c4cb85309a62f343a74175b06984e0111f3fd8.zip
fdisk: API: add delete partition to label operations
Signed-off-by: Davidlohr Bueso <dave@gnu.org> Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'fdisks/fdisksunlabel.c')
-rw-r--r--fdisks/fdisksunlabel.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/fdisks/fdisksunlabel.c b/fdisks/fdisksunlabel.c
index e39b90cca..7c369f3e6 100644
--- a/fdisks/fdisksunlabel.c
+++ b/fdisks/fdisksunlabel.c
@@ -483,13 +483,13 @@ and is of type `Whole disk'\n"));
set_sun_partition(cxt, n, first, last, sys);
}
-void sun_delete_partition(struct fdisk_context *cxt, int i)
+static void sun_delete_partition(struct fdisk_context *cxt, int partnum)
{
- struct sun_partition *part = &sunlabel->partitions[i];
- struct sun_tag_flag *tag = &sunlabel->part_tags[i];
+ struct sun_partition *part = &sunlabel->partitions[partnum];
+ struct sun_tag_flag *tag = &sunlabel->part_tags[partnum];
unsigned int nsec;
- if (i == 2 &&
+ if (partnum == 2 &&
tag->tag == SSWAP16(SUN_TAG_BACKUP) &&
!part->start_cylinder &&
(nsec = SSWAP32(part->num_sectors))
@@ -649,4 +649,5 @@ const struct fdisk_label sun_label =
{
.name = "sun",
.probe = sun_probe_label,
+ .part_delete = sun_delete_partition,
};