Message ID | 20241216210244.2687662-6-bvanassche@acm.org (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | Minor improvements for the zoned block storage code | expand |
On Mon, Dec 16, 2024 at 01:02:43PM -0800, Bart Van Assche wrote: > Apply the convention that is followed elsewhere in the block layer: only > declare functions inline if these are in the hot path. This patch makes it > easier to debug the code in blk-zoned.c with trace_printk(). trace_printk() > only displays the function name correctly for functions that are not > inlined. The other convention is to mark them as inline if they are so tiny that force inlinining is guaranteed to generate smaller code. disk_need_zone_resources seems a pretty clear case of that, while for the blk_zone_wplug_bio_io_error the forced inlining is indeed a bit questionable. I'm still not sure what the sudden urge to change it is?
diff --git a/block/blk-zoned.c b/block/blk-zoned.c index 0f7666441fe1..046903fc6030 100644 --- a/block/blk-zoned.c +++ b/block/blk-zoned.c @@ -575,8 +575,8 @@ static struct blk_zone_wplug *disk_get_and_lock_zone_wplug(struct gendisk *disk, return zwplug; } -static inline void blk_zone_wplug_bio_io_error(struct blk_zone_wplug *zwplug, - struct bio *bio) +static void blk_zone_wplug_bio_io_error(struct blk_zone_wplug *zwplug, + struct bio *bio) { struct request_queue *q = zwplug->disk->queue; @@ -1389,7 +1389,7 @@ void disk_free_zone_resources(struct gendisk *disk) disk->nr_zones = 0; } -static inline bool disk_need_zone_resources(struct gendisk *disk) +static bool disk_need_zone_resources(struct gendisk *disk) { /* * All mq zoned devices need zone resources so that the block layer
Apply the convention that is followed elsewhere in the block layer: only declare functions inline if these are in the hot path. This patch makes it easier to debug the code in blk-zoned.c with trace_printk(). trace_printk() only displays the function name correctly for functions that are not inlined. Signed-off-by: Bart Van Assche <bvanassche@acm.org> --- block/blk-zoned.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)