summaryrefslogtreecommitdiff
path: root/drivers/md/raid10.c
diff options
context:
space:
mode:
authorJonathan Brassow <jbrassow@redhat.com>2013-02-21 13:28:09 +1100
committerNeilBrown <neilb@suse.de>2013-02-26 11:55:27 +1100
commit4c0ca26bd260dddf3b9781758cb5e2df3f74d4a3 (patch)
treeb9d8fc9c62a075db9ef41a4df1c22b0e31f6955c /drivers/md/raid10.c
parentc8dc9c654794a765ca61baed07f84ed8aaa7ca8c (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/raid10.c')
-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;