summaryrefslogtreecommitdiff
path: root/drivers/md
diff options
context:
space:
mode:
authorJonathan Brassow <jbrassow@redhat.com>2012-12-17 12:33:50 -0600
committerNeilBrown <neilb@suse.de>2013-02-05 09:24:36 +1100
commit8fe3224d93b335e6dcec9e4630791716ba35cf15 (patch)
tree74409897b95a7ded09df6ad989c6e5689595a7bf /drivers/md
parentc3e7525db53a82b380f975931cd39d4ea9cdb131 (diff)
MD RAID10: Minor non-functional code changes
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>
Diffstat (limited to 'drivers/md')
-rw-r--r--drivers/md/raid10.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c
index 1a74c12f0a6e..de174ad6f8bd 100644
--- a/drivers/md/raid10.c
+++ b/drivers/md/raid10.c
@@ -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;