Commit 64d01dc9 authored by Cheng Renquan's avatar Cheng Renquan Committed by Jens Axboe

block: use cancel_work_sync() instead of kblockd_flush_work()

After many improvements on kblockd_flush_work, it is now identical to
cancel_work_sync, so a direct call to cancel_work_sync is suggested.

The only difference is that cancel_work_sync is a GPL symbol,
so no non-GPL modules anymore.
Signed-off-by: default avatarCheng Renquan <crquan@gmail.com>
Cc: Jens Axboe <jens.axboe@oracle.com>
Signed-off-by: default avatarJens Axboe <jens.axboe@oracle.com>
parent 08bafc03
...@@ -1344,7 +1344,7 @@ static void as_exit_queue(elevator_t *e) ...@@ -1344,7 +1344,7 @@ static void as_exit_queue(elevator_t *e)
struct as_data *ad = e->elevator_data; struct as_data *ad = e->elevator_data;
del_timer_sync(&ad->antic_timer); del_timer_sync(&ad->antic_timer);
kblockd_flush_work(&ad->antic_work); cancel_work_sync(&ad->antic_work);
BUG_ON(!list_empty(&ad->fifo_list[REQ_SYNC])); BUG_ON(!list_empty(&ad->fifo_list[REQ_SYNC]));
BUG_ON(!list_empty(&ad->fifo_list[REQ_ASYNC])); BUG_ON(!list_empty(&ad->fifo_list[REQ_ASYNC]));
......
...@@ -408,7 +408,7 @@ void blk_sync_queue(struct request_queue *q) ...@@ -408,7 +408,7 @@ void blk_sync_queue(struct request_queue *q)
{ {
del_timer_sync(&q->unplug_timer); del_timer_sync(&q->unplug_timer);
del_timer_sync(&q->timeout); del_timer_sync(&q->timeout);
kblockd_flush_work(&q->unplug_work); cancel_work_sync(&q->unplug_work);
} }
EXPORT_SYMBOL(blk_sync_queue); EXPORT_SYMBOL(blk_sync_queue);
...@@ -2147,12 +2147,6 @@ int kblockd_schedule_work(struct request_queue *q, struct work_struct *work) ...@@ -2147,12 +2147,6 @@ int kblockd_schedule_work(struct request_queue *q, struct work_struct *work)
} }
EXPORT_SYMBOL(kblockd_schedule_work); EXPORT_SYMBOL(kblockd_schedule_work);
void kblockd_flush_work(struct work_struct *work)
{
cancel_work_sync(work);
}
EXPORT_SYMBOL(kblockd_flush_work);
int __init blk_dev_init(void) int __init blk_dev_init(void)
{ {
kblockd_workqueue = create_workqueue("kblockd"); kblockd_workqueue = create_workqueue("kblockd");
......
...@@ -2160,7 +2160,7 @@ static void cfq_idle_slice_timer(unsigned long data) ...@@ -2160,7 +2160,7 @@ static void cfq_idle_slice_timer(unsigned long data)
static void cfq_shutdown_timer_wq(struct cfq_data *cfqd) static void cfq_shutdown_timer_wq(struct cfq_data *cfqd)
{ {
del_timer_sync(&cfqd->idle_slice_timer); del_timer_sync(&cfqd->idle_slice_timer);
kblockd_flush_work(&cfqd->unplug_work); cancel_work_sync(&cfqd->unplug_work);
} }
static void cfq_put_async_queues(struct cfq_data *cfqd) static void cfq_put_async_queues(struct cfq_data *cfqd)
......
...@@ -978,7 +978,6 @@ static inline void put_dev_sector(Sector p) ...@@ -978,7 +978,6 @@ static inline void put_dev_sector(Sector p)
struct work_struct; struct work_struct;
int kblockd_schedule_work(struct request_queue *q, struct work_struct *work); int kblockd_schedule_work(struct request_queue *q, struct work_struct *work);
void kblockd_flush_work(struct work_struct *work);
#define MODULE_ALIAS_BLOCKDEV(major,minor) \ #define MODULE_ALIAS_BLOCKDEV(major,minor) \
MODULE_ALIAS("block-major-" __stringify(major) "-" __stringify(minor)) MODULE_ALIAS("block-major-" __stringify(major) "-" __stringify(minor))
......
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