summaryrefslogtreecommitdiffstats
path: root/drivers/block/drbd/drbd_worker.c
diff options
context:
space:
mode:
authorAndreas Gruenbacher2010-12-15 19:31:20 +0100
committerPhilipp Reisner2011-08-29 11:26:57 +0200
commit841ce241fa355048f66172a47e356bb6e9159c9d (patch)
tree6634fa2f4248bad65de29ae47429e5ff1c095d00 /drivers/block/drbd/drbd_worker.c
parentdrbd: Convert all constants in enum drbd_thread_state to upper case (diff)
downloadkernel-qcow2-linux-841ce241fa355048f66172a47e356bb6e9159c9d.tar.gz
kernel-qcow2-linux-841ce241fa355048f66172a47e356bb6e9159c9d.tar.xz
kernel-qcow2-linux-841ce241fa355048f66172a47e356bb6e9159c9d.zip
drbd: Replace the ERR_IF macro with an assert-like macro
Remove the file name and line number from the syslog messages generated: we have no duplicate function names, and no function contains the same assertion more than once. 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.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/block/drbd/drbd_worker.c b/drivers/block/drbd/drbd_worker.c
index c2a9285afad6..2e2c0659a3eb 100644
--- a/drivers/block/drbd/drbd_worker.c
+++ b/drivers/block/drbd/drbd_worker.c
@@ -1331,7 +1331,8 @@ static int _drbd_may_sync_now(struct drbd_conf *mdev)
if (odev->sync_conf.after == -1)
return 1;
odev = minor_to_mdev(odev->sync_conf.after);
- ERR_IF(!odev) return 1;
+ if (!expect(odev))
+ return 1;
if ((odev->state.conn >= C_SYNC_SOURCE &&
odev->state.conn <= C_PAUSED_SYNC_T) ||
odev->state.aftr_isp || odev->state.peer_isp ||
@@ -1637,7 +1638,7 @@ int drbd_worker(struct drbd_thread *thi)
if (intr) {
D_ASSERT(intr == -EINTR);
flush_signals(current);
- ERR_IF (get_t_state(thi) == RUNNING)
+ if (!expect(get_t_state(thi) != RUNNING))
continue;
break;
}
@@ -1650,7 +1651,7 @@ int drbd_worker(struct drbd_thread *thi)
w = NULL;
spin_lock_irq(&mdev->data.work.q_lock);
- ERR_IF(list_empty(&mdev->data.work.q)) {
+ if (!expect(!list_empty(&mdev->data.work.q))) {
/* something terribly wrong in our logic.
* we were able to down() the semaphore,
* but the list is empty... doh.