Re: Ubuntu Patches [15/16]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 






Adds 64-bit sector addressing to PDC driver
Index: dmraid-1.0.0.rc16/1.0.0.rc16/lib/format/ataraid/pdc.c
===================================================================
--- dmraid-1.0.0.rc16.orig/1.0.0.rc16/lib/format/ataraid/pdc.c	2010-07-05 19:28:55.498920439 +0100
+++ dmraid-1.0.0.rc16/1.0.0.rc16/lib/format/ataraid/pdc.c	2010-07-05 19:31:06.898921231 +0100
@@ -132,7 +132,8 @@
 	CVT32(pdc->raid.flags);
 	CVT32(pdc->raid.magic_0);
 	CVT32(pdc->raid.disk_secs);
-	CVT32(pdc->raid.total_secs);
+	CVT32(pdc->raid.total_secs_l);
+	CVT16(pdc->raid.total_secs_h);
 	CVT16(pdc->raid.cylinders);
 	CVT32(pdc->raid.magic_1);
 
@@ -194,6 +195,9 @@
 				if (read_file(lc, handler, di->path,
 					      ret + ma, sizeof(*ret),
 					      sector << 9)) {
+                                        /* Log the metadata location */
+                                        log_dbg(lc, "checking pdc metadata at %ld",sector << 9);
+
 					/* No signature? */
 					if (!is_signature(ret + ma)) {
 						if (info->u32)
@@ -311,13 +315,13 @@
 
 	switch (pdc->raid.type) {
 	case PDC_T_RAID10:
-		return pdc->raid.total_secs / (pdc->raid.total_disks / 2);
+		return (((uint64_t)pdc->raid.total_secs_h << 32) + pdc->raid.total_secs_l) / (pdc->raid.total_disks / 2);
 
 	case PDC_T_RAID1:
-		return pdc->raid.total_secs;
+		return (((uint64_t)pdc->raid.total_secs_h << 32) + pdc->raid.total_secs_l);
 
 	case PDC_T_RAID0:
-		return pdc->raid.total_secs / pdc->raid.total_disks;
+		return (((uint64_t)pdc->raid.total_secs_h << 32) + pdc->raid.total_secs_l) / pdc->raid.total_disks;
 
 	case PDC_T_SPAN:
 		return rd->di->sectors - meta_sector;
@@ -494,12 +498,12 @@
 		pdc->raid.total_disks / 2 :
 		pdc->raid.total_disks;
 }
-
+ 
 static int
 check_rd(struct lib_context *lc, struct raid_set *rs,
 	 struct raid_dev *rd, void *context)
 {
-	return *((uint64_t *) context) >= (META(rd, pdc))->raid.total_secs;
+	return *((uint64_t *) context) >= (((uint64_t)(META(rd, pdc))->raid.total_secs_h << 32) + (META(rd, pdc))->raid.total_secs_l);
 }
 
 static int
@@ -579,7 +583,8 @@
 	DP("raid.raid0_shift: %u", pdc, pdc->raid.raid0_shift);
 	DP("raid.raid0_disks: %u", pdc, pdc->raid.raid0_disks);
 	DP("raid.array_number: %u", pdc, pdc->raid.array_number);
-	DP("raid.total_secs: %u", pdc, pdc->raid.total_secs);
+	DP("raid.total_secs_h: %u", pdc, pdc->raid.total_secs_h);
+	DP("raid.total_secs_l: %u", pdc, pdc->raid.total_secs_l);
 	DP("raid.cylinders: %u", pdc, pdc->raid.cylinders);
 	DP("raid.heads: %u", pdc, pdc->raid.heads);
 	DP("raid.sectors: %u", pdc, pdc->raid.sectors);
Index: dmraid-1.0.0.rc16/1.0.0.rc16/lib/format/ataraid/pdc.h
===================================================================
--- dmraid-1.0.0.rc16.orig/1.0.0.rc16/lib/format/ataraid/pdc.h	2010-07-05 19:28:55.458920904 +0100
+++ dmraid-1.0.0.rc16/1.0.0.rc16/lib/format/ataraid/pdc.h	2010-07-05 19:28:55.538920380 +0100
@@ -61,12 +61,13 @@
 		uint8_t raid0_shift;	/* 0x221 */
 		uint8_t raid0_disks;	/* 0x222 */
 		uint8_t array_number;	/* 0x223 */
-		uint32_t total_secs;	/* 0x224 - 0x227 */
+		uint32_t total_secs_l;	/* 0x224 - 0x227 */
 		uint16_t cylinders;	/* 0x228 - 0x229 */
 		uint8_t heads;	/* 0x22A */
 		uint8_t sectors;	/* 0x22B */
 		uint32_t magic_1;	/* 0x22C - 0x2EF */
-		uint32_t unknown_5;	/* 0x230 - 0x233 */
+		uint16_t unknown_5;	/* 0x230 - 0x231 */
+		uint16_t total_secs_h; /* 0x232 - 0x233 */
 		struct pdc_disk {
 			uint16_t unknown_0;	/* 0x234 - 0x235 */
 			uint8_t channel;	/* 0x236 */



_______________________________________________
Ataraid-list mailing list
Ataraid-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/ataraid-list

[Index of Archives]     [Linux RAID]     [Linux Device Mapper]     [Linux IDE]     [Linux SCSI]     [Kernel]     [Linux Books]     [Linux Admin]     [GFS]     [RPM]     [Yosemite Campgrounds]     [AMD 64]

  Powered by Linux