diff options
Diffstat (limited to 'src/kernel/xloop_file_fmt_raw.c')
-rw-r--r-- | src/kernel/xloop_file_fmt_raw.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/kernel/xloop_file_fmt_raw.c b/src/kernel/xloop_file_fmt_raw.c index 2fc8ace..8a53c11 100644 --- a/src/kernel/xloop_file_fmt_raw.c +++ b/src/kernel/xloop_file_fmt_raw.c @@ -152,6 +152,10 @@ static void __raw_file_fmt_rw_aio_complete(struct kiocb *iocb, long ret, long re { struct xloop_cmd *cmd = container_of(iocb, struct xloop_cmd, iocb); +#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 15, 0) + if (cmd->css) + css_put(cmd->css); +#endif cmd->ret = ret; __raw_file_fmt_rw_aio_do_completion(cmd); } @@ -222,6 +226,10 @@ 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 (cmd->css) + kthread_associate_blkcg(cmd->css); +#endif if (rw == WRITE) ret = call_write_iter(file, &cmd->iocb, &iter); @@ -229,6 +237,9 @@ 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) + kthread_associate_blkcg(NULL); +#endif if (ret != -EIOCBQUEUED) cmd->iocb.ki_complete(&cmd->iocb, ret, 0); |