diff options
author | Bart Van Assche <bvanassche@acm.org> | 2018-09-26 17:01:03 -0400 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2018-09-26 17:11:28 -0400 |
commit | bca6b067b0b269a7b8ba129e2a918309ca8b4a55 (patch) | |
tree | 8c41db994ddaf2023d881189cd947fce24f3b7d3 /include/linux/blkdev.h | |
parent | 3cfa210bf3fe0803cca17f3775d8cf2360d5f443 (diff) |
block: Move power management code into a new source file
Move the code for runtime power management from blk-core.c into the
new source file blk-pm.c. Move the corresponding declarations from
<linux/blkdev.h> into <linux/blk-pm.h>. For CONFIG_PM=n, leave out
the declarations of the functions that are not used in that mode.
This patch not only reduces the number of #ifdefs in the block layer
core code but also reduces the size of header file <linux/blkdev.h>
and hence should help to reduce the build time of the Linux kernel
if CONFIG_PM is not defined.
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Reviewed-by: Ming Lei <ming.lei@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Cc: Jianchao Wang <jianchao.w.wang@oracle.com>
Cc: Hannes Reinecke <hare@suse.com>
Cc: Johannes Thumshirn <jthumshirn@suse.de>
Cc: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'include/linux/blkdev.h')
-rw-r--r-- | include/linux/blkdev.h | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 1d5e14139795..cd863511dedb 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h | |||
@@ -1281,29 +1281,6 @@ extern void blk_put_queue(struct request_queue *); | |||
1281 | extern void blk_set_queue_dying(struct request_queue *); | 1281 | extern void blk_set_queue_dying(struct request_queue *); |
1282 | 1282 | ||
1283 | /* | 1283 | /* |
1284 | * block layer runtime pm functions | ||
1285 | */ | ||
1286 | #ifdef CONFIG_PM | ||
1287 | extern void blk_pm_runtime_init(struct request_queue *q, struct device *dev); | ||
1288 | extern int blk_pre_runtime_suspend(struct request_queue *q); | ||
1289 | extern void blk_post_runtime_suspend(struct request_queue *q, int err); | ||
1290 | extern void blk_pre_runtime_resume(struct request_queue *q); | ||
1291 | extern void blk_post_runtime_resume(struct request_queue *q, int err); | ||
1292 | extern void blk_set_runtime_active(struct request_queue *q); | ||
1293 | #else | ||
1294 | static inline void blk_pm_runtime_init(struct request_queue *q, | ||
1295 | struct device *dev) {} | ||
1296 | static inline int blk_pre_runtime_suspend(struct request_queue *q) | ||
1297 | { | ||
1298 | return -ENOSYS; | ||
1299 | } | ||
1300 | static inline void blk_post_runtime_suspend(struct request_queue *q, int err) {} | ||
1301 | static inline void blk_pre_runtime_resume(struct request_queue *q) {} | ||
1302 | static inline void blk_post_runtime_resume(struct request_queue *q, int err) {} | ||
1303 | static inline void blk_set_runtime_active(struct request_queue *q) {} | ||
1304 | #endif | ||
1305 | |||
1306 | /* | ||
1307 | * blk_plug permits building a queue of related requests by holding the I/O | 1284 | * blk_plug permits building a queue of related requests by holding the I/O |
1308 | * fragments for a short period. This allows merging of sequential requests | 1285 | * fragments for a short period. This allows merging of sequential requests |
1309 | * into single larger request. As the requests are moved from a per-task list to | 1286 | * into single larger request. As the requests are moved from a per-task list to |