diff options
author | Lars Ellenberg <lars.ellenberg@linbit.com> | 2010-05-14 11:10:48 -0400 |
---|---|---|
committer | Philipp Reisner <philipp.reisner@linbit.com> | 2010-05-17 20:01:23 -0400 |
commit | 45bb912bd5ea4d2b3a270a93cbdf767a0e2df6f5 (patch) | |
tree | d95d27ea8e945fcda3427c50a5bc062c804c6eff /drivers/block/drbd/drbd_main.c | |
parent | 708d740ed8242b84eefc63df144313a7308c7de5 (diff) |
drbd: Allow drbd_epoch_entries to use multiple bios.
This should allow for better performance if the lower level IO stack
of the peers differs in limits exposed either via the queue,
or via some merge_bvec_fn.
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
Diffstat (limited to 'drivers/block/drbd/drbd_main.c')
-rw-r--r-- | drivers/block/drbd/drbd_main.c | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c index 3aa0add1c230..d0fabace1452 100644 --- a/drivers/block/drbd/drbd_main.c +++ b/drivers/block/drbd/drbd_main.c | |||
@@ -2354,6 +2354,19 @@ static int _drbd_send_zc_bio(struct drbd_conf *mdev, struct bio *bio) | |||
2354 | return 1; | 2354 | return 1; |
2355 | } | 2355 | } |
2356 | 2356 | ||
2357 | static int _drbd_send_zc_ee(struct drbd_conf *mdev, struct drbd_epoch_entry *e) | ||
2358 | { | ||
2359 | struct page *page = e->pages; | ||
2360 | unsigned len = e->size; | ||
2361 | page_chain_for_each(page) { | ||
2362 | unsigned l = min_t(unsigned, len, PAGE_SIZE); | ||
2363 | if (!_drbd_send_page(mdev, page, 0, l)) | ||
2364 | return 0; | ||
2365 | len -= l; | ||
2366 | } | ||
2367 | return 1; | ||
2368 | } | ||
2369 | |||
2357 | static void consider_delay_probes(struct drbd_conf *mdev) | 2370 | static void consider_delay_probes(struct drbd_conf *mdev) |
2358 | { | 2371 | { |
2359 | if (mdev->state.conn != C_SYNC_SOURCE || mdev->agreed_pro_version < 93) | 2372 | if (mdev->state.conn != C_SYNC_SOURCE || mdev->agreed_pro_version < 93) |
@@ -2430,7 +2443,7 @@ int drbd_send_dblock(struct drbd_conf *mdev, struct drbd_request *req) | |||
2430 | drbd_send(mdev, mdev->data.socket, &p, sizeof(p), MSG_MORE)); | 2443 | drbd_send(mdev, mdev->data.socket, &p, sizeof(p), MSG_MORE)); |
2431 | if (ok && dgs) { | 2444 | if (ok && dgs) { |
2432 | dgb = mdev->int_dig_out; | 2445 | dgb = mdev->int_dig_out; |
2433 | drbd_csum(mdev, mdev->integrity_w_tfm, req->master_bio, dgb); | 2446 | drbd_csum_bio(mdev, mdev->integrity_w_tfm, req->master_bio, dgb); |
2434 | ok = drbd_send(mdev, mdev->data.socket, dgb, dgs, MSG_MORE); | 2447 | ok = drbd_send(mdev, mdev->data.socket, dgb, dgs, MSG_MORE); |
2435 | } | 2448 | } |
2436 | if (ok) { | 2449 | if (ok) { |
@@ -2483,11 +2496,11 @@ int drbd_send_block(struct drbd_conf *mdev, enum drbd_packets cmd, | |||
2483 | sizeof(p), MSG_MORE); | 2496 | sizeof(p), MSG_MORE); |
2484 | if (ok && dgs) { | 2497 | if (ok && dgs) { |
2485 | dgb = mdev->int_dig_out; | 2498 | dgb = mdev->int_dig_out; |
2486 | drbd_csum(mdev, mdev->integrity_w_tfm, e->private_bio, dgb); | 2499 | drbd_csum_ee(mdev, mdev->integrity_w_tfm, e, dgb); |
2487 | ok = drbd_send(mdev, mdev->data.socket, dgb, dgs, MSG_MORE); | 2500 | ok = drbd_send(mdev, mdev->data.socket, dgb, dgs, MSG_MORE); |
2488 | } | 2501 | } |
2489 | if (ok) | 2502 | if (ok) |
2490 | ok = _drbd_send_zc_bio(mdev, e->private_bio); | 2503 | ok = _drbd_send_zc_ee(mdev, e); |
2491 | 2504 | ||
2492 | drbd_put_data_sock(mdev); | 2505 | drbd_put_data_sock(mdev); |
2493 | 2506 | ||