diff options
author | NeilBrown <neilb@suse.de> | 2009-03-31 00:10:16 -0400 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2009-03-31 00:10:16 -0400 |
commit | 34e04e87fb8b2c62c9e8868f41c8179d0e15f51a (patch) | |
tree | 19d62e6b77f6f786902cc5ab5f8f068fb889efe1 /drivers/md/raid5.c | |
parent | f701d589aa34d7531183c9ac6f7713ba14212b02 (diff) |
md/raid5: drop qd_idx from r6_state
We now have this value in stripe_head so we don't need to duplicate
it.
Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'drivers/md/raid5.c')
-rw-r--r-- | drivers/md/raid5.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c index 1f1b054ff0b6..3930b3e9aa04 100644 --- a/drivers/md/raid5.c +++ b/drivers/md/raid5.c | |||
@@ -2371,7 +2371,7 @@ static void handle_stripe_dirtying6(raid5_conf_t *conf, | |||
2371 | struct r6_state *r6s, int disks) | 2371 | struct r6_state *r6s, int disks) |
2372 | { | 2372 | { |
2373 | int rcw = 0, must_compute = 0, pd_idx = sh->pd_idx, i; | 2373 | int rcw = 0, must_compute = 0, pd_idx = sh->pd_idx, i; |
2374 | int qd_idx = r6s->qd_idx; | 2374 | int qd_idx = sh->qd_idx; |
2375 | for (i = disks; i--; ) { | 2375 | for (i = disks; i--; ) { |
2376 | struct r5dev *dev = &sh->dev[i]; | 2376 | struct r5dev *dev = &sh->dev[i]; |
2377 | /* Would I have to read this buffer for reconstruct_write */ | 2377 | /* Would I have to read this buffer for reconstruct_write */ |
@@ -2561,7 +2561,7 @@ static void handle_parity_checks6(raid5_conf_t *conf, struct stripe_head *sh, | |||
2561 | int update_p = 0, update_q = 0; | 2561 | int update_p = 0, update_q = 0; |
2562 | struct r5dev *dev; | 2562 | struct r5dev *dev; |
2563 | int pd_idx = sh->pd_idx; | 2563 | int pd_idx = sh->pd_idx; |
2564 | int qd_idx = r6s->qd_idx; | 2564 | int qd_idx = sh->qd_idx; |
2565 | 2565 | ||
2566 | set_bit(STRIPE_HANDLE, &sh->state); | 2566 | set_bit(STRIPE_HANDLE, &sh->state); |
2567 | 2567 | ||
@@ -2657,7 +2657,7 @@ static void handle_stripe_expansion(raid5_conf_t *conf, struct stripe_head *sh, | |||
2657 | struct dma_async_tx_descriptor *tx = NULL; | 2657 | struct dma_async_tx_descriptor *tx = NULL; |
2658 | clear_bit(STRIPE_EXPAND_SOURCE, &sh->state); | 2658 | clear_bit(STRIPE_EXPAND_SOURCE, &sh->state); |
2659 | for (i = 0; i < sh->disks; i++) | 2659 | for (i = 0; i < sh->disks; i++) |
2660 | if (i != sh->pd_idx && (!r6s || i != r6s->qd_idx)) { | 2660 | if (i != sh->pd_idx && i != sh->qd_idx) { |
2661 | int dd_idx, j; | 2661 | int dd_idx, j; |
2662 | struct stripe_head *sh2; | 2662 | struct stripe_head *sh2; |
2663 | 2663 | ||
@@ -2984,17 +2984,16 @@ static bool handle_stripe6(struct stripe_head *sh, struct page *tmp_page) | |||
2984 | raid5_conf_t *conf = sh->raid_conf; | 2984 | raid5_conf_t *conf = sh->raid_conf; |
2985 | int disks = sh->disks; | 2985 | int disks = sh->disks; |
2986 | struct bio *return_bi = NULL; | 2986 | struct bio *return_bi = NULL; |
2987 | int i, pd_idx = sh->pd_idx; | 2987 | int i, pd_idx = sh->pd_idx, qd_idx = sh->qd_idx; |
2988 | struct stripe_head_state s; | 2988 | struct stripe_head_state s; |
2989 | struct r6_state r6s; | 2989 | struct r6_state r6s; |
2990 | struct r5dev *dev, *pdev, *qdev; | 2990 | struct r5dev *dev, *pdev, *qdev; |
2991 | mdk_rdev_t *blocked_rdev = NULL; | 2991 | mdk_rdev_t *blocked_rdev = NULL; |
2992 | 2992 | ||
2993 | r6s.qd_idx = sh->qd_idx; | ||
2994 | pr_debug("handling stripe %llu, state=%#lx cnt=%d, " | 2993 | pr_debug("handling stripe %llu, state=%#lx cnt=%d, " |
2995 | "pd_idx=%d, qd_idx=%d\n", | 2994 | "pd_idx=%d, qd_idx=%d\n", |
2996 | (unsigned long long)sh->sector, sh->state, | 2995 | (unsigned long long)sh->sector, sh->state, |
2997 | atomic_read(&sh->count), pd_idx, r6s.qd_idx); | 2996 | atomic_read(&sh->count), pd_idx, qd_idx); |
2998 | memset(&s, 0, sizeof(s)); | 2997 | memset(&s, 0, sizeof(s)); |
2999 | 2998 | ||
3000 | spin_lock(&sh->lock); | 2999 | spin_lock(&sh->lock); |
@@ -3105,9 +3104,9 @@ static bool handle_stripe6(struct stripe_head *sh, struct page *tmp_page) | |||
3105 | pdev = &sh->dev[pd_idx]; | 3104 | pdev = &sh->dev[pd_idx]; |
3106 | r6s.p_failed = (s.failed >= 1 && r6s.failed_num[0] == pd_idx) | 3105 | r6s.p_failed = (s.failed >= 1 && r6s.failed_num[0] == pd_idx) |
3107 | || (s.failed >= 2 && r6s.failed_num[1] == pd_idx); | 3106 | || (s.failed >= 2 && r6s.failed_num[1] == pd_idx); |
3108 | qdev = &sh->dev[r6s.qd_idx]; | 3107 | qdev = &sh->dev[qd_idx]; |
3109 | r6s.q_failed = (s.failed >= 1 && r6s.failed_num[0] == r6s.qd_idx) | 3108 | r6s.q_failed = (s.failed >= 1 && r6s.failed_num[0] == qd_idx) |
3110 | || (s.failed >= 2 && r6s.failed_num[1] == r6s.qd_idx); | 3109 | || (s.failed >= 2 && r6s.failed_num[1] == qd_idx); |
3111 | 3110 | ||
3112 | if ( s.written && | 3111 | if ( s.written && |
3113 | ( r6s.p_failed || ((test_bit(R5_Insync, &pdev->flags) | 3112 | ( r6s.p_failed || ((test_bit(R5_Insync, &pdev->flags) |