Merge branch 'for-upstream' of git://openrisc.net/jonas/linux
[pandora-kernel.git] / drivers / block / drbd / drbd_bitmap.c
index 1e89a74..7b97629 100644 (file)
@@ -991,6 +991,9 @@ static void bm_page_io_async(struct bm_aio_ctx *ctx, int page_nr, int rw) __must
                bio_endio(bio, -EIO);
        } else {
                submit_bio(rw, bio);
+               /* this should not count as user activity and cause the
+                * resync to throttle -- see drbd_rs_should_slow_down(). */
+               atomic_add(len >> 9, &mdev->rs_sect_ev);
        }
 }
 
@@ -1400,8 +1403,10 @@ void _drbd_bm_set_bits(struct drbd_conf *mdev, const unsigned long s, const unsi
        /* first and full pages, unless first page == last page */
        for (page_nr = first_page; page_nr < last_page; page_nr++) {
                bm_set_full_words_within_one_page(mdev->bitmap, page_nr, first_word, last_word);
-               cond_resched_lock(&b->bm_lock);
+               spin_unlock_irq(&b->bm_lock);
+               cond_resched();
                first_word = 0;
+               spin_lock_irq(&b->bm_lock);
        }
 
        /* last page (respectively only page, for first page == last page) */