Commit f9fcc2d3919b8eb575b3cee9274feefafb641bca
Committed by
Jens Axboe
1 parent
f95a04afa8
Exists in
smarc-l5.0.0_1.0.0-ga
and in
5 other branches
blkcg: collapse blkcg_policy_ops into blkcg_policy
There's no reason to keep blkcg_policy_ops separate. Collapse it into blkcg_policy. 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>
Showing 4 changed files with 24 additions and 28 deletions Side-by-side Diff
block/blk-cgroup.c
... | ... | @@ -78,8 +78,8 @@ |
78 | 78 | if (!pd) |
79 | 79 | continue; |
80 | 80 | |
81 | - if (pol && pol->ops.pd_exit_fn) | |
82 | - pol->ops.pd_exit_fn(blkg); | |
81 | + if (pol && pol->pd_exit_fn) | |
82 | + pol->pd_exit_fn(blkg); | |
83 | 83 | |
84 | 84 | kfree(pd); |
85 | 85 | } |
... | ... | @@ -132,7 +132,7 @@ |
132 | 132 | struct blkcg_policy *pol = blkcg_policy[i]; |
133 | 133 | |
134 | 134 | if (blkcg_policy_enabled(blkg->q, pol)) |
135 | - pol->ops.pd_init_fn(blkg); | |
135 | + pol->pd_init_fn(blkg); | |
136 | 136 | } |
137 | 137 | |
138 | 138 | return blkg; |
... | ... | @@ -305,8 +305,8 @@ |
305 | 305 | struct blkcg_policy *pol = blkcg_policy[i]; |
306 | 306 | |
307 | 307 | if (blkcg_policy_enabled(blkg->q, pol) && |
308 | - pol->ops.pd_reset_stats_fn) | |
309 | - pol->ops.pd_reset_stats_fn(blkg); | |
308 | + pol->pd_reset_stats_fn) | |
309 | + pol->pd_reset_stats_fn(blkg); | |
310 | 310 | } |
311 | 311 | } |
312 | 312 | |
... | ... | @@ -758,7 +758,7 @@ |
758 | 758 | |
759 | 759 | blkg->pd[pol->plid] = pd; |
760 | 760 | pd->blkg = blkg; |
761 | - pol->ops.pd_init_fn(blkg); | |
761 | + pol->pd_init_fn(blkg); | |
762 | 762 | |
763 | 763 | spin_unlock(&blkg->blkcg->lock); |
764 | 764 | } |
... | ... | @@ -804,8 +804,8 @@ |
804 | 804 | /* grab blkcg lock too while removing @pd from @blkg */ |
805 | 805 | spin_lock(&blkg->blkcg->lock); |
806 | 806 | |
807 | - if (pol->ops.pd_exit_fn) | |
808 | - pol->ops.pd_exit_fn(blkg); | |
807 | + if (pol->pd_exit_fn) | |
808 | + pol->pd_exit_fn(blkg); | |
809 | 809 | |
810 | 810 | kfree(blkg->pd[pol->plid]); |
811 | 811 | blkg->pd[pol->plid] = NULL; |
block/blk-cgroup.h
... | ... | @@ -99,19 +99,17 @@ |
99 | 99 | typedef void (blkcg_pol_exit_pd_fn)(struct blkcg_gq *blkg); |
100 | 100 | typedef void (blkcg_pol_reset_pd_stats_fn)(struct blkcg_gq *blkg); |
101 | 101 | |
102 | -struct blkcg_policy_ops { | |
103 | - blkcg_pol_init_pd_fn *pd_init_fn; | |
104 | - blkcg_pol_exit_pd_fn *pd_exit_fn; | |
105 | - blkcg_pol_reset_pd_stats_fn *pd_reset_stats_fn; | |
106 | -}; | |
107 | - | |
108 | 102 | struct blkcg_policy { |
109 | - struct blkcg_policy_ops ops; | |
110 | 103 | int plid; |
111 | 104 | /* policy specific private data size */ |
112 | 105 | size_t pd_size; |
113 | 106 | /* cgroup files for the policy */ |
114 | 107 | struct cftype *cftypes; |
108 | + | |
109 | + /* operations */ | |
110 | + blkcg_pol_init_pd_fn *pd_init_fn; | |
111 | + blkcg_pol_exit_pd_fn *pd_exit_fn; | |
112 | + blkcg_pol_reset_pd_stats_fn *pd_reset_stats_fn; | |
115 | 113 | }; |
116 | 114 | |
117 | 115 | extern struct blkcg blkcg_root; |
block/blk-throttle.c
... | ... | @@ -1100,13 +1100,12 @@ |
1100 | 1100 | } |
1101 | 1101 | |
1102 | 1102 | static struct blkcg_policy blkcg_policy_throtl = { |
1103 | - .ops = { | |
1104 | - .pd_init_fn = throtl_pd_init, | |
1105 | - .pd_exit_fn = throtl_pd_exit, | |
1106 | - .pd_reset_stats_fn = throtl_pd_reset_stats, | |
1107 | - }, | |
1108 | - .pd_size = sizeof(struct throtl_grp), | |
1109 | - .cftypes = throtl_files, | |
1103 | + .pd_size = sizeof(struct throtl_grp), | |
1104 | + .cftypes = throtl_files, | |
1105 | + | |
1106 | + .pd_init_fn = throtl_pd_init, | |
1107 | + .pd_exit_fn = throtl_pd_exit, | |
1108 | + .pd_reset_stats_fn = throtl_pd_reset_stats, | |
1110 | 1109 | }; |
1111 | 1110 | |
1112 | 1111 | bool blk_throtl_bio(struct request_queue *q, struct bio *bio) |
block/cfq-iosched.c
... | ... | @@ -4165,12 +4165,11 @@ |
4165 | 4165 | |
4166 | 4166 | #ifdef CONFIG_CFQ_GROUP_IOSCHED |
4167 | 4167 | static struct blkcg_policy blkcg_policy_cfq = { |
4168 | - .ops = { | |
4169 | - .pd_init_fn = cfq_pd_init, | |
4170 | - .pd_reset_stats_fn = cfq_pd_reset_stats, | |
4171 | - }, | |
4172 | - .pd_size = sizeof(struct cfq_group), | |
4173 | - .cftypes = cfq_blkcg_files, | |
4168 | + .pd_size = sizeof(struct cfq_group), | |
4169 | + .cftypes = cfq_blkcg_files, | |
4170 | + | |
4171 | + .pd_init_fn = cfq_pd_init, | |
4172 | + .pd_reset_stats_fn = cfq_pd_reset_stats, | |
4174 | 4173 | }; |
4175 | 4174 | #endif |
4176 | 4175 |