MD RAID10: Minor non-functional code changes
authorJonathan Brassow <jbrassow@redhat.com>
Thu, 21 Feb 2013 02:28:09 +0000 (13:28 +1100)
committerNeilBrown <neilb@suse.de>
Tue, 26 Feb 2013 00:55:27 +0000 (11:55 +1100)
Changes include assigning 'addr' from 's' instead of 'sector' to be
consistent with the way the code does it just a few lines later and
using '%=' vs a conditional and subtraction.

Signed-off-by: Jonathan Brassow <jbrassow@redhat.com>
Signed-off-by: NeilBrown <neilb@suse.de>
drivers/md/raid10.c

index 1a74c12f0a6efb39be78c563d92dc427c54c4084..de174ad6f8bdc60b9ed49dcd78ca3dc2f5ebcb9f 100644 (file)
@@ -552,14 +552,13 @@ static void __raid10_find_phys(struct geom *geo, struct r10bio *r10bio)
        for (n = 0; n < geo->near_copies; n++) {
                int d = dev;
                sector_t s = sector;
-               r10bio->devs[slot].addr = sector;
                r10bio->devs[slot].devnum = d;
+               r10bio->devs[slot].addr = s;
                slot++;
 
                for (f = 1; f < geo->far_copies; f++) {
                        d += geo->near_copies;
-                       if (d >= geo->raid_disks)
-                               d -= geo->raid_disks;
+                       d %= geo->raid_disks;
                        s += geo->stride;
                        r10bio->devs[slot].devnum = d;
                        r10bio->devs[slot].addr = s;