diff options
Diffstat (limited to 'drivers/block/drbd/drbd_main.c')
-rw-r--r-- | drivers/block/drbd/drbd_main.c | 36 |
1 files changed, 2 insertions, 34 deletions
diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c index 29cd0dc9fe4f..8a43ce0edeed 100644 --- a/drivers/block/drbd/drbd_main.c +++ b/drivers/block/drbd/drbd_main.c | |||
@@ -2477,12 +2477,11 @@ static u32 bio_flags_to_wire(struct drbd_conf *mdev, unsigned long bi_rw) | |||
2477 | { | 2477 | { |
2478 | if (mdev->agreed_pro_version >= 95) | 2478 | if (mdev->agreed_pro_version >= 95) |
2479 | return (bi_rw & REQ_SYNC ? DP_RW_SYNC : 0) | | 2479 | return (bi_rw & REQ_SYNC ? DP_RW_SYNC : 0) | |
2480 | (bi_rw & REQ_UNPLUG ? DP_UNPLUG : 0) | | ||
2481 | (bi_rw & REQ_FUA ? DP_FUA : 0) | | 2480 | (bi_rw & REQ_FUA ? DP_FUA : 0) | |
2482 | (bi_rw & REQ_FLUSH ? DP_FLUSH : 0) | | 2481 | (bi_rw & REQ_FLUSH ? DP_FLUSH : 0) | |
2483 | (bi_rw & REQ_DISCARD ? DP_DISCARD : 0); | 2482 | (bi_rw & REQ_DISCARD ? DP_DISCARD : 0); |
2484 | else | 2483 | else |
2485 | return bi_rw & (REQ_SYNC | REQ_UNPLUG) ? DP_RW_SYNC : 0; | 2484 | return bi_rw & REQ_SYNC ? DP_RW_SYNC : 0; |
2486 | } | 2485 | } |
2487 | 2486 | ||
2488 | /* Used to send write requests | 2487 | /* Used to send write requests |
@@ -2719,35 +2718,6 @@ static int drbd_release(struct gendisk *gd, fmode_t mode) | |||
2719 | return 0; | 2718 | return 0; |
2720 | } | 2719 | } |
2721 | 2720 | ||
2722 | static void drbd_unplug_fn(struct request_queue *q) | ||
2723 | { | ||
2724 | struct drbd_conf *mdev = q->queuedata; | ||
2725 | |||
2726 | /* unplug FIRST */ | ||
2727 | spin_lock_irq(q->queue_lock); | ||
2728 | blk_remove_plug(q); | ||
2729 | spin_unlock_irq(q->queue_lock); | ||
2730 | |||
2731 | /* only if connected */ | ||
2732 | spin_lock_irq(&mdev->req_lock); | ||
2733 | if (mdev->state.pdsk >= D_INCONSISTENT && mdev->state.conn >= C_CONNECTED) { | ||
2734 | D_ASSERT(mdev->state.role == R_PRIMARY); | ||
2735 | if (test_and_clear_bit(UNPLUG_REMOTE, &mdev->flags)) { | ||
2736 | /* add to the data.work queue, | ||
2737 | * unless already queued. | ||
2738 | * XXX this might be a good addition to drbd_queue_work | ||
2739 | * anyways, to detect "double queuing" ... */ | ||
2740 | if (list_empty(&mdev->unplug_work.list)) | ||
2741 | drbd_queue_work(&mdev->data.work, | ||
2742 | &mdev->unplug_work); | ||
2743 | } | ||
2744 | } | ||
2745 | spin_unlock_irq(&mdev->req_lock); | ||
2746 | |||
2747 | if (mdev->state.disk >= D_INCONSISTENT) | ||
2748 | drbd_kick_lo(mdev); | ||
2749 | } | ||
2750 | |||
2751 | static void drbd_set_defaults(struct drbd_conf *mdev) | 2721 | static void drbd_set_defaults(struct drbd_conf *mdev) |
2752 | { | 2722 | { |
2753 | /* This way we get a compile error when sync_conf grows, | 2723 | /* This way we get a compile error when sync_conf grows, |
@@ -3222,9 +3192,7 @@ struct drbd_conf *drbd_new_device(unsigned int minor) | |||
3222 | blk_queue_max_segment_size(q, DRBD_MAX_SEGMENT_SIZE); | 3192 | blk_queue_max_segment_size(q, DRBD_MAX_SEGMENT_SIZE); |
3223 | blk_queue_bounce_limit(q, BLK_BOUNCE_ANY); | 3193 | blk_queue_bounce_limit(q, BLK_BOUNCE_ANY); |
3224 | blk_queue_merge_bvec(q, drbd_merge_bvec); | 3194 | blk_queue_merge_bvec(q, drbd_merge_bvec); |
3225 | q->queue_lock = &mdev->req_lock; /* needed since we use */ | 3195 | q->queue_lock = &mdev->req_lock; |
3226 | /* plugging on a queue, that actually has no requests! */ | ||
3227 | q->unplug_fn = drbd_unplug_fn; | ||
3228 | 3196 | ||
3229 | mdev->md_io_page = alloc_page(GFP_KERNEL); | 3197 | mdev->md_io_page = alloc_page(GFP_KERNEL); |
3230 | if (!mdev->md_io_page) | 3198 | if (!mdev->md_io_page) |