/* drbd_rs_cancel_all() - Removes all extents from the resync LRU (even BME_LOCKED) @mdev: DRBD device.  */
void drbd_rs_cancel_all(struct drbd_conf *mdev)
/* drbd_rs_cancel_all() - Removes all extents from the resync LRU (even BME_LOCKED) @mdev: DRBD device.  */
void drbd_rs_cancel_all(struct drbd_conf *mdev)
{
	spin_lock_irq(&mdev->al_lock);
	if (get_ldev_if_state(mdev, D_FAILED)) {
		lc_reset(mdev->resync);
		put_ldev(mdev);
	}
	mdev->resync_locked = 0;
	mdev->resync_wenr = LC_FREE;
	spin_unlock_irq(&mdev->al_lock);
	wake_up(&mdev->al_wait);
}