Skip to contentSkip to conversation

Need part_in_flight() to be non-static

DISCUSSION Coly Li 2 participants 3 messages May 8, 2020 Block layer

lore
Share & tools
lore

Coly Li

author
#0 lore raw

Hi Christoph,

I have a Memblaze Gen2 PCIe SSD card (quite old), whose driver source code references part_in_flight(), but recently I find the code does not compile because this function is static in 5.7-rc1 by following change,

commit 6005771c17db56b6a9acc12bd084134191560e18

Author: Christoph Hellwig <[email protected]>
Date:   Wed Mar 25 16:48:36 2020 +0100

block: mark part_in_flight and part_in_flight_rw static

The driver is open source, but not merged upstream and out of maintenance now. Memblaze lent them to me for years, I just update the kabi part to make it just work, and use them to test upstream md and bcache code time to time.

The code piece where part_in_flight() is referenced is,

#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 24) inline void part_round_stats_single(int cpu, struct hd_struct *part,unsigned long now)

{
        if (now == part->stamp)
                return;

        if (part_in_flight(part)) {
                __part_stat_add(cpu, part, time_in_queue,
                                part_in_flight(part) * (now - part->stamp));
                __part_stat_add(cpu, part, io_ticks, (now - part->stamp));
        }
        part->stamp = now;
}

Is is possible to convert part_in_flight() to be non-static back ? If it is not possible, is there any other routines I can use to make part_round_stats_single() working ?

Thanks.

Coly Li

#1 lore raw
Quoted 3 lines · Coly Li

Is is possible to convert part_in_flight() to be non-static back ? If it is not possible, is there any other routines I can use to make part_round_stats_single() working ?

No. Convert the driver to blk-mq and submit it upstream if you care enough.

author
#2 lore raw
Quoted 8 lines · Christoph Hellwig
Quoted 3 lines · Coly Li

Is is possible to convert part_in_flight() to be non-static back ? If it is not possible, is there any other routines I can use to make part_round_stats_single() working ?

No. Convert the driver to blk-mq and submit it upstream if you care enough.

I see... Thanks you for the hint.

Coly Li