blk-stat: kill blk_stat_rq_ddir()
Jens Axboe
maintainerPATCH 1/1 blk-stat: kill blk_stat_rq_ddir()
No point in providing and exporting this helper. There's just one (real) user of it, just use rq_data_dir().
block/blk-mq.c +1 -1
@@ -46,7 +46,7 @@ static int blk_mq_poll_stats_bkt(const struct request *rq) {int ddir, bytes, bucket; - ddir =blk_stat_rq_ddir (rq); + ddir =rq_data_dir (rq); bytes =blk_rq_bytes (rq); bucket = ddir +2 *(ilog2 (bytes) -9 );
block/blk-stat.c +0 -6
@@ -19,12 +19,6 @@ struct blk_queue_stats {bool enable_accounting; }; -int blk_stat_rq_ddir (const struct request *rq) -{ -return rq_data_dir (rq); -} -EXPORT_SYMBOL_GPL (blk_stat_rq_ddir); -static void blk_stat_init (struct blk_rq_stat *stat) { stat->min =-1ULL ;
block/blk-stat.h +0 -11
@@ -112,17 +112,6 @@ static inline void blk_stat_set_issue(struct blk_issue_stat *stat,/* record time/size info in request but not add a callback */ void blk_stat_enable_accounting (struct request_queue *q); -/* -* blk_stat_rq_ddir() - Bucket callback function for the request data direction. -* @rq: Request. -* -* This is the same as rq_data_dir() but as a function so it can be used as -* @bucket_fn for blk_stat_alloc_callback(). -* -* Return: Data direction of the request, either READ or WRITE. -*/ -int blk_stat_rq_ddir (const struct request *rq); -/** * blk_stat_alloc_callback() - Allocate a block statistics callback. * @timer_fn: Timer callback function.
block/blk-wbt.c +6 -1
@@ -696,6 +696,11 @@ u64 wbt_default_latency_nsec(struct request_queue *q)return 75000000ULL ; } +static int wbt_data_dir (const struct request *rq) +{ +return rq_data_dir (rq); +} +int wbt_init (struct request_queue *q) {struct rq_wb *rwb;
@@ -707,7 +712,7 @@ int wbt_init(struct request_queue *q)if (!rwb)return -ENOMEM ; - rwb->cb =blk_stat_alloc_callback (wb_timer_fn, blk_stat_rq_ddir,2 , rwb); + rwb->cb =blk_stat_alloc_callback (wb_timer_fn, wbt_data_dir,2 , rwb);if (!rwb->cb) {kfree (rwb);return -ENOMEM ;
block/blk-mq.c +1 -1
@@ -46,7 +46,7 @@ static int blk_mq_poll_stats_bkt(const struct request *rq) {int ddir, bytes, bucket; - ddir =blk_stat_rq_ddir (rq); + ddir =rq_data_dir (rq); bytes =blk_rq_bytes (rq); bucket = ddir +2 *(ilog2 (bytes) -9 );
block/blk-stat.c +0 -6
@@ -19,12 +19,6 @@ struct blk_queue_stats {bool enable_accounting; }; -int blk_stat_rq_ddir (const struct request *rq) -{ -return rq_data_dir (rq); -} -EXPORT_SYMBOL_GPL (blk_stat_rq_ddir); -static void blk_stat_init (struct blk_rq_stat *stat) { stat->min =-1ULL ;
block/blk-stat.h +0 -11
@@ -112,17 +112,6 @@ static inline void blk_stat_set_issue(struct blk_issue_stat *stat,/* record time/size info in request but not add a callback */ void blk_stat_enable_accounting (struct request_queue *q); -/* -* blk_stat_rq_ddir() - Bucket callback function for the request data direction. -* @rq: Request. -* -* This is the same as rq_data_dir() but as a function so it can be used as -* @bucket_fn for blk_stat_alloc_callback(). -* -* Return: Data direction of the request, either READ or WRITE. -*/ -int blk_stat_rq_ddir (const struct request *rq); -/** * blk_stat_alloc_callback() - Allocate a block statistics callback. * @timer_fn: Timer callback function.
block/blk-wbt.c +6 -1
@@ -696,6 +696,11 @@ u64 wbt_default_latency_nsec(struct request_queue *q)return 75000000ULL ; } +static int wbt_data_dir (const struct request *rq) +{ +return rq_data_dir (rq); +} +int wbt_init (struct request_queue *q) {struct rq_wb *rwb;
@@ -707,7 +712,7 @@ int wbt_init(struct request_queue *q)if (!rwb)return -ENOMEM ; - rwb->cb =blk_stat_alloc_callback (wb_timer_fn, blk_stat_rq_ddir,2 , rwb); + rwb->cb =blk_stat_alloc_callback (wb_timer_fn, wbt_data_dir,2 , rwb);if (!rwb->cb) {kfree (rwb);return -ENOMEM ;
Signature · 1 line
Jens Axboe
Jens Axboe
maintainerQuoted 2 lines · Jens Axboe
No point in providing and exporting this helper. There's just one (real) user of it, just use
rq_data_dir().
Not sure what happened there, it doubled up the patch. I probably fat fingered the :r in vim. We just need one of them...
block/blk-mq.c +1 -1
@@ -46,7 +46,7 @@ static int blk_mq_poll_stats_bkt(const struct request *rq) {int ddir, bytes, bucket; - ddir =blk_stat_rq_ddir (rq); + ddir =rq_data_dir (rq); bytes =blk_rq_bytes (rq); bucket = ddir +2 *(ilog2 (bytes) -9 );
block/blk-stat.c +0 -6
@@ -19,12 +19,6 @@ struct blk_queue_stats {bool enable_accounting; }; -int blk_stat_rq_ddir (const struct request *rq) -{ -return rq_data_dir (rq); -} -EXPORT_SYMBOL_GPL (blk_stat_rq_ddir); -static void blk_stat_init (struct blk_rq_stat *stat) { stat->min =-1ULL ;
block/blk-stat.h +0 -11
@@ -112,17 +112,6 @@ static inline void blk_stat_set_issue(struct blk_issue_stat *stat,/* record time/size info in request but not add a callback */ void blk_stat_enable_accounting (struct request_queue *q); -/* -* blk_stat_rq_ddir() - Bucket callback function for the request data direction. -* @rq: Request. -* -* This is the same as rq_data_dir() but as a function so it can be used as -* @bucket_fn for blk_stat_alloc_callback(). -* -* Return: Data direction of the request, either READ or WRITE. -*/ -int blk_stat_rq_ddir (const struct request *rq); -/** * blk_stat_alloc_callback() - Allocate a block statistics callback. * @timer_fn: Timer callback function.
block/blk-wbt.c +6 -1
@@ -696,6 +696,11 @@ u64 wbt_default_latency_nsec(struct request_queue *q)return 75000000ULL ; } +static int wbt_data_dir (const struct request *rq) +{ +return rq_data_dir (rq); +} +int wbt_init (struct request_queue *q) {struct rq_wb *rwb;
@@ -707,7 +712,7 @@ int wbt_init(struct request_queue *q)if (!rwb)return -ENOMEM ; - rwb->cb =blk_stat_alloc_callback (wb_timer_fn, blk_stat_rq_ddir,2 , rwb); + rwb->cb =blk_stat_alloc_callback (wb_timer_fn, wbt_data_dir,2 , rwb);if (!rwb->cb) {kfree (rwb);return -ENOMEM ;
Signature · 1 line
Jens Axboe
Christoph Hellwig
Reviewed-byLooks fine,
DQpPbiAwNC8yMC8yMDE3IDA3OjQ2IFBNLCBKZW5zIEF4Ym9lIHdyb3RlOg0KPiA+IE5vIHBvaW50 IGluIHByb3ZpZGluZyBhbmQgZXhwb3J0aW5nIHRoaXMgaGVscGVyLiBUaGVyZSdzIGp1c3QNCj4g PiBvbmUgKHJlYWwpIHVzZXIgb2YgaXQsIGp1c3QgdXNlIHJxX2RhdGFfZGlyKCkuDQoNCj4gTm90 IHN1cmUgd2hhdCBoYXBwZW5lZCB0aGVyZSwgaXQgZG91YmxlZCB1cCB0aGUgcGF0Y2guIEkgcHJv YmFibHkNCj4gZmF0IGZpbmdlcmVkIHRoZSA6ciBpbiB2aW0uIFdlIGp1c3QgbmVlZCBvbmUgb2Yg dGhlbS4uLg0KDQpMb29rcyBnb29kLg0KDQpSZXZpZXdlZC1CeTogU3RlcGhlbiBCYXRlcyA8c2Jh dGVzQHJhaXRobGluLmNvbT4NCg0KDQoNCg==