diff options
author | Byungchul Park <byungchul.park@lge.com> | 2017-02-14 02:26:24 -0500 |
---|---|---|
committer | Shaohua Li <shli@fb.com> | 2017-02-16 17:49:05 -0500 |
commit | eae8263fb1f4256460270dd8f42334604dcdfac6 (patch) | |
tree | fbf48e0c68d190e8480ccf07c1b6ef919d745cad | |
parent | d7a1030839d35c04a620e841f406b9b2a8600041 (diff) |
md/raid5: Don't reinvent the wheel but use existing llist API
Although llist provides proper APIs, they are not used. Make them used.
Signed-off-by: Byungchul Park <byungchul.park@lge.com>
Signed-off-by: Shaohua Li <shli@fb.com>
-rw-r--r-- | drivers/md/raid5.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c index b193316804d4..7b7722bb2e8d 100644 --- a/drivers/md/raid5.c +++ b/drivers/md/raid5.c | |||
@@ -353,17 +353,15 @@ static void release_inactive_stripe_list(struct r5conf *conf, | |||
353 | static int release_stripe_list(struct r5conf *conf, | 353 | static int release_stripe_list(struct r5conf *conf, |
354 | struct list_head *temp_inactive_list) | 354 | struct list_head *temp_inactive_list) |
355 | { | 355 | { |
356 | struct stripe_head *sh; | 356 | struct stripe_head *sh, *t; |
357 | int count = 0; | 357 | int count = 0; |
358 | struct llist_node *head; | 358 | struct llist_node *head; |
359 | 359 | ||
360 | head = llist_del_all(&conf->released_stripes); | 360 | head = llist_del_all(&conf->released_stripes); |
361 | head = llist_reverse_order(head); | 361 | head = llist_reverse_order(head); |
362 | while (head) { | 362 | llist_for_each_entry_safe(sh, t, head, release_list) { |
363 | int hash; | 363 | int hash; |
364 | 364 | ||
365 | sh = llist_entry(head, struct stripe_head, release_list); | ||
366 | head = llist_next(head); | ||
367 | /* sh could be readded after STRIPE_ON_RELEASE_LIST is cleard */ | 365 | /* sh could be readded after STRIPE_ON_RELEASE_LIST is cleard */ |
368 | smp_mb(); | 366 | smp_mb(); |
369 | clear_bit(STRIPE_ON_RELEASE_LIST, &sh->state); | 367 | clear_bit(STRIPE_ON_RELEASE_LIST, &sh->state); |