Skip to content

Commit

Permalink
Linux 5.18 compat: blkg_tryget is moved to private headers
Browse files Browse the repository at this point in the history
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Riccardo Schirone <[email protected]>
Closes openzfs#13278
  • Loading branch information
ret2libc authored and nicman23 committed Aug 22, 2022
1 parent 106b2df commit 91be2a3
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions module/os/linux/zfs/vdev_disk.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand All @@ -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
Expand Down

0 comments on commit 91be2a3

Please sign in to comment.