summaryrefslogtreecommitdiffstats
path: root/drivers/block/drbd/drbd_receiver.c
diff options
context:
space:
mode:
authorAndreas Gruenbacher <agruen@linbit.com>2011-07-28 15:56:02 +0200
committerPhilipp Reisner <philipp.reisner@linbit.com>2014-02-17 16:50:40 +0100
commitb5043c5e2ca0de11a22e02cd8835c9489f833722 (patch)
tree337175f55d4e53b9d11f1b521234934d035ffbb9 /drivers/block/drbd/drbd_receiver.c
parent84b8c06b6591e73250e6ab4834a02a86c8994b91 (diff)
downloadtalos-obmc-linux-b5043c5e2ca0de11a22e02cd8835c9489f833722.tar.gz
talos-obmc-linux-b5043c5e2ca0de11a22e02cd8835c9489f833722.zip
drbd: Turn conn_flush_workqueue() into drbd_flush_workqueue()
The new function can flush any work queue, not just the work queue of the data socket of a connection. Signed-off-by: Andreas Gruenbacher <agruen@linbit.com> Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Diffstat (limited to 'drivers/block/drbd/drbd_receiver.c')
-rw-r--r--drivers/block/drbd/drbd_receiver.c22
1 files changed, 2 insertions, 20 deletions
diff --git a/drivers/block/drbd/drbd_receiver.c b/drivers/block/drbd/drbd_receiver.c
index 87114361d804..1d9a99c031fa 100644
--- a/drivers/block/drbd/drbd_receiver.c
+++ b/drivers/block/drbd/drbd_receiver.c
@@ -4485,24 +4485,6 @@ static void drbdd(struct drbd_connection *connection)
conn_request_state(connection, NS(conn, C_PROTOCOL_ERROR), CS_HARD);
}
-static int w_complete(struct drbd_work *w, int cancel)
-{
- struct drbd_wq_barrier *b = container_of(w, struct drbd_wq_barrier, w);
-
- complete(&b->done);
- return 0;
-}
-
-void conn_flush_workqueue(struct drbd_connection *connection)
-{
- struct drbd_wq_barrier barr;
-
- barr.w.cb = w_complete;
- init_completion(&barr.done);
- drbd_queue_work(&connection->sender_work, &barr.w);
- wait_for_completion(&barr.done);
-}
-
static void conn_disconnect(struct drbd_connection *connection)
{
struct drbd_peer_device *peer_device;
@@ -4590,14 +4572,14 @@ static int drbd_disconnected(struct drbd_peer_device *peer_device)
/* wait for all w_e_end_data_req, w_e_end_rsdata_req, w_send_barrier,
* w_make_resync_request etc. which may still be on the worker queue
* to be "canceled" */
- drbd_flush_workqueue(device);
+ drbd_flush_workqueue(&peer_device->connection->sender_work);
drbd_finish_peer_reqs(device);
/* This second workqueue flush is necessary, since drbd_finish_peer_reqs()
might have issued a work again. The one before drbd_finish_peer_reqs() is
necessary to reclain net_ee in drbd_finish_peer_reqs(). */
- drbd_flush_workqueue(device);
+ drbd_flush_workqueue(&peer_device->connection->sender_work);
/* need to do it again, drbd_finish_peer_reqs() may have populated it
* again via drbd_try_clear_on_disk_bm(). */
OpenPOWER on IntegriCloud