[PATCH] 2/4: Fix up other metadata handlers

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

 



Hi for a third time,

These are preliminary patches to modify dmraid so that we can have
multiple raid_dev structures per physical device.  The DDF1
specification allows for a disk to participate in multiple RAID arrays,
which is what is gained from these patches.  They've been tested against
2.6.16.19 + dmraid45 on Ubuntu 6.06, and seem to be pretty stable.  At
this stage, I'm looking for comments about the code because it touches
core dmraid code and could (but shouldn't) break support for hardware
that I don't have.

This patch updates the non-DDF metadata handlers to support the new
setup_rd and read_raid_dev function prototypes.

--D

Signed-off-by: Darrick J. Wong <djwong@xxxxxxxxxx>
diff -Naurp v11.orig/lib/format/ataraid/asr.c v11-mdisk3/lib/format/ataraid/asr.c
--- v11.orig/lib/format/ataraid/asr.c	2006-02-17 09:26:44.000000000 -0800
+++ v11-mdisk3/lib/format/ataraid/asr.c	2006-05-25 11:24:40.000000000 -0700
@@ -413,7 +413,8 @@ static void file_metadata_areas(struct l
 }
 
 static int setup_rd(struct lib_context *lc, struct raid_dev *rd,
-		    struct dev_info *di, void *meta, union read_info *info);
+		    struct dev_info *di, void *meta, union read_info *info,
+		    unsigned int num);
 
 static struct raid_dev *asr_read(struct lib_context *lc,
 					struct dev_info *di)
@@ -424,7 +425,7 @@ static struct raid_dev *asr_read(struct 
 	 * converted to the appropriate endianness.
 	 */
 	return read_raid_dev(lc, di, read_metadata_areas, 0, 0, NULL, NULL,
-			     file_metadata_areas, setup_rd, handler);
+			     file_metadata_areas, setup_rd, handler, NULL);
 }
 
 static int set_sort(struct list_head *dont, struct list_head *care)
