Linux 5.18 compat: blkg_tryget is moved to private headers

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Riccardo Schirone <rschirone91@gmail.com>
Closes #13278
This commit is contained in:
Riccardo Schirone 2022-04-01 23:47:36 +02:00 committed by Brian Behlendorf
parent 9f7f704507
commit 10a9f5fc47
1 changed files with 5 additions and 2 deletions

View File

@ -467,8 +467,11 @@ vdev_submit_bio_impl(struct bio *bio)
* blkg_tryget() to use rcu_read_lock() instead of rcu_read_lock_sched(). * 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 * As a side effect the function was converted to GPL-only. Define our
* own version when needed which uses rcu_read_lock_sched(). * 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 static inline bool
vdev_blkg_tryget(struct blkcg_gq *blkg) vdev_blkg_tryget(struct blkcg_gq *blkg)
{ {
@ -493,7 +496,7 @@ vdev_blkg_tryget(struct blkcg_gq *blkg)
return (rc); return (rc);
} }
#elif defined(HAVE_BLKG_TRYGET) #else
#define vdev_blkg_tryget(bg) blkg_tryget(bg) #define vdev_blkg_tryget(bg) blkg_tryget(bg)
#endif #endif
#ifdef HAVE_BIO_SET_DEV_MACRO #ifdef HAVE_BIO_SET_DEV_MACRO