Blame SOURCES/0023-parted-fix-build-error-on-s390.patch

003ee8
From 388bab890a4e09b09d2428c0e773ed083295f91b Mon Sep 17 00:00:00 2001
003ee8
From: Colin Watson <cjwatson@ubuntu.com>
003ee8
Date: Thu, 29 Oct 2015 21:12:01 +0100
003ee8
Subject: [PATCH] parted: fix build error on s390
003ee8
003ee8
The preceding dasd probing patches have introduced a compile error
003ee8
when building with blkid support. Fixed by reordering function
003ee8
definitions.
003ee8
003ee8
Signed-off-by: Colin Watson <cjwatson@ubuntu.com>
003ee8
Signed-off-by: Viktor Mihajlovski <mihajlov@linux.vnet.ibm.com>
003ee8
Signed-off-by: Brian C. Lane <bcl@redhat.com>
003ee8
---
003ee8
 libparted/arch/linux.c | 106 ++++++++++++++++++++++++-------------------------
003ee8
 1 file changed, 53 insertions(+), 53 deletions(-)
003ee8
003ee8
diff --git a/libparted/arch/linux.c b/libparted/arch/linux.c
003ee8
index 9344ceb..1198f52 100644
003ee8
--- a/libparted/arch/linux.c
003ee8
+++ b/libparted/arch/linux.c
003ee8
@@ -3184,59 +3184,6 @@ linux_disk_commit (PedDisk* disk)
003ee8
         return 1;
003ee8
 }
003ee8
 
003ee8
-#if defined __s390__ || defined __s390x__
003ee8
-/**
003ee8
- * Check whether this device could be a DASD
003ee8
- *
003ee8
- * The device probing yields PED_DEVICE_DASD for native DASD transport
003ee8
- * If the block device uses a different transport (e.g. virtio)
003ee8
- * a simplified heuristic (assuming a model 3390 with 4K sectors)
003ee8
- * is applied (only) on s390x systems for this check.
003ee8
- *
003ee8
- * \return 1 if the geometry indicates this could be a DASD
003ee8
- *         and 0 otherwise
003ee8
- */
003ee8
-static int
003ee8
-_ped_device_like_dasd(const PedDevice *dev)
003ee8
-{
003ee8
-        return (dev->type == PED_DEVICE_DASD)
003ee8
-          || (dev->hw_geom.heads == 15
003ee8
-              && dev->hw_geom.sectors == 12
003ee8
-              && (dev->hw_geom.cylinders
003ee8
-                  * dev->hw_geom.heads
003ee8
-                  * dev->hw_geom.sectors
003ee8
-                  * dev->phys_sector_size
003ee8
-                  == dev->length * dev->sector_size));
003ee8
-}
003ee8
-
003ee8
-
003ee8
-
003ee8
-static PedAlignment*
003ee8
-s390_get_minimum_alignment(const PedDevice *dev)
003ee8
-{
003ee8
-#if USE_BLKID
003ee8
-        return linux_get_minimum_alignment(dev);
003ee8
-#else
003ee8
-        return ped_alignment_new(0,
003ee8
-                                 dev->phys_sector_size
003ee8
-                                 / dev->sector_size);
003ee8
-#endif
003ee8
-}
003ee8
-
003ee8
-static PedAlignment*
003ee8
-s390_get_optimum_alignment(const PedDevice *dev)
003ee8
-{
003ee8
-        /* DASD needs to use minimum alignment */
003ee8
-        if (_ped_device_like_dasd(dev))
003ee8
-                return s390_get_minimum_alignment(dev);
003ee8
-#if USE_BLKID
003ee8
-        return linux_get_optimum_alignment(dev);
003ee8
-#else
003ee8
-        return NULL;
003ee8
-#endif
003ee8
-}
003ee8
-#endif
003ee8
-
003ee8
 #if USE_BLKID
003ee8
 static PedAlignment*
003ee8
 linux_get_minimum_alignment(const PedDevice *dev)
003ee8
@@ -3293,6 +3240,59 @@ linux_get_optimum_alignment(const PedDevice *dev)
003ee8
 }
003ee8
 #endif
003ee8
 
003ee8
+#if defined __s390__ || defined __s390x__
003ee8
+/**
003ee8
+ * Check whether this device could be a DASD
003ee8
+ *
003ee8
+ * The device probing yields PED_DEVICE_DASD for native DASD transport
003ee8
+ * If the block device uses a different transport (e.g. virtio)
003ee8
+ * a simplified heuristic (assuming a model 3390 with 4K sectors)
003ee8
+ * is applied (only) on s390x systems for this check.
003ee8
+ *
003ee8
+ * \return 1 if the geometry indicates this could be a DASD
003ee8
+ *         and 0 otherwise
003ee8
+ */
003ee8
+static int
003ee8
+_ped_device_like_dasd(const PedDevice *dev)
003ee8
+{
003ee8
+        return (dev->type == PED_DEVICE_DASD)
003ee8
+          || (dev->hw_geom.heads == 15
003ee8
+              && dev->hw_geom.sectors == 12
003ee8
+              && (dev->hw_geom.cylinders
003ee8
+                  * dev->hw_geom.heads
003ee8
+                  * dev->hw_geom.sectors
003ee8
+                  * dev->phys_sector_size
003ee8
+                  == dev->length * dev->sector_size));
003ee8
+}
003ee8
+
003ee8
+
003ee8
+
003ee8
+static PedAlignment*
003ee8
+s390_get_minimum_alignment(const PedDevice *dev)
003ee8
+{
003ee8
+#if USE_BLKID
003ee8
+        return linux_get_minimum_alignment(dev);
003ee8
+#else
003ee8
+        return ped_alignment_new(0,
003ee8
+                                 dev->phys_sector_size
003ee8
+                                 / dev->sector_size);
003ee8
+#endif
003ee8
+}
003ee8
+
003ee8
+static PedAlignment*
003ee8
+s390_get_optimum_alignment(const PedDevice *dev)
003ee8
+{
003ee8
+        /* DASD needs to use minimum alignment */
003ee8
+        if (_ped_device_like_dasd(dev))
003ee8
+                return s390_get_minimum_alignment(dev);
003ee8
+#if USE_BLKID
003ee8
+        return linux_get_optimum_alignment(dev);
003ee8
+#else
003ee8
+        return NULL;
003ee8
+#endif
003ee8
+}
003ee8
+#endif
003ee8
+
003ee8
 static PedDeviceArchOps linux_dev_ops = {
003ee8
         _new:           linux_new,
003ee8
         destroy:        linux_destroy,
003ee8
-- 
003ee8
2.4.3
003ee8