@@ -771,7 +772,8 @@ int register_asr(struct lib_context *lc)
  * Set up a RAID device from what we've assembled out of the metadata.
  */
 static int setup_rd(struct lib_context *lc, struct raid_dev *rd,
-		    struct dev_info *di, void *meta, union read_info *info)
+		    struct dev_info *di, void *meta, union read_info *info,
+		    unsigned int num)
 {
 	struct asr *asr = meta;
 	struct meta_areas *ma;
diff -Naurp v11.orig/lib/format/ataraid/hpt37x.c v11-mdisk3/lib/format/ataraid/hpt37x.c
--- v11.orig/lib/format/ataraid/hpt37x.c	2006-01-18 04:51:47.000000000 -0800
+++ v11-mdisk3/lib/format/ataraid/hpt37x.c	2006-05-25 11:25:18.000000000 -0700
@@ -143,12 +143,13 @@ static int is_hpt37x(struct lib_context 
 }
 
 static int setup_rd(struct lib_context *lc, struct raid_dev *rd,
-		    struct dev_info *di, void *meta, union read_info *info);
+		    struct dev_info *di, void *meta, union read_info *info,
+		    unsigned int num);
 static struct raid_dev *hpt37x_read(struct lib_context *lc, struct dev_info *di)
 {
 	return read_raid_dev(lc, di, NULL,
 			     sizeof(struct hpt37x), HPT37X_CONFIGOFFSET,
-			     to_cpu, is_hpt37x, NULL, setup_rd, handler);
+			     to_cpu, is_hpt37x, NULL, setup_rd, handler, NULL);
 }
 
 /*
@@ -387,7 +388,8 @@ static uint64_t sectors(struct raid_dev 
 
 /* Derive the RAID device contents from the Highpoint ones. */
 static int setup_rd(struct lib_context *lc, struct raid_dev *rd,
-		    struct dev_info *di, void *meta, union read_info *info)
+		    struct dev_info *di, void *meta, union read_info *info,
+		    unsigned int num)
 {
 	struct hpt37x *hpt = meta;
 
diff -Naurp v11.orig/lib/format/ataraid/hpt45x.c v11-mdisk3/lib/format/ataraid/hpt45x.c
--- v11.orig/lib/format/ataraid/hpt45x.c	2006-02-07 04:09:15.000000000 -0800
+++ v11-mdisk3/lib/format/ataraid/hpt45x.c	2006-05-25 11:26:10.000000000 -0700
@@ -196,13 +196,14 @@ static int is_hpt45x(struct lib_context 
 }
 
 static int setup_rd(struct lib_context *lc, struct raid_dev *rd,
-		    struct dev_info *di, void *meta, union read_info *info);
+		    struct dev_info *di, void *meta, union read_info *info,
+		    unsigned int num);
 static struct raid_dev *hpt45x_read(struct lib_context *lc,
 				      struct dev_info *di)
 {
 	return read_raid_dev(lc, di, NULL,
 			     sizeof(struct hpt45x), HPT45X_CONFIGOFFSET,
-			     to_cpu, is_hpt45x, NULL, setup_rd, handler);
+			     to_cpu, is_hpt45x, NULL, setup_rd, handler, NULL);
 }
 
 /*
@@ -333,7 +334,8 @@ static uint64_t sectors(struct raid_dev 
 
 /* Set the RAID device contents up derived from the Highpoint ones */
 static int setup_rd(struct lib_context *lc, struct raid_dev *rd,
-		    struct dev_info *di, void *meta, union read_info *info)
+		    struct dev_info *di, void *meta, union read_info *info,
+		    unsigned int num)
 {
 	struct hpt45x *hpt = meta;
 
diff -Naurp v11.orig/lib/format/ataraid/isw.c v11-mdisk3/lib/format/ataraid/isw.c
--- v11.orig/lib/format/ataraid/isw.c	2006-03-31 07:00:38.000000000 -0800
+++ v11-mdisk3/lib/format/ataraid/isw.c	2006-05-25 11:26:28.000000000 -0700
@@ -352,11 +352,12 @@ static void *isw_read_metadata(struct li
 }
 
 static int setup_rd(struct lib_context *lc, struct raid_dev *rd,
-		    struct dev_info *di, void *meta, union read_info *info);
+		    struct dev_info *di, void *meta, union read_info *info,
+		    unsigned int num);
 static struct raid_dev *isw_read(struct lib_context *lc, struct dev_info *di)
 {
 	return read_raid_dev(lc, di, isw_read_metadata, 0, 0, NULL, NULL,
-			     isw_file_metadata, setup_rd, handler);
+			     isw_file_metadata, setup_rd, handler, NULL);
 }
 
 /*
@@ -771,7 +772,8 @@ int register_isw(struct lib_context *lc)
  * on this RAID disk.
  */
 static int setup_rd(struct lib_context *lc, struct raid_dev *rd,
-		    struct dev_info *di, void *meta, union read_info *info)
+		    struct dev_info *di, void *meta, union read_info *info,
+		    unsigned int num)
 {
 	struct isw *isw = meta;
 
diff -Naurp v11.orig/lib/format/ataraid/jm.c v11-mdisk3/lib/format/ataraid/jm.c
--- v11.orig/lib/format/ataraid/jm.c	2006-02-20 07:05:52.000000000 -0800
+++ v11-mdisk3/lib/format/ataraid/jm.c	2006-05-25 11:26:45.000000000 -0700
@@ -223,13 +223,14 @@ static int is_jm(struct lib_context *lc,
 }
 
 static int setup_rd(struct lib_context *lc, struct raid_dev *rd,
-		    struct dev_info *di, void *meta, union read_info *info);
+		    struct dev_info *di, void *meta, union read_info *info,
+		    unsigned int num);
 static struct raid_dev *jm_read(struct lib_context *lc,
 				      struct dev_info *di)
 {
 	return read_raid_dev(lc, di, NULL,
 			     sizeof(struct jm), JM_CONFIGOFFSET,
-			     to_cpu, is_jm, NULL, setup_rd, handler);
+			     to_cpu, is_jm, NULL, setup_rd, handler, NULL);
 }
 
 /*
@@ -354,7 +355,8 @@ static inline uint64_t sectors(struct jm
 
 /* Set the RAID device contents up derived from the JMicron ones */
 static int setup_rd(struct lib_context *lc, struct raid_dev *rd,
-		    struct dev_info *di, void *meta, union read_info *info)
+		    struct dev_info *di, void *meta, union read_info *info,
+		    unsigned int num)
 {
 	struct jm *jm = meta;
 
diff -Naurp v11.orig/lib/format/ataraid/lsi.c v11-mdisk3/lib/format/ataraid/lsi.c
--- v11.orig/lib/format/ataraid/lsi.c	2006-03-28 05:13:37.000000000 -0800
+++ v11-mdisk3/lib/format/ataraid/lsi.c	2006-05-25 11:27:12.000000000 -0700
@@ -138,12 +138,13 @@ static int is_lsi(struct lib_context *lc
 }
 
 static int setup_rd(struct lib_context *lc, struct raid_dev *rd,
-		    struct dev_info *di, void *meta, union read_info *info);
+		    struct dev_info *di, void *meta, union read_info *info,
+		    unsigned int num);
 static struct raid_dev *lsi_read(struct lib_context *lc, struct dev_info *di)
 {
 	return read_raid_dev(lc, di, NULL,
 			     sizeof(struct lsi), LSI_CONFIGOFFSET, 
-			     to_cpu, is_lsi, NULL, setup_rd, handler);
+			     to_cpu, is_lsi, NULL, setup_rd, handler, NULL);
 }
 
 /*
@@ -334,7 +335,8 @@ int register_lsi(struct lib_context *lc)
 
 /* Set the RAID device contents up derived from the LSI ones */
 static int setup_rd(struct lib_context *lc, struct raid_dev *rd,
-		    struct dev_info *di, void *meta, union read_info *info)
+		    struct dev_info *di, void *meta, union read_info *info,
+		    unsigned int num)
 {
 	struct lsi *lsi = meta;
 
diff -Naurp v11.orig/lib/format/ataraid/nv.c v11-mdisk3/lib/format/ataraid/nv.c
--- v11.orig/lib/format/ataraid/nv.c	2006-03-23 04:33:00.000000000 -0800
+++ v11-mdisk3/lib/format/ataraid/nv.c	2006-05-25 11:27:35.000000000 -0700
@@ -209,12 +209,13 @@ static int is_nv(struct lib_context *lc,
 }
 	
 static int setup_rd(struct lib_context *lc, struct raid_dev *rd,
-		    struct dev_info *di, void *meta, union read_info *info);
+		    struct dev_info *di, void *meta, union read_info *info,
+		    unsigned int num);
 static struct raid_dev *nv_read(struct lib_context *lc, struct dev_info *di)
 {
 	return read_raid_dev(lc, di, NULL,
 			     sizeof(struct nv), NV_CONFIGOFFSET,
-			     to_cpu, is_nv, NULL, setup_rd, handler);
+			     to_cpu, is_nv, NULL, setup_rd, handler, NULL);
 }
 
 /* Write private RAID metadata to device */
