diff options
| -rw-r--r-- | drivers/md/md.h | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/drivers/md/md.h b/drivers/md/md.h index 14367d919351..318ca8fd430f 100644 --- a/drivers/md/md.h +++ b/drivers/md/md.h | |||
| @@ -474,13 +474,6 @@ static inline int mddev_trylock(struct mddev *mddev) | |||
| 474 | } | 474 | } |
| 475 | extern void mddev_unlock(struct mddev *mddev); | 475 | extern void mddev_unlock(struct mddev *mddev); |
| 476 | 476 | ||
| 477 | static inline void rdev_dec_pending(struct md_rdev *rdev, struct mddev *mddev) | ||
| 478 | { | ||
| 479 | int faulty = test_bit(Faulty, &rdev->flags); | ||
| 480 | if (atomic_dec_and_test(&rdev->nr_pending) && faulty) | ||
| 481 | set_bit(MD_RECOVERY_NEEDED, &mddev->recovery); | ||
| 482 | } | ||
| 483 | |||
| 484 | static inline void md_sync_acct(struct block_device *bdev, unsigned long nr_sectors) | 477 | static inline void md_sync_acct(struct block_device *bdev, unsigned long nr_sectors) |
| 485 | { | 478 | { |
| 486 | atomic_add(nr_sectors, &bdev->bd_contains->bd_disk->sync_io); | 479 | atomic_add(nr_sectors, &bdev->bd_contains->bd_disk->sync_io); |
| @@ -666,4 +659,14 @@ static inline int mddev_check_plugged(struct mddev *mddev) | |||
| 666 | return !!blk_check_plugged(md_unplug, mddev, | 659 | return !!blk_check_plugged(md_unplug, mddev, |
| 667 | sizeof(struct blk_plug_cb)); | 660 | sizeof(struct blk_plug_cb)); |
| 668 | } | 661 | } |
| 662 | |||
| 663 | static inline void rdev_dec_pending(struct md_rdev *rdev, struct mddev *mddev) | ||
| 664 | { | ||
| 665 | int faulty = test_bit(Faulty, &rdev->flags); | ||
| 666 | if (atomic_dec_and_test(&rdev->nr_pending) && faulty) { | ||
| 667 | set_bit(MD_RECOVERY_NEEDED, &mddev->recovery); | ||
| 668 | md_wakeup_thread(mddev->thread); | ||
| 669 | } | ||
| 670 | } | ||
| 671 | |||
| 669 | #endif /* _MD_MD_H */ | 672 | #endif /* _MD_MD_H */ |
