Commit 760701bfe14faee8ea0608a9cab2046071d98a39
Committed by
Jens Axboe
1 parent
b54ce60eb7
Exists in
master
and in
4 other branches
cfq-iosched: Get rid of on_st flag
It's able to check whether a CFQ group on a service tree by checking "cfqg->rb_node". There's no need to maintain an extra flag here. Signed-off-by: Gui Jianfeng <guijianfeng@cn.fujitsu.com> Acked-by: Vivek Goyal <vgoyal@redhat.com> Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
Showing 1 changed file with 1 additions and 4 deletions Side-by-side Diff
block/cfq-iosched.c
... | ... | @@ -179,7 +179,6 @@ |
179 | 179 | /* group service_tree key */ |
180 | 180 | u64 vdisktime; |
181 | 181 | unsigned int weight; |
182 | - bool on_st; | |
183 | 182 | |
184 | 183 | /* number of cfqq currently on this group */ |
185 | 184 | int nr_cfqq; |
... | ... | @@ -863,7 +862,7 @@ |
863 | 862 | struct rb_node *n; |
864 | 863 | |
865 | 864 | cfqg->nr_cfqq++; |
866 | - if (cfqg->on_st) | |
865 | + if (!RB_EMPTY_NODE(&cfqg->rb_node)) | |
867 | 866 | return; |
868 | 867 | |
869 | 868 | /* |
... | ... | @@ -879,7 +878,6 @@ |
879 | 878 | cfqg->vdisktime = st->min_vdisktime; |
880 | 879 | |
881 | 880 | __cfq_group_service_tree_add(st, cfqg); |
882 | - cfqg->on_st = true; | |
883 | 881 | st->total_weight += cfqg->weight; |
884 | 882 | } |
885 | 883 | |
... | ... | @@ -896,7 +894,6 @@ |
896 | 894 | return; |
897 | 895 | |
898 | 896 | cfq_log_cfqg(cfqd, cfqg, "del_from_rr group"); |
899 | - cfqg->on_st = false; | |
900 | 897 | st->total_weight -= cfqg->weight; |
901 | 898 | if (!RB_EMPTY_NODE(&cfqg->rb_node)) |
902 | 899 | cfq_rb_erase(&cfqg->rb_node, st); |