@@ -408,7 +409,8 @@ int register_nv(struct lib_context *lc)
 
 /* Set the RAID device contents up derived from the NV ones */
 static int setup_rd(struct lib_context *lc, struct raid_dev *rd,
-		    struct dev_info *di, void *meta, union read_info *info)
+		    struct dev_info *di, void *meta, union read_info *info,
+		    unsigned int num)
 {
 	struct nv *nv = meta;
 
diff -Naurp v11.orig/lib/format/ataraid/pdc.c v11-mdisk3/lib/format/ataraid/pdc.c
--- v11.orig/lib/format/ataraid/pdc.c	2006-03-16 06:08:53.000000000 -0800
+++ v11-mdisk3/lib/format/ataraid/pdc.c	2006-05-25 11:27:59.000000000 -0700
@@ -186,11 +186,12 @@ static int is_pdc(struct lib_context *lc
 }
 
 static int setup_rd(struct lib_context *lc, struct raid_dev *rd,
-		    struct dev_info *di, void *meta, union read_info *info);
+		    struct dev_info *di, void *meta, union read_info *info,
+		    unsigned int num);
 static struct raid_dev *pdc_read(struct lib_context *lc, struct dev_info *di)
 { 
 	return read_raid_dev(lc, di, pdc_read_metadata, 0, 0, to_cpu, is_pdc,
-			     NULL, setup_rd, handler);
+			     NULL, setup_rd, handler, NULL);
 }
 
 /*
@@ -444,7 +445,8 @@ static uint64_t sectors(struct raid_dev 
 
 /* Set the RAID device contents up derived from the PDC ones */
 static int setup_rd(struct lib_context *lc, struct raid_dev *rd,
-		    struct dev_info *di, void *meta, union read_info *info)
+		    struct dev_info *di, void *meta, union read_info *info,
+		    unsigned int num)
 {
 	unsigned int meta_sector;
 	struct pdc *pdc = meta;
diff -Naurp v11.orig/lib/format/ataraid/sil.c v11-mdisk3/lib/format/ataraid/sil.c
--- v11.orig/lib/format/ataraid/sil.c	2006-03-23 04:33:23.000000000 -0800
+++ v11-mdisk3/lib/format/ataraid/sil.c	2006-05-25 11:28:19.000000000 -0700
@@ -253,11 +253,12 @@ static void sil_file_metadata(struct lib
 }
 
 static int setup_rd(struct lib_context *lc, struct raid_dev *rd,
-		    struct dev_info *di, void *meta, union read_info *info);
+		    struct dev_info *di, void *meta, union read_info *info,
+		    unsigned int num);
 static struct raid_dev *sil_read(struct lib_context *lc, struct dev_info *di)
 {
 	return read_raid_dev(lc, di, sil_read_metadata, 0, 0, NULL, NULL,
-			     sil_file_metadata, setup_rd, handler);
+			     sil_file_metadata, setup_rd, handler, NULL);
 
 }
 
