Skip to content

Commit bc9fcbf

Browse files
htejunaxboe
authored andcommitted
block: move blk_throtl prototypes to block/blk.h
blk_throtl interface is block internal and there's no reason to have them in linux/blkdev.h. Move them to block/blk.h. This patch doesn't introduce any functional change. Signed-off-by: Tejun Heo <tj@kernel.org> Cc: Vivek Goyal <vgoyal@redhat.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent ece8424 commit bc9fcbf

3 files changed

Lines changed: 15 additions & 15 deletions

File tree

‎block/blk-throttle.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#include <linux/bio.h>
1111
#include <linux/blktrace_api.h>
1212
#include "blk-cgroup.h"
13+
#include "blk.h"
1314

1415
/* Max dispatch from a group in 1 round */
1516
static int throtl_grp_quantum = 8;

‎block/blk.h‎

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,4 +188,17 @@ static inline int blk_do_io_stat(struct request *rq)
188188
(rq->cmd_flags & REQ_DISCARD));
189189
}
190190

191-
#endif
191+
#ifdef CONFIG_BLK_DEV_THROTTLING
192+
extern int blk_throtl_bio(struct request_queue *q, struct bio **bio);
193+
extern int blk_throtl_init(struct request_queue *q);
194+
extern void blk_throtl_exit(struct request_queue *q);
195+
#else /* CONFIG_BLK_DEV_THROTTLING */
196+
static inline int blk_throtl_bio(struct request_queue *q, struct bio **bio)
197+
{
198+
return 0;
199+
}
200+
static inline int blk_throtl_init(struct request_queue *q) { return 0; }
201+
static inline void blk_throtl_exit(struct request_queue *q) { }
202+
#endif /* CONFIG_BLK_DEV_THROTTLING */
203+
204+
#endif /* BLK_INTERNAL_H */

‎include/linux/blkdev.h‎

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1197,20 +1197,6 @@ static inline uint64_t rq_io_start_time_ns(struct request *req)
11971197
}
11981198
#endif
11991199

1200-
#ifdef CONFIG_BLK_DEV_THROTTLING
1201-
extern int blk_throtl_init(struct request_queue *q);
1202-
extern void blk_throtl_exit(struct request_queue *q);
1203-
extern int blk_throtl_bio(struct request_queue *q, struct bio **bio);
1204-
#else /* CONFIG_BLK_DEV_THROTTLING */
1205-
static inline int blk_throtl_bio(struct request_queue *q, struct bio **bio)
1206-
{
1207-
return 0;
1208-
}
1209-
1210-
static inline int blk_throtl_init(struct request_queue *q) { return 0; }
1211-
static inline int blk_throtl_exit(struct request_queue *q) { return 0; }
1212-
#endif /* CONFIG_BLK_DEV_THROTTLING */
1213-
12141200
#define MODULE_ALIAS_BLOCKDEV(major,minor) \
12151201
MODULE_ALIAS("block-major-" __stringify(major) "-" __stringify(minor))
12161202
#define MODULE_ALIAS_BLOCKDEV_MAJOR(major) \

0 commit comments

Comments
 (0)