aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/drbd
diff options
context:
space:
mode:
authorLars Ellenberg <lars.ellenberg@linbit.com>2011-01-24 08:58:39 -0500
committerPhilipp Reisner <philipp.reisner@linbit.com>2011-03-10 05:48:12 -0500
commite99dc367b3aafb1ce2d5d92e94834d07b299e1d7 (patch)
tree8fad9b684369f49c2e8100ae0afa8eccfe0d59a5 /drivers/block/drbd
parent10f6d9926cd17afff9dc03c967706419798b4929 (diff)
drbd: kill dead code
This code became obsolete and unused last December with drbd: bitmap keep track of changes vs on-disk bitmap Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
Diffstat (limited to 'drivers/block/drbd')
-rw-r--r--drivers/block/drbd/drbd_actlog.c93
1 files changed, 0 insertions, 93 deletions
diff --git a/drivers/block/drbd/drbd_actlog.c b/drivers/block/drbd/drbd_actlog.c
index 090fc2ce0df4..a6050791401b 100644
--- a/drivers/block/drbd/drbd_actlog.c
+++ b/drivers/block/drbd/drbd_actlog.c
@@ -569,99 +569,6 @@ static void atodb_endio(struct bio *bio, int error)
569 put_ldev(mdev); 569 put_ldev(mdev);
570} 570}
571 571
572/* sector to word */
573#define S2W(s) ((s)<<(BM_EXT_SHIFT-BM_BLOCK_SHIFT-LN2_BPL))
574
575/* activity log to on disk bitmap -- prepare bio unless that sector
576 * is already covered by previously prepared bios */
577static int atodb_prepare_unless_covered(struct drbd_conf *mdev,
578 struct bio **bios,
579 unsigned int enr,
580 struct drbd_atodb_wait *wc) __must_hold(local)
581{
582 struct bio *bio;
583 struct page *page;
584 sector_t on_disk_sector;
585 unsigned int page_offset = PAGE_SIZE;
586 int offset;
587 int i = 0;
588 int err = -ENOMEM;
589
590 /* We always write aligned, full 4k blocks,
591 * so we can ignore the logical_block_size (for now) */
592 enr &= ~7U;
593 on_disk_sector = enr + mdev->ldev->md.md_offset
594 + mdev->ldev->md.bm_offset;
595
596 D_ASSERT(!(on_disk_sector & 7U));
597
598 /* Check if that enr is already covered by an already created bio.
599 * Caution, bios[] is not NULL terminated,
600 * but only initialized to all NULL.
601 * For completely scattered activity log,
602 * the last invocation iterates over all bios,
603 * and finds the last NULL entry.
604 */
605 while ((bio = bios[i])) {
606 if (bio->bi_sector == on_disk_sector)
607 return 0;
608 i++;
609 }
610 /* bios[i] == NULL, the next not yet used slot */
611
612 /* GFP_KERNEL, we are not in the write-out path */
613 bio = bio_alloc(GFP_KERNEL, 1);
614 if (bio == NULL)
615 return -ENOMEM;
616
617 if (i > 0) {
618 const struct bio_vec *prev_bv = bios[i-1]->bi_io_vec;
619 page_offset = prev_bv->bv_offset + prev_bv->bv_len;
620 page = prev_bv->bv_page;
621 }
622 if (page_offset == PAGE_SIZE) {
623 page = alloc_page(__GFP_HIGHMEM);
624 if (page == NULL)
625 goto out_bio_put;
626 page_offset = 0;
627 } else {
628 get_page(page);
629 }
630
631 offset = S2W(enr);
632 drbd_bm_get_lel(mdev, offset,
633 min_t(size_t, S2W(8), drbd_bm_words(mdev) - offset),
634 kmap(page) + page_offset);
635 kunmap(page);
636
637 bio->bi_private = wc;
638 bio->bi_end_io = atodb_endio;
639 bio->bi_bdev = mdev->ldev->md_bdev;
640 bio->bi_sector = on_disk_sector;
641
642 if (bio_add_page(bio, page, 4096, page_offset) != 4096)
643 goto out_put_page;
644
645 atomic_inc(&wc->count);
646 /* we already know that we may do this...
647 * get_ldev_if_state(mdev,D_ATTACHING);
648 * just get the extra reference, so that the local_cnt reflects
649 * the number of pending IO requests DRBD at its backing device.
650 */
651 atomic_inc(&mdev->local_cnt);
652
653 bios[i] = bio;
654
655 return 0;
656
657out_put_page:
658 err = -EINVAL;
659 put_page(page);
660out_bio_put:
661 bio_put(bio);
662 return err;
663}
664
665/** 572/**
666 * drbd_al_apply_to_bm() - Sets the bitmap to diry(1) where covered ba active AL extents 573 * drbd_al_apply_to_bm() - Sets the bitmap to diry(1) where covered ba active AL extents
667 * @mdev: DRBD device. 574 * @mdev: DRBD device.