@@ -565,7 +566,8 @@ static struct sil *quorate(struct lib_co
 }
 
 static int setup_rd(struct lib_context *lc, struct raid_dev *rd,
-		    struct dev_info *di, void *meta, union read_info *info)
+		    struct dev_info *di, void *meta, union read_info *info,
+		    unsigned int num)
 {
 	unsigned int i;
 	struct meta_areas *ma;
diff -Naurp v11.orig/lib/format/ataraid/via.c v11-mdisk3/lib/format/ataraid/via.c
--- v11.orig/lib/format/ataraid/via.c	2006-01-18 04:55:03.000000000 -0800
+++ v11-mdisk3/lib/format/ataraid/via.c	2006-05-25 11:28:36.000000000 -0700
@@ -163,12 +163,13 @@ static int is_via(struct lib_context *lc
 }
 
 static int setup_rd(struct lib_context *lc, struct raid_dev *rd,
-		    struct dev_info *di, void *meta, union read_info *info);
+		    struct dev_info *di, void *meta, union read_info *info,
+		    unsigned int num);
 static struct raid_dev *via_read(struct lib_context *lc, struct dev_info *di)
 {
 	return read_raid_dev(lc, di, NULL,
 			     sizeof(struct via), VIA_CONFIGOFFSET,
-			     to_cpu, is_via, NULL, setup_rd, handler);
+			     to_cpu, is_via, NULL, setup_rd, handler, NULL);
 }
 
 /* Decide about ordering sequence of RAID device. */
@@ -388,7 +389,8 @@ int register_via(struct lib_context *lc)
 }
 
 static int setup_rd(struct lib_context *lc, struct raid_dev *rd,
-		    struct dev_info *di, void *meta, union read_info *info)
+		    struct dev_info *di, void *meta, union read_info *info,
+		    unsigned int num)
 {
 	struct via *via = meta;
 
diff -Naurp v11.orig/lib/format/partition/dos.c v11-mdisk3/lib/format/partition/dos.c
--- v11.orig/lib/format/partition/dos.c	2006-01-18 04:55:09.000000000 -0800
+++ v11-mdisk3/lib/format/partition/dos.c	2006-05-25 11:31:47.000000000 -0700
@@ -94,13 +94,14 @@ static void dos_file_metadata(struct lib
 
 /* Allocate a DOS partition sector struct and read the data. */
 static int setup_rd(struct lib_context *lc, struct raid_dev *rd,
-		    struct dev_info *di, void *meta, union read_info *info);
+		    struct dev_info *di, void *meta, union read_info *info,
+		    unsigned int num);
 static struct raid_dev *dos_read(struct lib_context *lc, struct dev_info *di)
 {
 	return read_raid_dev(lc, di, NULL,
 			     sizeof(struct dos), DOS_CONFIGOFFSET,
 			     to_cpu, is_dos, dos_file_metadata,
-			     setup_rd, handler);
+			     setup_rd, handler, NULL);
 }
 
 /* Support functions for dos_group to read the partition table(s). */
@@ -382,7 +383,8 @@ int register_dos(struct lib_context *lc)
  * partition table sector and let dos_group do the rest...
  */
 static int setup_rd(struct lib_context *lc, struct raid_dev *rd,
-		    struct dev_info *di, void *meta, union read_info *info)
+		    struct dev_info *di, void *meta, union read_info *info,
+		    unsigned int num)
 {
 	struct dos *dos = meta;
 
_______________________________________________

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