We trigger this warning: block/blk-throttle.c: In function ‘blk_throtl_bio’: block/blk-throttle.c:2042:6: warning: variable ‘ret’ set but not used [-Wunused-but-set-variable] int ret; ^~~ since we only assign 'ret' if BLK_DEV_THROTTLING_LOW is off, we never check it.
Unified · Split
| @@ -2030,6 +2030,20 @@ static inline void throtl_update_latency_buckets(struct throtl_data *td) · 2029 unmodified lines | |||
| 2030 | } | 2030 | } |
| 2031 | #endif | 2031 | #endif |
| 2032 | 2032 | ||
| 2033 | static void blk_throtl_assoc_bio(struct throtl_grp *tg, struct bio *bio) | ||
| 2034 | { | ||
| 2035 | #ifdef CONFIG_BLK_DEV_THROTTLING_LOW | ||
| 2036 | int ret; | ||
| 2037 | |||
| 2038 | ret = bio_associate_current(bio); | ||
| 2039 | if (ret == 0 || ret == -EBUSY) | ||
| 2040 | bio->bi_cg_private = tg; | ||
| 2041 | blk_stat_set_issue(&bio->bi_issue_stat, bio_sectors(bio)); | ||
| 2042 | #else | ||
| 2043 | bio_associate_current(bio); | ||
| 2044 | #endif | ||
| 2045 | } | ||
| 2046 | |||
| 2033 | bool blk_throtl_bio(struct request_queue *q, struct blkcg_gq *blkg, | 2047 | bool blk_throtl_bio(struct request_queue *q, struct blkcg_gq *blkg, |
| 2034 | struct bio *bio) | 2048 | struct bio *bio) |
| 2035 | { | 2049 | { |
| @@ -2039,7 +2053,6 @@ bool blk_throtl_bio(struct request_queue *q, struct blkcg_gq *blkg, · 3 unmodified lines | |||
| 2039 | bool rw = bio_data_dir(bio); | 2053 | bool rw = bio_data_dir(bio); |
| 2040 | bool throttled = false; | 2054 | bool throttled = false; |
| 2041 | struct throtl_data *td = tg->td; | 2055 | struct throtl_data *td = tg->td; |
| 2042 | int ret; | ||
| 2043 | 2056 | ||
| 2044 | WARN_ON_ONCE(!rcu_read_lock_held()); | 2057 | WARN_ON_ONCE(!rcu_read_lock_held()); |
| 2045 | 2058 | ||
| @@ -2054,12 +2067,7 @@ bool blk_throtl_bio(struct request_queue *q, struct blkcg_gq *blkg, · 8 unmodified lines | |||
| 2054 | if (unlikely(blk_queue_bypass(q))) | 2067 | if (unlikely(blk_queue_bypass(q))) |
| 2055 | goto out_unlock; | 2068 | goto out_unlock; |
| 2056 | 2069 | ||
| 2057 | ret = bio_associate_current(bio); | 2070 | blk_throtl_assoc_bio(tg, bio); |
| 2058 | #ifdef CONFIG_BLK_DEV_THROTTLING_LOW | ||
| 2059 | if (ret == 0 || ret == -EBUSY) | ||
| 2060 | bio->bi_cg_private = tg; | ||
| 2061 | blk_stat_set_issue(&bio->bi_issue_stat, bio_sectors(bio)); | ||
| 2062 | #endif | ||
| 2063 | blk_throtl_update_idletime(tg); | 2071 | blk_throtl_update_idletime(tg); |
| 2064 | 2072 | ||
| 2065 | sq = &tg->service_queue; | 2073 | sq = &tg->service_queue; |