aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/drbd/drbd_worker.c
diff options
context:
space:
mode:
authorPhilipp Reisner <philipp.reisner@linbit.com>2011-02-11 13:43:55 -0500
committerPhilipp Reisner <philipp.reisner@linbit.com>2011-10-14 10:45:01 -0400
commitdad20554812e73a2bfbe45d1b161d5d3c249e597 (patch)
treecd2e1d689a8366f0f460c63f6c37fc4797ab1820 /drivers/block/drbd/drbd_worker.c
parentbbeb641c3e4982d6bba21188545a7fd44ab0a715 (diff)
drbd: Removed drbd_state_lock() and drbd_state_unlock()
The lock they constructed is only taken when the state_mutex was already taken. It is superficial. 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.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/block/drbd/drbd_worker.c b/drivers/block/drbd/drbd_worker.c
index eee017dd6d7d..e8448712b958 100644
--- a/drivers/block/drbd/drbd_worker.c
+++ b/drivers/block/drbd/drbd_worker.c
@@ -1536,21 +1536,21 @@ void drbd_start_resync(struct drbd_conf *mdev, enum drbd_conns side)
1536 } 1536 }
1537 1537
1538 if (current == mdev->tconn->worker.task) { 1538 if (current == mdev->tconn->worker.task) {
1539 /* The worker should not sleep waiting for drbd_state_lock(), 1539 /* The worker should not sleep waiting for state_mutex,
1540 that can take long */ 1540 that can take long */
1541 if (test_and_set_bit(CLUSTER_ST_CHANGE, &mdev->flags)) { 1541 if (!mutex_trylock(&mdev->state_mutex)) {
1542 set_bit(B_RS_H_DONE, &mdev->flags); 1542 set_bit(B_RS_H_DONE, &mdev->flags);
1543 mdev->start_resync_timer.expires = jiffies + HZ/5; 1543 mdev->start_resync_timer.expires = jiffies + HZ/5;
1544 add_timer(&mdev->start_resync_timer); 1544 add_timer(&mdev->start_resync_timer);
1545 return; 1545 return;
1546 } 1546 }
1547 } else { 1547 } else {
1548 drbd_state_lock(mdev); 1548 mutex_lock(&mdev->state_mutex);
1549 } 1549 }
1550 clear_bit(B_RS_H_DONE, &mdev->flags); 1550 clear_bit(B_RS_H_DONE, &mdev->flags);
1551 1551
1552 if (!get_ldev_if_state(mdev, D_NEGOTIATING)) { 1552 if (!get_ldev_if_state(mdev, D_NEGOTIATING)) {
1553 drbd_state_unlock(mdev); 1553 mutex_unlock(&mdev->state_mutex);
1554 return; 1554 return;
1555 } 1555 }
1556 1556
@@ -1639,7 +1639,7 @@ void drbd_start_resync(struct drbd_conf *mdev, enum drbd_conns side)
1639 drbd_md_sync(mdev); 1639 drbd_md_sync(mdev);
1640 } 1640 }
1641 put_ldev(mdev); 1641 put_ldev(mdev);
1642 drbd_state_unlock(mdev); 1642 mutex_unlock(&mdev->state_mutex);
1643} 1643}
1644 1644
1645static int _worker_dying(int vnr, void *p, void *data) 1645static int _worker_dying(int vnr, void *p, void *data)