mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 11:41:38 -04:00
blk-stat: convert blk-stat bucket callback to signed
In order to allow for filtering of IO based on some other properties of the request than direction we allow the bucket function to return an int. If the bucket callback returns a negative do no count it in the stats accumulation. Signed-off-by: Stephen Bates <[email protected]> Fixed up Kyber scheduler stat callback. Signed-off-by: Jens Axboe <[email protected]>
This commit is contained in:
parent
caf7df1227
commit
a37244e4cc
3 changed files with 10 additions and 7 deletions
|
|
@ -48,9 +48,10 @@ struct blk_stat_callback {
|
|||
|
||||
/**
|
||||
* @bucket_fn: Given a request, returns which statistics bucket it
|
||||
* should be accounted under.
|
||||
* should be accounted under. Return -1 for no bucket for this
|
||||
* request.
|
||||
*/
|
||||
unsigned int (*bucket_fn)(const struct request *);
|
||||
int (*bucket_fn)(const struct request *);
|
||||
|
||||
/**
|
||||
* @buckets: Number of statistics buckets.
|
||||
|
|
@ -120,7 +121,7 @@ void blk_stat_enable_accounting(struct request_queue *q);
|
|||
*
|
||||
* Return: Data direction of the request, either READ or WRITE.
|
||||
*/
|
||||
unsigned int blk_stat_rq_ddir(const struct request *rq);
|
||||
int blk_stat_rq_ddir(const struct request *rq);
|
||||
|
||||
/**
|
||||
* blk_stat_alloc_callback() - Allocate a block statistics callback.
|
||||
|
|
@ -135,7 +136,7 @@ unsigned int blk_stat_rq_ddir(const struct request *rq);
|
|||
*/
|
||||
struct blk_stat_callback *
|
||||
blk_stat_alloc_callback(void (*timer_fn)(struct blk_stat_callback *),
|
||||
unsigned int (*bucket_fn)(const struct request *),
|
||||
int (*bucket_fn)(const struct request *),
|
||||
unsigned int buckets, void *data);
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in a new issue