Skip to content

Commit efa7d1c

Browse files
htejunaxboe
authored andcommitted
update !CONFIG_BLK_CGROUP dummies in include/linux/blk-cgroup.h
The header file will be used more widely with the pending cgroup writeback support and the current set of dummy declarations aren't enough to handle different config combinations. Update as follows. * Drop the struct cgroup declaration. None of the dummy defs need it. * Define blkcg as an empty struct instead of just declaring it. * Wrap dummy function defs in CONFIG_BLOCK. Some functions use block data types and none of them are to be used w/o block enabled. Signed-off-by: Tejun Heo <tj@kernel.org> Signed-off-by: Jens Axboe <axboe@fb.com>
1 parent eea8f41 commit efa7d1c

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

include/linux/blk-cgroup.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -558,8 +558,8 @@ static inline void blkg_rwstat_merge(struct blkg_rwstat *to,
558558

559559
#else /* CONFIG_BLK_CGROUP */
560560

561-
struct cgroup;
562-
struct blkcg;
561+
struct blkcg {
562+
};
563563

564564
struct blkg_policy_data {
565565
};
@@ -570,6 +570,8 @@ struct blkcg_gq {
570570
struct blkcg_policy {
571571
};
572572

573+
#ifdef CONFIG_BLOCK
574+
573575
static inline struct blkcg_gq *blkg_lookup(struct blkcg *blkcg, void *key) { return NULL; }
574576
static inline int blkcg_init_queue(struct request_queue *q) { return 0; }
575577
static inline void blkcg_drain_queue(struct request_queue *q) { }
@@ -599,5 +601,6 @@ static inline struct request_list *blk_rq_rl(struct request *rq) { return &rq->q
599601
#define blk_queue_for_each_rl(rl, q) \
600602
for ((rl) = &(q)->root_rl; (rl); (rl) = NULL)
601603

604+
#endif /* CONFIG_BLOCK */
602605
#endif /* CONFIG_BLK_CGROUP */
603606
#endif /* _BLK_CGROUP_H */

0 commit comments

Comments
 (0)