aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/drbd/drbd_worker.c
diff options
context:
space:
mode:
authorLars Ellenberg <lars.ellenberg@linbit.com>2011-02-22 08:02:31 -0500
committerPhilipp Reisner <philipp.reisner@linbit.com>2011-10-14 10:47:47 -0400
commit9676c760979371701ea5a6f8adb7ce8125c22c7d (patch)
treea8a922530713ef1d06f8c8bfdd2ba15c9990f78e /drivers/block/drbd/drbd_worker.c
parentc9d963a46de87bdbc14565ed692ca3114ddbf11b (diff)
drbd: fix a wrong likely(), updated comments
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_worker.c')
-rw-r--r--drivers/block/drbd/drbd_worker.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/block/drbd/drbd_worker.c b/drivers/block/drbd/drbd_worker.c
index 01ab0bc0cd9e..8ee5c4f3d1c5 100644
--- a/drivers/block/drbd/drbd_worker.c
+++ b/drivers/block/drbd/drbd_worker.c
@@ -295,6 +295,7 @@ void drbd_csum_bio(struct drbd_conf *mdev, struct crypto_hash *tfm, struct bio *
295 crypto_hash_final(&desc, digest); 295 crypto_hash_final(&desc, digest);
296} 296}
297 297
298/* MAYBE merge common code with w_e_end_ov_req */
298static int w_e_send_csum(struct drbd_work *w, int cancel) 299static int w_e_send_csum(struct drbd_work *w, int cancel)
299{ 300{
300 struct drbd_peer_request *peer_req = container_of(w, struct drbd_peer_request, w); 301 struct drbd_peer_request *peer_req = container_of(w, struct drbd_peer_request, w);
@@ -306,7 +307,7 @@ static int w_e_send_csum(struct drbd_work *w, int cancel)
306 if (unlikely(cancel)) 307 if (unlikely(cancel))
307 goto out; 308 goto out;
308 309
309 if (likely((peer_req->flags & EE_WAS_ERROR) != 0)) 310 if (unlikely((peer_req->flags & EE_WAS_ERROR) != 0))
310 goto out; 311 goto out;
311 312
312 digest_size = crypto_hash_digestsize(mdev->csums_tfm); 313 digest_size = crypto_hash_digestsize(mdev->csums_tfm);
@@ -315,7 +316,7 @@ static int w_e_send_csum(struct drbd_work *w, int cancel)
315 sector_t sector = peer_req->i.sector; 316 sector_t sector = peer_req->i.sector;
316 unsigned int size = peer_req->i.size; 317 unsigned int size = peer_req->i.size;
317 drbd_csum_ee(mdev, mdev->csums_tfm, peer_req, digest); 318 drbd_csum_ee(mdev, mdev->csums_tfm, peer_req, digest);
318 /* Free e and pages before send. 319 /* Free peer_req and pages before send.
319 * In case we block on congestion, we could otherwise run into 320 * In case we block on congestion, we could otherwise run into
320 * some distributed deadlock, if the other side blocks on 321 * some distributed deadlock, if the other side blocks on
321 * congestion as well, because our receiver blocks in 322 * congestion as well, because our receiver blocks in
@@ -1151,11 +1152,11 @@ int w_e_end_ov_reply(struct drbd_work *w, int cancel)
1151 } 1152 }
1152 } 1153 }
1153 1154
1154 /* Free e and pages before send. 1155 /* Free peer_req and pages before send.
1155 * In case we block on congestion, we could otherwise run into 1156 * In case we block on congestion, we could otherwise run into
1156 * some distributed deadlock, if the other side blocks on 1157 * some distributed deadlock, if the other side blocks on
1157 * congestion as well, because our receiver blocks in 1158 * congestion as well, because our receiver blocks in
1158 * drbd_pp_alloc due to pp_in_use > max_buffers. */ 1159 * drbd_pp_alloc due to pp_in_use > max_buffers. */
1159 drbd_free_ee(mdev, peer_req); 1160 drbd_free_ee(mdev, peer_req);
1160 if (!eq) 1161 if (!eq)
1161 drbd_ov_oos_found(mdev, sector, size); 1162 drbd_ov_oos_found(mdev, sector, size);