[RFC PATCHv2 1/4] block: expose blk_stat_{enable,disable}_accounting() to drivers

Hannes Reinecke hare at suse.de
Sun Oct 12 22:54:10 PDT 2025


On 10/9/25 12:05, Nilay Shroff wrote:
> The functions blk_stat_enable_accounting() and
> blk_stat_disable_accounting() are currently exported, but their
> prototypes are only defined in a private header. Move these prototypes
> into a common header so that block drivers can directly use these APIs.
> 
> Signed-off-by: Nilay Shroff <nilay at linux.ibm.com>
> ---
>   block/blk-stat.h       | 4 ----
>   include/linux/blk-mq.h | 4 ++++
>   2 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/block/blk-stat.h b/block/blk-stat.h
> index 9e05bf18d1be..f5d95dd8c0e9 100644
> --- a/block/blk-stat.h
> +++ b/block/blk-stat.h
> @@ -67,10 +67,6 @@ void blk_free_queue_stats(struct blk_queue_stats *);
>   
>   void blk_stat_add(struct request *rq, u64 now);
>   
> -/* record time/size info in request but not add a callback */
> -void blk_stat_enable_accounting(struct request_queue *q);
> -void blk_stat_disable_accounting(struct request_queue *q);
> -
>   /**
>    * blk_stat_alloc_callback() - Allocate a block statistics callback.
>    * @timer_fn: Timer callback function.
> diff --git a/include/linux/blk-mq.h b/include/linux/blk-mq.h
> index b25d12545f46..f647444643b8 100644
> --- a/include/linux/blk-mq.h
> +++ b/include/linux/blk-mq.h
> @@ -735,6 +735,10 @@ int blk_rq_poll(struct request *rq, struct io_comp_batch *iob,
>   
>   bool blk_mq_queue_inflight(struct request_queue *q);
>   
> +/* record time/size info in request but not add a callback */
> +void blk_stat_enable_accounting(struct request_queue *q);
> +void blk_stat_disable_accounting(struct request_queue *q);
> +
>   enum {
>   	/* return when out of requests */
>   	BLK_MQ_REQ_NOWAIT	= (__force blk_mq_req_flags_t)(1 << 0),

Reviewed-by: Hannes Reinecke <hare at suse.de>

Cheers,

Hannes
-- 
Dr. Hannes Reinecke                  Kernel Storage Architect
hare at suse.de                                +49 911 74053 688
SUSE Software Solutions GmbH, Frankenstr. 146, 90461 Nürnberg
HRB 36809 (AG Nürnberg), GF: I. Totev, A. McDonald, W. Knoblich



More information about the Linux-nvme mailing list