OSDN Git Service

sun: revert "implement disk flag operations"
authorColin Watson <cjwatson@ubuntu.com>
Tue, 15 Jun 2010 18:49:40 +0000 (19:49 +0100)
committerJim Meyering <meyering@redhat.com>
Sat, 26 Jun 2010 07:23:12 +0000 (09:23 +0200)
This reverts the libparted/labels/sun.c part of
723ea23c5df68cbe67d1f518ef484f4c77f516fa.  Sun disk labels do
not appear to be able to handle non-cylinder alignment
(http://bugs.debian.org/579948).
* libparted/labels/sun.c: Revert.

libparted/labels/sun.c

index 177a47c..e14a81d 100644 (file)
@@ -109,7 +109,6 @@ struct _SunPartitionData {
 struct _SunDiskData {
        PedSector               length; /* This is based on cyl - alt-cyl */
        SunRawLabel             raw_label;
-       int                     cylinder_alignment;
 };
 
 static PedDiskType sun_disk_type;
@@ -191,7 +190,6 @@ sun_alloc (const PedDevice* dev)
        PED_ASSERT (bios_geom->cylinders == (PedSector) (dev->length / cyl_size),
                     return NULL);
        sun_specific->length = ped_round_down_to (dev->length, cyl_size);
-        sun_specific->cylinder_alignment = 1;
 
        label = &sun_specific->raw_label;
        memset(label, 0, sizeof(SunRawLabel));
@@ -258,42 +256,6 @@ sun_free (PedDisk *disk)
 }
 
 static int
-sun_disk_set_flag (PedDisk *disk, PedDiskFlag flag, int state)
-{
-        SunDiskData *disk_specific = disk->disk_specific;
-        switch (flag) {
-        case PED_DISK_CYLINDER_ALIGNMENT:
-                disk_specific->cylinder_alignment = !!state;
-                return 1;
-        default:
-                return 0;
-        }
-}
-
-static int
-sun_disk_get_flag (const PedDisk *disk, PedDiskFlag flag)
-{
-        SunDiskData *disk_specific = disk->disk_specific;
-        switch (flag) {
-        case PED_DISK_CYLINDER_ALIGNMENT:
-                return disk_specific->cylinder_alignment;
-        default:
-                return 0;
-        }
-}
-
-static int
-sun_disk_is_flag_available (const PedDisk *disk, PedDiskFlag flag)
-{
-        switch (flag) {
-        case PED_DISK_CYLINDER_ALIGNMENT:
-               return 1;
-        default:
-               return 0;
-        }
-}
-
-static int
 _check_geometry_sanity (PedDisk* disk, SunRawLabel* label)
 {
        PedDevice*      dev = disk->dev;
@@ -804,10 +766,7 @@ sun_partition_align (PedPartition* part, const PedConstraint* constraint)
 {
         PED_ASSERT (part != NULL, return 0);
 
-        SunDiskData *disk_specific = part->disk->disk_specific;
-
-        if (disk_specific->cylinder_alignment &&
-            _ped_partition_attempt_align (part, constraint,
+        if (_ped_partition_attempt_align (part, constraint,
                                           _get_strict_constraint (part->disk)))
                 return 1;
         if (_ped_partition_attempt_align (part, constraint,
@@ -921,10 +880,6 @@ static PedDiskOps sun_disk_ops = {
        clobber:                NULL,
        write:                  NULL_IF_DISCOVER_ONLY (sun_write),
 
-       disk_set_flag:          sun_disk_set_flag,
-       disk_get_flag:          sun_disk_get_flag,
-       disk_is_flag_available: sun_disk_is_flag_available,
-
        get_partition_alignment: sun_get_partition_alignment,
 
        partition_set_name:             NULL,