From b0e5d9834e89aa2c4843536c956373d94f5a50d5 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Tue, 6 Nov 2018 02:33:16 +0000 Subject: [PATCH 1/2] scst: Add an IOCB_DSYNC backport for kernel versions < v4.7 git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7798 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/include/backport.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scst/include/backport.h b/scst/include/backport.h index 2c715f7db..bd5cd22cc 100644 --- a/scst/include/backport.h +++ b/scst/include/backport.h @@ -349,6 +349,11 @@ static inline int vfs_fsync_backport(struct file *file, int datasync) #define vfs_fsync vfs_fsync_backport #endif +#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 7, 0) +/* See also commit dde0c2e79848 ("fs: add IOCB_SYNC and IOCB_DSYNC") */ +#define IOCB_DSYNC 0 +#endif + #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 16, 0) && \ LINUX_VERSION_CODE < KERNEL_VERSION(4, 11, 0) /* From c2f8864d90b2b4e48995fa5fb806ab3611a3f64c Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Tue, 6 Nov 2018 03:11:44 +0000 Subject: [PATCH 2/2] scst/include/backport.h: Fix the backport git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7799 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/include/backport.h | 33 ++++++++++++++++++++------------- 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/scst/include/backport.h b/scst/include/backport.h index bd5cd22cc..f4e9e6846 100644 --- a/scst/include/backport.h +++ b/scst/include/backport.h @@ -301,22 +301,29 @@ enum { /* */ #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 16, 0) -typedef unsigned int __bitwise __poll_t; +/* + * See also commit 65aaf87b3aa2 ("add EPOLLNVAL, annotate EPOLL... and + * event_poll->event"). + */ +typedef unsigned int __poll_t; +#define EPOLLNVAL POLLNVAL #endif #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 12, 0) -#define EPOLLIN (__force __poll_t)POLLIN -#define EPOLLPRI (__force __poll_t)POLLPRI -#define EPOLLOUT (__force __poll_t)POLLOUT -#define EPOLLERR (__force __poll_t)POLLERR -#define EPOLLHUP (__force __poll_t)POLLHUP -#define EPOLLNVAL (__force __poll_t)POLLNVAL -#define EPOLLRDNORM (__force __poll_t)POLLRDNORM -#define EPOLLRDBAND (__force __poll_t)POLLRDBAND -#define EPOLLWRNORM (__force __poll_t)POLLWRNORM -#define EPOLLWRBAND (__force __poll_t)POLLWRBAND -#define EPOLLMSG (__force __poll_t)POLLMSG -#define EPOLLRDHUP (__force __poll_t)POLLRDHUP +/* + * See also commit 7e040726850a ("eventpoll.h: add missing epoll event masks"). + */ +#define EPOLLIN POLLIN +#define EPOLLPRI POLLPRI +#define EPOLLOUT POLLOUT +#define EPOLLERR POLLERR +#define EPOLLHUP POLLHUP +#define EPOLLRDNORM POLLRDNORM +#define EPOLLRDBAND POLLRDBAND +#define EPOLLWRNORM POLLWRNORM +#define EPOLLWRBAND POLLWRBAND +#define EPOLLMSG POLLMSG +#define EPOLLRDHUP POLLRDHUP #endif /* */