summaryrefslogtreecommitdiffstats
path: root/src/kernel/xloop_file_fmt_raw.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/kernel/xloop_file_fmt_raw.c')
-rw-r--r--src/kernel/xloop_file_fmt_raw.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/kernel/xloop_file_fmt_raw.c b/src/kernel/xloop_file_fmt_raw.c
index 17c5274..06a91bd 100644
--- a/src/kernel/xloop_file_fmt_raw.c
+++ b/src/kernel/xloop_file_fmt_raw.c
@@ -156,10 +156,12 @@ static void __raw_file_fmt_rw_aio_complete(struct kiocb *iocb, long ret)
{
struct xloop_cmd *cmd = container_of(iocb, struct xloop_cmd, iocb);
-#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 15, 0)
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 15, 0) && ! RHEL_CHECK_VERSION(RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(9, 0))
if (cmd->css)
css_put(cmd->css);
#endif
+
cmd->ret = ret;
__raw_file_fmt_rw_aio_do_completion(cmd);
}
@@ -230,7 +232,7 @@ static int __raw_file_fmt_rw_aio(struct xloop_device *xlo, struct xloop_cmd *cmd
cmd->iocb.ki_complete = __raw_file_fmt_rw_aio_complete;
cmd->iocb.ki_flags = IOCB_DIRECT;
cmd->iocb.ki_ioprio = IOPRIO_PRIO_VALUE(IOPRIO_CLASS_NONE, 0);
-#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 15, 0)
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 15, 0) && ! RHEL_CHECK_VERSION(RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(9, 0))
if (cmd->css)
kthread_associate_blkcg(cmd->css);
#endif
@@ -241,7 +243,7 @@ static int __raw_file_fmt_rw_aio(struct xloop_device *xlo, struct xloop_cmd *cmd
ret = call_read_iter(file, &cmd->iocb, &iter);
__raw_file_fmt_rw_aio_do_completion(cmd);
-#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 15, 0)
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 15, 0) && ! RHEL_CHECK_VERSION(RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(9, 0))
kthread_associate_blkcg(NULL);
#endif
@@ -364,7 +366,7 @@ static int __raw_file_fmt_fallocate(struct xloop_device *xlo, struct request *rq
mode |= FALLOC_FL_KEEP_SIZE;
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 19, 0)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 19, 0) || RHEL_CHECK_VERSION(RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(9, 0))
if (!bdev_max_discard_sectors(xlo->xlo_device))
#else
if (!blk_queue_discard(xlo->xlo_queue))