"block_device" structure removed from "bio"

From: Sarabjeet Singh <hidden>
Date: 2018-08-09 06:02:55

Hi,

Greetings..!!

I'd like to report an issue which I've been facing in the new kernels (from
4.14 and newer).

Till kernel 4.13, we had the block_device structure as part of

struct *bio* <https://elixir.bootlin.com/linux/v4.4.146/ident/bio> {

       struct *bio*
<https://elixir.bootlin.com/linux/v4.4.146/ident/bio>
*bi_next;     */* request queue link */*

       *struct** block_device
<https://elixir.bootlin.com/linux/v4.4.146/ident/block_device>
*bi_bdev;*

       unsigned int         bi_flags;     */* status, command, etc */*

       int                  bi_error;

       unsigned long        bi_rw;        */* bottom bits READ/WRITE,*

*                                          * top bits priority*

*                                          */*

From kernel 4.14 onwards, this has been removed and I'm facing this error:
*Error: “struct bio” has no member named “bi_bdev”*


Code block (which gives this error):


*dev_t block_device = bio->bi_bdev->bd_dev*

As part of the driver code, I need to retrieve the *block_device* from
the *bio* structure.

As per my understanding there is no existing API to do the same. Can
you please let me know if there is any such API? If not, then can I
expect any fix for the same in the future?

-- 
Regards,
Sarabjeet Singh
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help