aboutsummaryrefslogtreecommitdiffstats
path: root/module/os/linux/zfs
diff options
context:
space:
mode:
authorRiccardo Schirone <[email protected]>2022-04-01 23:47:36 +0200
committerBrian Behlendorf <[email protected]>2022-04-04 09:35:11 -0700
commit036e846abc84f823fa8cac806a469d964e703666 (patch)
treefc5be533f1fbb4abffcc282cea0bbac7d68809b0 /module/os/linux/zfs
parentb61507ec1d529bae45148ce3dd0c66bf9bc4d384 (diff)
Linux 5.18 compat: blkg_tryget is moved to private headers
Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Riccardo Schirone <[email protected]> Closes #13278
Diffstat (limited to 'module/os/linux/zfs')
-rw-r--r--module/os/linux/zfs/vdev_disk.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/module/os/linux/zfs/vdev_disk.c b/module/os/linux/zfs/vdev_disk.c
index 6cec5be44..235cd1691 100644
--- a/module/os/linux/zfs/vdev_disk.c
+++ b/module/os/linux/zfs/vdev_disk.c
@@ -467,8 +467,11 @@ vdev_submit_bio_impl(struct bio *bio)
* blkg_tryget() to use rcu_read_lock() instead of rcu_read_lock_sched().
* As a side effect the function was converted to GPL-only. Define our
* own version when needed which uses rcu_read_lock_sched().
+ *
+ * The Linux 5.17 kernel split linux/blk-cgroup.h into a private and a public
+ * part, moving blkg_tryget into the private one. Define our own version.
*/
-#if defined(HAVE_BLKG_TRYGET_GPL_ONLY)
+#if defined(HAVE_BLKG_TRYGET_GPL_ONLY) || !defined(HAVE_BLKG_TRYGET)
static inline bool
vdev_blkg_tryget(struct blkcg_gq *blkg)
{
@@ -493,7 +496,7 @@ vdev_blkg_tryget(struct blkcg_gq *blkg)
return (rc);
}
-#elif defined(HAVE_BLKG_TRYGET)
+#else
#define vdev_blkg_tryget(bg) blkg_tryget(bg)
#endif
#ifdef HAVE_BIO_SET_DEV_MACRO