Commit 191d3cc8 authored by Philipp Reisner's avatar Philipp Reisner

drbd: Made drbd_flush_workqueue() to take a tconn instead of an mdev

Signed-off-by: default avatarPhilipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: default avatarLars Ellenberg <lars.ellenberg@linbit.com>
parent a0638456
...@@ -1609,7 +1609,7 @@ extern void _drbd_wait_ee_list_empty(struct drbd_conf *mdev, ...@@ -1609,7 +1609,7 @@ extern void _drbd_wait_ee_list_empty(struct drbd_conf *mdev,
struct list_head *head); struct list_head *head);
extern void drbd_set_recv_tcq(struct drbd_conf *mdev, int tcq_enabled); extern void drbd_set_recv_tcq(struct drbd_conf *mdev, int tcq_enabled);
extern void _drbd_clear_done_ee(struct drbd_conf *mdev, struct list_head *to_be_freed); extern void _drbd_clear_done_ee(struct drbd_conf *mdev, struct list_head *to_be_freed);
extern void drbd_flush_workqueue(struct drbd_conf *mdev); extern void drbd_flush_workqueue(struct drbd_tconn *tconn);
/* yes, there is kernel_setsockopt, but only since 2.6.18. we don't need to /* yes, there is kernel_setsockopt, but only since 2.6.18. we don't need to
* mess with get_fs/set_fs, we know we are KERNEL_DS always. */ * mess with get_fs/set_fs, we know we are KERNEL_DS always. */
......
...@@ -876,7 +876,7 @@ static void drbd_reconfig_start(struct drbd_conf *mdev) ...@@ -876,7 +876,7 @@ static void drbd_reconfig_start(struct drbd_conf *mdev)
wait_event(mdev->state_wait, !test_and_set_bit(CONFIG_PENDING, &mdev->flags)); wait_event(mdev->state_wait, !test_and_set_bit(CONFIG_PENDING, &mdev->flags));
wait_event(mdev->state_wait, !test_bit(DEVICE_DYING, &mdev->flags)); wait_event(mdev->state_wait, !test_bit(DEVICE_DYING, &mdev->flags));
drbd_thread_start(&mdev->tconn->worker); drbd_thread_start(&mdev->tconn->worker);
drbd_flush_workqueue(mdev); drbd_flush_workqueue(mdev->tconn);
} }
/* if still unconfigured, stops worker again. /* if still unconfigured, stops worker again.
...@@ -1076,7 +1076,7 @@ static int drbd_nl_disk_conf(struct drbd_conf *mdev, struct drbd_nl_cfg_req *nlp ...@@ -1076,7 +1076,7 @@ static int drbd_nl_disk_conf(struct drbd_conf *mdev, struct drbd_nl_cfg_req *nlp
/* also wait for the last barrier ack. */ /* also wait for the last barrier ack. */
wait_event(mdev->misc_wait, !atomic_read(&mdev->ap_pending_cnt) || is_susp(mdev->state)); wait_event(mdev->misc_wait, !atomic_read(&mdev->ap_pending_cnt) || is_susp(mdev->state));
/* and for any other previously queued work */ /* and for any other previously queued work */
drbd_flush_workqueue(mdev); drbd_flush_workqueue(mdev->tconn);
rv = _drbd_request_state(mdev, NS(disk, D_ATTACHING), CS_VERBOSE); rv = _drbd_request_state(mdev, NS(disk, D_ATTACHING), CS_VERBOSE);
retcode = rv; /* FIXME: Type mismatch. */ retcode = rv; /* FIXME: Type mismatch. */
...@@ -1520,7 +1520,7 @@ static int drbd_nl_net_conf(struct drbd_conf *mdev, struct drbd_nl_cfg_req *nlp, ...@@ -1520,7 +1520,7 @@ static int drbd_nl_net_conf(struct drbd_conf *mdev, struct drbd_nl_cfg_req *nlp,
} }
} }
drbd_flush_workqueue(mdev); drbd_flush_workqueue(mdev->tconn);
spin_lock_irq(&mdev->tconn->req_lock); spin_lock_irq(&mdev->tconn->req_lock);
if (mdev->tconn->net_conf != NULL) { if (mdev->tconn->net_conf != NULL) {
retcode = ERR_NET_CONFIGURED; retcode = ERR_NET_CONFIGURED;
......
...@@ -3747,13 +3747,13 @@ static void drbdd(struct drbd_conf *mdev) ...@@ -3747,13 +3747,13 @@ static void drbdd(struct drbd_conf *mdev)
drbd_md_sync(mdev); drbd_md_sync(mdev);
} }
void drbd_flush_workqueue(struct drbd_conf *mdev) void drbd_flush_workqueue(struct drbd_tconn *tconn)
{ {
struct drbd_wq_barrier barr; struct drbd_wq_barrier barr;
barr.w.cb = w_prev_work_done; barr.w.cb = w_prev_work_done;
init_completion(&barr.done); init_completion(&barr.done);
drbd_queue_work(&mdev->tconn->data.work, &barr.w); drbd_queue_work(&tconn->data.work, &barr.w);
wait_for_completion(&barr.done); wait_for_completion(&barr.done);
} }
...@@ -3803,7 +3803,7 @@ static void drbd_disconnect(struct drbd_conf *mdev) ...@@ -3803,7 +3803,7 @@ static void drbd_disconnect(struct drbd_conf *mdev)
/* wait for all w_e_end_data_req, w_e_end_rsdata_req, w_send_barrier, /* 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 * w_make_resync_request etc. which may still be on the worker queue
* to be "canceled" */ * to be "canceled" */
drbd_flush_workqueue(mdev); drbd_flush_workqueue(mdev->tconn);
/* This also does reclaim_net_ee(). If we do this too early, we might /* This also does reclaim_net_ee(). If we do this too early, we might
* miss some resync ee and pages.*/ * miss some resync ee and pages.*/
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment