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

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
This commit is contained in:
Philipp Reisner 2011-01-19 14:53:22 +01:00
Родитель a0638456c6
Коммит 191d3cc8d9
3 изменённых файлов: 7 добавлений и 7 удалений

Просмотреть файл

@ -1609,7 +1609,7 @@ extern void _drbd_wait_ee_list_empty(struct drbd_conf *mdev,
struct list_head *head);
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_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
* 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)
wait_event(mdev->state_wait, !test_and_set_bit(CONFIG_PENDING, &mdev->flags));
wait_event(mdev->state_wait, !test_bit(DEVICE_DYING, &mdev->flags));
drbd_thread_start(&mdev->tconn->worker);
drbd_flush_workqueue(mdev);
drbd_flush_workqueue(mdev->tconn);
}
/* 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
/* also wait for the last barrier ack. */
wait_event(mdev->misc_wait, !atomic_read(&mdev->ap_pending_cnt) || is_susp(mdev->state));
/* 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);
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,
}
}
drbd_flush_workqueue(mdev);
drbd_flush_workqueue(mdev->tconn);
spin_lock_irq(&mdev->tconn->req_lock);
if (mdev->tconn->net_conf != NULL) {
retcode = ERR_NET_CONFIGURED;

Просмотреть файл

@ -3747,13 +3747,13 @@ static void drbdd(struct drbd_conf *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;
barr.w.cb = w_prev_work_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);
}
@ -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,
* w_make_resync_request etc. which may still be on the worker queue
* 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
* miss some resync ee and pages.*/