]> git.ipfire.org Git - thirdparty/mdadm.git/blobdiff - super-ddf.c
mdadm/test: add new testcase for testing readonly/readwrite
[thirdparty/mdadm.git] / super-ddf.c
index 769eded3bba8a8926aa6c64766fbb79fed3bd68b..d02a19a21010aae12cd4d76f5b1708e221e6664a 100644 (file)
@@ -932,14 +932,13 @@ static int load_ddf_headers(int fd, struct ddf_super *super, char *devname)
        if (load_ddf_header(fd, be64_to_cpu(super->anchor.secondary_lba),
                            dsize >> 9,  2,
                            &super->secondary, &super->anchor)) {
-               if (super->active == NULL
-                   || (be32_to_cpu(super->primary.seq)
-                       < be32_to_cpu(super->secondary.seq) &&
-                       !super->secondary.openflag)
-                   || (be32_to_cpu(super->primary.seq)
-                       == be32_to_cpu(super->secondary.seq) &&
-                       super->primary.openflag && !super->secondary.openflag)
-                       )
+               if (super->active == NULL ||
+                   (be32_to_cpu(super->primary.seq)
+                    < be32_to_cpu(super->secondary.seq) &&
+                       !super->secondary.openflag) ||
+                   (be32_to_cpu(super->primary.seq) ==
+                    be32_to_cpu(super->secondary.seq) &&
+                       super->primary.openflag && !super->secondary.openflag))
                        super->active = &super->secondary;
        } else if (devname &&
                   be64_to_cpu(super->anchor.secondary_lba) != ~(__u64)0)
@@ -1884,8 +1883,8 @@ static struct vd_config *find_vdcr(struct ddf_super *ddf, unsigned int inst,
                nsec = n / be16_to_cpu(conf->prim_elmnt_count);
                if (conf->sec_elmnt_seq != nsec) {
                        for (ibvd = 1; ibvd < conf->sec_elmnt_count; ibvd++) {
-                               if (v->other_bvds[ibvd-1]->sec_elmnt_seq
-                                   == nsec)
+                               if (v->other_bvds[ibvd-1]->sec_elmnt_seq ==
+                                   nsec)
                                        break;
                        }
                        if (ibvd == conf->sec_elmnt_count)
@@ -3512,8 +3511,8 @@ static int validate_geometry_ddf_bvd(struct supertype *st,
                if (minsize == 0)
                        minsize = 8;
                for (dl = ddf->dlist; dl ; dl = dl->next) {
-                       if (find_space(ddf, dl, data_offset, &minsize)
-                           != INVALID_SECTORS)
+                       if (find_space(ddf, dl, data_offset, &minsize) !=
+                           INVALID_SECTORS)
                                dcnt++;
                }
                if (dcnt < raiddisks) {
@@ -3815,13 +3814,13 @@ static struct mdinfo *container_content_ddf(struct supertype *st, char *subarray
                        unsigned int iphys;
                        int stt;
 
-                       if (be32_to_cpu(ddf->phys->entries[pd].refnum)
-                           == 0xFFFFFFFF)
+                       if (be32_to_cpu(ddf->phys->entries[pd].refnum) ==
+                           0xffffffff)
                                continue;
 
                        stt = be16_to_cpu(ddf->phys->entries[pd].state);
-                       if ((stt & (DDF_Online|DDF_Failed|DDF_Rebuilding))
-                           != DDF_Online)
+                       if ((stt & (DDF_Online|DDF_Failed|DDF_Rebuilding)) !=
+                           DDF_Online)
                                continue;
 
                        i = get_pd_index_from_refnum(
@@ -4005,8 +4004,8 @@ static int compare_super_ddf(struct supertype *st, struct supertype *tst)
                        continue;
 
                if (posix_memalign((void **)&dl1, 512,
-                      sizeof(*dl1) + (first->max_part) * sizeof(dl1->vlist[0]))
-                   != 0) {
+                                  sizeof(*dl1) + (first->max_part) *
+                                  sizeof(dl1->vlist[0])) != 0) {
                        pr_err("could not allocate disk info buffer\n");
                        return 3;
                }
@@ -4206,8 +4205,8 @@ static int get_bvd_state(const struct ddf_super *ddf,
                if (pd < 0)
                        continue;
                st = be16_to_cpu(ddf->phys->entries[pd].state);
-               if ((st & (DDF_Online|DDF_Failed|DDF_Rebuilding))
-                   == DDF_Online) {
+               if ((st & (DDF_Online|DDF_Failed|DDF_Rebuilding)) ==
+                   DDF_Online) {
                        working++;
                        avail[i] = 1;
                }