]> git.proxmox.com Git - mirror_zfs.git/commit
Linux 5.15 compat: block device readahead
authorBrian Behlendorf <behlendorf1@llnl.gov>
Wed, 8 Sep 2021 15:03:13 +0000 (08:03 -0700)
committerGitHub <noreply@github.com>
Wed, 8 Sep 2021 15:03:13 +0000 (09:03 -0600)
commitf6166058219707ca379064a4529ae4ce87e4e64f
treebe06fa53428582a2a6a6218e4331ec550e1f646e
parentab15b1fc0e713e3fe91cc5e1eaf414b377b8108e
Linux 5.15 compat: block device readahead

The 5.15 kernel moved the backing_dev_info structure out of
the request queue structure which causes a build failure.

Rather than look in the new location for the BDI we instead
detect this upstream refactoring by the existance of either
the blk_queue_update_readahead() or disk_update_readahead()
functions.  In either case, there's no longer any reason to
manually set the ra_pages value since it will be overridden
with a reasonable default (2x the block size) when
blk_queue_io_opt() is called.

Therefore, we update the compatibility wrapper to do nothing
for 5.9 and newer kernels.  While it's tempting to do the
same for older kernels we want to keep the compatibility
code to preserve the existing behavior.  Removing it would
effectively increase the default readahead to 128k.

Reviewed-by: Tony Nguyen <tony.nguyen@delphix.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #12532
config/kernel-blk-queue.m4
include/os/linux/kernel/linux/blkdev_compat.h