Kernel device driver changes from RHEL 8 Beta

Posted on

Summary: Functions to process Block Device Request queues have either been removed or renamed in the RHEL 8.0 release.

Details:
I am in the process of testing a custom block device driver that I ported to RHEL 8.0. I did the initial port under RHEL 8.0 Beta and had the driver working and I am now attempting to do regression testing on the May 6, 2019 release of RHEL 8.0, but I can no longer compile the driver source code because the functions blk_init_queue, blk_run_queue, and blk_fetch_request seam to have been removed from the kernel. These functions were present in the RHEL 8.0 Beta release. What was the purpose of this and what are the alternate functions that were provided to replace the functionality that these routines provided?

How to I tell the block layer driver which routine to use for processing the block request queue within my driver?

Did RH remove the support for single queue block requests and only the multi-queue support is left?

Any device driver developers out there who know?

Background references:
https://linux-kernel-labs.github.io/master/labs/block_device_drivers.html
https://lwn.net/Articles/736534/
https://lwn.net/Articles/738449/
https://lwn.net/Articles/333620/
https://lwn.net/Articles/27055/

Under the RHEL 8.0 Beta
[root@storm-login1 include]# grep -r request_fn_proc *
linux/blkdev.h:typedef void (request_fn_proc) (struct request_queue *q);
linux/blkdev.h: request_fn_proc *request_fn;
linux/blkdev.h:extern struct request_queue *blk_init_queue_node(request_fn_proc *rfn,
linux/blkdev.h:extern struct request_queue *blk_init_queue(request_fn_proc *, spinlock_t *);
[root@storm-login1 include]# grep -r blk_run_queue *
linux/blkdev.h:extern void __blk_run_queue(struct request_queue *q);
linux/blkdev.h:extern void __blk_run_queue_uncond(struct request_queue *q);
linux/blkdev.h:extern void blk_run_queue(struct request_queue *);
linux/blkdev.h:extern void blk_run_queue_async(struct request_queue *q);
[root@storm-login1 include]# grep -r blk_fetch_request *
linux/blkdev.h:extern struct request *blk_fetch_request(struct request_queue *q);
[root@storm-login1 include]#

From <linux/blkdev.h>
/*
* Access functions for manipulating queue properties
*/
extern struct request_queue *blk_init_queue_node(request_fn_proc *rfn,
spinlock_t *lock, int node_id);
extern struct request_queue *blk_init_queue(request_fn_proc *, spinlock_t *);
extern int blk_init_allocated_queue(struct request_queue *);
extern void blk_cleanup_queue(struct request_queue *);
extern void blk_queue_make_request(struct request_queue *, make_request_fn *);
extern void blk_queue_bounce_limit(struct request_queue *, u64);
extern void blk_queue_max_hw_sectors(struct request_queue *, unsigned int);
extern void blk_queue_chunk_sectors(struct request_queue *, unsigned int);
extern void blk_queue_max_segments(struct request_queue *, unsigned short);
extern void blk_queue_max_discard_segments(struct request_queue *,
unsigned short);

Under RHEL 8.0 just released
[root@sand-login include]# grep -r blk_fetch_request *
[root@sand-login include]# grep -r blk_init_queue *
[root@sand-login include]# grep -r blk_run_queue *
From <linux/blkdev.h>
/*
* Access functions for manipulating queue properties
*/
extern void blk_cleanup_queue(struct request_queue *);
extern void blk_queue_make_request(struct request_queue *, make_request_fn *);
extern void blk_queue_bounce_limit(struct request_queue *, u64);
extern void blk_queue_max_hw_sectors(struct request_queue *, unsigned int);
extern void blk_queue_chunk_sectors(struct request_queue *, unsigned int);
extern void blk_queue_max_segments(struct request_queue *, unsigned short);
extern void blk_queue_max_discard_segments(struct request_queue *,
unsigned short);