Blame SOURCES/0073-libpartd-dasd-improve-flag-processing-for-DASD-LDL.patch

003ee8
From fb8167365502c7476d571fb279889ad2c6c2785e Mon Sep 17 00:00:00 2001
003ee8
From: Wang Dong <dongdwdw@linux.vnet.ibm.com>
003ee8
Date: Fri, 24 Mar 2017 03:11:12 +0100
003ee8
Subject: [PATCH 73/75] libpartd/dasd: improve flag processing for DASD-LDL
003ee8
003ee8
DASD-LDL does not support flag now, so all the flags are
003ee8
unavailable to it.
003ee8
003ee8
Signed-off-by: Andre Wild <wild@linux.vnet.ibm.com>
003ee8
Signed-off-by: Wang Dong <dongdwdw@linux.vnet.ibm.com>
003ee8
Signed-off-by: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
003ee8
---
003ee8
 libparted/labels/dasd.c | 14 ++++++++++++++
003ee8
 1 file changed, 14 insertions(+)
003ee8
003ee8
diff --git a/libparted/labels/dasd.c b/libparted/labels/dasd.c
003ee8
index 7594e96..e246ecb 100644
003ee8
--- a/libparted/labels/dasd.c
003ee8
+++ b/libparted/labels/dasd.c
003ee8
@@ -773,10 +773,24 @@ dasd_partition_get_flag (const PedPartition* part, PedPartitionFlag flag)
003ee8
 	}
003ee8
 }
003ee8
 
003ee8
+/*
003ee8
+ * The DASD-LDL does not support flags now.
003ee8
+ * So just return 0.
003ee8
+*/
003ee8
 static int
003ee8
 dasd_partition_is_flag_available (const PedPartition* part,
003ee8
                                   PedPartitionFlag flag)
003ee8
 {
003ee8
+	DasdDiskSpecific* disk_specific;
003ee8
+	PED_ASSERT (part != NULL);
003ee8
+	PED_ASSERT (part->disk != NULL);
003ee8
+	PED_ASSERT (part->disk->disk_specific != NULL);
003ee8
+
003ee8
+	disk_specific = part->disk->disk_specific;
003ee8
+
003ee8
+	if (disk_specific->format_type == 1)
003ee8
+		return 0;
003ee8
+
003ee8
 	switch (flag) {
003ee8
 		case PED_PARTITION_RAID:
003ee8
 			return 1;
003ee8
-- 
003ee8
2.9.3
003ee8