]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
md/raid6: cleanup ops_run_compute6_2
authorDan Williams <dan.j.williams@intel.com>
Wed, 16 Sep 2009 19:24:54 +0000 (12:24 -0700)
committerDan Williams <dan.j.williams@intel.com>
Wed, 16 Sep 2009 19:24:54 +0000 (12:24 -0700)
Neil says:
"It is correct as it stands, but the fact that every branch in
 the 'if' part ends with a 'return' isn't immediately obvious,
 so it is clearer if we are explicit about the if / then / else
 structure."

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
drivers/md/raid5.c

index 0a5f03d93aef34fa066a71000152932962a9a6cb..1898eda60722594e4f52e7995f8e1b22553de5dd 100644 (file)
@@ -810,7 +810,7 @@ ops_run_compute6_2(struct stripe_head *sh, struct raid5_percpu *percpu)
        BUG_ON(!test_bit(R5_Wantcompute, &tgt->flags));
        BUG_ON(!test_bit(R5_Wantcompute, &tgt2->flags));
 
-       /* we need to open-code set_syndrome_sources to handle to the
+       /* we need to open-code set_syndrome_sources to handle the
         * slot number conversion for 'faila' and 'failb'
         */
        for (i = 0; i < disks ; i++)
@@ -879,18 +879,21 @@ ops_run_compute6_2(struct stripe_head *sh, struct raid5_percpu *percpu)
                        return async_gen_syndrome(blocks, 0, count+2,
                                                  STRIPE_SIZE, &submit);
                }
-       }
-
-       init_async_submit(&submit, ASYNC_TX_FENCE, NULL, ops_complete_compute,
-                         sh, to_addr_conv(sh, percpu));
-       if (failb == syndrome_disks) {
-               /* We're missing D+P. */
-               return async_raid6_datap_recov(syndrome_disks+2, STRIPE_SIZE,
-                                              faila, blocks, &submit);
        } else {
-               /* We're missing D+D. */
-               return async_raid6_2data_recov(syndrome_disks+2, STRIPE_SIZE,
-                                              faila, failb, blocks, &submit);
+               init_async_submit(&submit, ASYNC_TX_FENCE, NULL,
+                                 ops_complete_compute, sh,
+                                 to_addr_conv(sh, percpu));
+               if (failb == syndrome_disks) {
+                       /* We're missing D+P. */
+                       return async_raid6_datap_recov(syndrome_disks+2,
+                                                      STRIPE_SIZE, faila,
+                                                      blocks, &submit);
+               } else {
+                       /* We're missing D+D. */
+                       return async_raid6_2data_recov(syndrome_disks+2,
+                                                      STRIPE_SIZE, faila, failb,
+                                                      blocks, &submit);
+               }
        }
 }