[PATCH 2/2] block: remove kblockd_mod_delayed_work_on

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Just open code the mod_delayed_work{,_on} calls.

Signed-off-by: Christoph Hellwig <hch@xxxxxx>
---
 block/blk-core.c       |  9 +--------
 block/blk-mq.c         | 15 ++++++++-------
 block/blk.h            |  1 +
 include/linux/blkdev.h |  1 -
 4 files changed, 10 insertions(+), 16 deletions(-)

diff --git a/block/blk-core.c b/block/blk-core.c
index 10619fd83c1bc..0978ec0a7dcc4 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -71,7 +71,7 @@ struct kmem_cache *blk_requestq_srcu_cachep;
 /*
  * Controlling structure to kblockd
  */
-static struct workqueue_struct *kblockd_workqueue;
+struct workqueue_struct *kblockd_workqueue;
 
 /**
  * blk_queue_flag_set - atomically set a queue flag
@@ -1153,13 +1153,6 @@ int kblockd_schedule_work(struct work_struct *work)
 }
 EXPORT_SYMBOL(kblockd_schedule_work);
 
-int kblockd_mod_delayed_work_on(int cpu, struct delayed_work *dwork,
-				unsigned long delay)
-{
-	return mod_delayed_work_on(cpu, kblockd_workqueue, dwork, delay);
-}
-EXPORT_SYMBOL(kblockd_mod_delayed_work_on);
-
 void blk_start_plug_nr_ios(struct blk_plug *plug, unsigned short nr_ios)
 {
 	struct task_struct *tsk = current;
diff --git a/block/blk-mq.c b/block/blk-mq.c
index 565a0e6897b8f..56d049a7fc67d 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -1336,15 +1336,15 @@ void blk_mq_add_to_requeue_list(struct request *rq, bool at_head,
 
 void blk_mq_kick_requeue_list(struct request_queue *q)
 {
-	kblockd_mod_delayed_work_on(WORK_CPU_UNBOUND, &q->requeue_work, 0);
+	mod_delayed_work(kblockd_workqueue, &q->requeue_work, 0);
 }
 EXPORT_SYMBOL(blk_mq_kick_requeue_list);
 
 void blk_mq_delay_kick_requeue_list(struct request_queue *q,
 				    unsigned long msecs)
 {
-	kblockd_mod_delayed_work_on(WORK_CPU_UNBOUND, &q->requeue_work,
-				    msecs_to_jiffies(msecs));
+	mod_delayed_work(kblockd_workqueue, &q->requeue_work,
+			 msecs_to_jiffies(msecs));
 }
 EXPORT_SYMBOL(blk_mq_delay_kick_requeue_list);
 
@@ -2035,8 +2035,9 @@ void blk_mq_delay_run_hw_queue(struct blk_mq_hw_ctx *hctx, unsigned long msecs)
 {
 	if (unlikely(blk_mq_hctx_stopped(hctx)))
 		return;
-	kblockd_mod_delayed_work_on(blk_mq_hctx_next_cpu(hctx), &hctx->run_work,
-				    msecs_to_jiffies(msecs));
+
+	mod_delayed_work_on(blk_mq_hctx_next_cpu(hctx), kblockd_workqueue,
+			    &hctx->run_work, msecs_to_jiffies(msecs));
 }
 EXPORT_SYMBOL(blk_mq_delay_run_hw_queue);
 
@@ -2079,8 +2080,8 @@ void blk_mq_run_hw_queue(struct blk_mq_hw_ctx *hctx, bool async)
 		put_cpu();
 	}
 
-	kblockd_mod_delayed_work_on(blk_mq_hctx_next_cpu(hctx), &hctx->run_work,
-				    0);
+	mod_delayed_work_on(blk_mq_hctx_next_cpu(hctx), kblockd_workqueue,
+			    &hctx->run_work, 0);
 }
 EXPORT_SYMBOL(blk_mq_run_hw_queue);
 
diff --git a/block/blk.h b/block/blk.h
index 8bd43b3ad33d5..25a5c9fd48114 100644
--- a/block/blk.h
+++ b/block/blk.h
@@ -12,6 +12,7 @@ struct elevator_type;
 /* Max future timer expiry for timeouts */
 #define BLK_MAX_TIMEOUT		(5 * HZ)
 
+extern struct workqueue_struct *kblockd_workqueue;
 extern struct dentry *blk_debugfs_root;
 
 struct blk_flush_queue {
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index bb5fb7282e6ee..43512c8ee0972 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -1167,7 +1167,6 @@ static inline unsigned int block_size(struct block_device *bdev)
 }
 
 int kblockd_schedule_work(struct work_struct *work);
-int kblockd_mod_delayed_work_on(int cpu, struct delayed_work *dwork, unsigned long delay);
 
 #define MODULE_ALIAS_BLOCKDEV(major,minor) \
 	MODULE_ALIAS("block-major-" __stringify(major) "-" __stringify(minor))
-- 
2.30.2




[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux