Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix compilation of XDMA for RHEL 9 #247

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 24 additions & 4 deletions XDMA/linux-kernel/xdma/cdev_sgdma.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,13 +104,23 @@ static void async_io_handler(unsigned long cb_hndl, int err)
if (caio->cmpl_cnt == caio->req_cnt) {
res = caio->res;
res2 = caio->res2;
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 16, 0)
#ifdef RHEL_RELEASE_VERSION
#if RHEL_RELEASE_VERSION(9, 0) < RHEL_RELEASE_CODE
caio->iocb->ki_complete(caio->iocb, caio->err_cnt ? res2 : res);
#elif LINUX_VERSION_CODE >= KERNEL_VERSION(4, 1, 0)
#elif RHEL_RELEASE_VERSION(8, 0) < RHEL_RELEASE_CODE
caio->iocb->ki_complete(caio->iocb, res, res2);
#else
aio_complete(caio->iocb, res, res2);
#endif
#else
#if KERNEL_VERSION(5, 16, 0) <= LINUX_VERSION_CODE
caio->iocb->ki_complete(caio->iocb, caio->err_cnt ? res2 : res);
#elif KERNEL_VERSION(4, 1, 0) <= LINUX_VERSION_CODE
caio->iocb->ki_complete(caio->iocb, res, res2);
#else
aio_complete(caio->iocb, res, res2);
#endif
#endif
skip_tran:
spin_unlock(&caio->lock);
kmem_cache_free(cdev_cache, caio);
Expand All @@ -121,12 +131,22 @@ static void async_io_handler(unsigned long cb_hndl, int err)
return;

skip_dev_lock:
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 16, 0)
#ifdef RHEL_RELEASE_VERSION
#if RHEL_RELEASE_VERSION(9, 0) < RHEL_RELEASE_CODE
caio->iocb->ki_complete(caio->iocb, -EBUSY);
#elif LINUX_VERSION_CODE >= KERNEL_VERSION(4, 1, 0)
#elif RHEL_RELEASE_VERSION(8, 0) < RHEL_RELEASE_CODE
caio->iocb->ki_complete(caio->iocb, numbytes, -EBUSY);
#else
aio_complete(caio->iocb, numbytes, -EBUSY);
#endif
#else
#if KERNEL_VERSION(5, 16, 0) <= LINUX_VERSION_CODE
caio->iocb->ki_complete(caio->iocb, -EBUSY);
#elif KERNEL_VERSION(4, 1, 0) <= LINUX_VERSION_CODE
caio->iocb->ki_complete(caio->iocb, numbytes, -EBUSY);
#else
aio_complete(caio->iocb, numbytes, -EBUSY);
#endif
#endif
kmem_cache_free(cdev_cache, caio);
}
Expand Down