Linux 4.17 created the new vm_fault_t type
Linux-commit:
1c8f422059ae5da07db7406ab916203f9417e396
Linux 5.1 changed the vm_fault_t type to bitwise unsigned int
which changes the interfaces registered to struct vm_operations_struct
Linux-commit:
3d3539018d2cbd12e5af4a132636ee7fd8d43ef0
Prefer to match the upstream API and fallback to 'int'
where vm_fault_t is not available.
Test-Parameters: trivial
Cray-bug-id: LUS-7600
Signed-off-by: Shaun Tancheff <stancheff@cray.com>
Change-Id: I7122fb0d4af3ee9a19c1a5d0b77c4f13f6850181
Reviewed-on: https://review.whamcloud.com/35500
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Petros Koutoupis <pkoutoupis@cray.com>
+# LC_VM_FAULT_T
+#
+# kernel 4.17 commit 3d3539018d2cbd12e5af4a132636ee7fd8d43ef0
+# mm: create the new vm_fault_t type
+#
+AC_DEFUN([LC_VM_FAULT_T], [
+LB_CHECK_COMPILE([if vm_fault_t type exists],
+vm_fault_t, [
+ #include <linux/mm_types.h>
+],[
+ vm_fault_t x = VM_FAULT_SIGBUS;
+ (void)x
+],[
+ AC_DEFINE(HAVE_VM_FAULT_T, 1,
+ [if vm_fault_t type exists])
+])
+]) # LC_VM_FAULT_T
+
+#
# LC_INODE_TIMESPEC64
#
# kernel 4.17-rc7 commit 8efd6894ff089adeeac7cb9f32125b85d963d1bc
# LC_INODE_TIMESPEC64
#
# kernel 4.17-rc7 commit 8efd6894ff089adeeac7cb9f32125b85d963d1bc
# define ll_umode_t int
#endif
# define ll_umode_t int
#endif
+#ifndef HAVE_VM_FAULT_T
+#define vm_fault_t int
+#endif
+
#include <linux/dcache.h>
#ifndef HAVE_D_MAKE_ROOT
static inline struct dentry *d_make_root(struct inode *root)
#include <linux/dcache.h>
#ifndef HAVE_D_MAKE_ROOT
static inline struct dentry *d_make_root(struct inode *root)
* \retval VM_FAULT_ERROR on general error
* \retval NOPAGE_OOM not have memory for allocate new page
*/
* \retval VM_FAULT_ERROR on general error
* \retval NOPAGE_OOM not have memory for allocate new page
*/
-static int ll_fault0(struct vm_area_struct *vma, struct vm_fault *vmf)
+static vm_fault_t ll_fault0(struct vm_area_struct *vma, struct vm_fault *vmf)
{
struct lu_env *env;
struct cl_io *io;
{
struct lu_env *env;
struct cl_io *io;
}
#ifdef HAVE_VM_OPS_USE_VM_FAULT_ONLY
}
#ifdef HAVE_VM_OPS_USE_VM_FAULT_ONLY
-static int ll_fault(struct vm_fault *vmf)
+static vm_fault_t ll_fault(struct vm_fault *vmf)
{
struct vm_area_struct *vma = vmf->vma;
#else
{
struct vm_area_struct *vma = vmf->vma;
#else
-static int ll_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
+static vm_fault_t ll_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
{
#endif
int count = 0;
bool printed = false;
bool cached;
{
#endif
int count = 0;
bool printed = false;
bool cached;
sigset_t set;
ll_stats_ops_tally(ll_i2sbi(file_inode(vma->vm_file)),
sigset_t set;
ll_stats_ops_tally(ll_i2sbi(file_inode(vma->vm_file)),
}
#ifdef HAVE_VM_OPS_USE_VM_FAULT_ONLY
}
#ifdef HAVE_VM_OPS_USE_VM_FAULT_ONLY
-static int ll_page_mkwrite(struct vm_fault *vmf)
+static vm_fault_t ll_page_mkwrite(struct vm_fault *vmf)
{
struct vm_area_struct *vma = vmf->vma;
#else
{
struct vm_area_struct *vma = vmf->vma;
#else
-static int ll_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf)
+static vm_fault_t ll_page_mkwrite(struct vm_area_struct *vma,
+ struct vm_fault *vmf)
{
#endif
int count = 0;
bool printed = false;
bool retry;
bool cached;
{
#endif
int count = 0;
bool printed = false;
bool retry;
bool cached;
ll_stats_ops_tally(ll_i2sbi(file_inode(vma->vm_file)),
LPROC_LL_MKWRITE, 1);
ll_stats_ops_tally(ll_i2sbi(file_inode(vma->vm_file)),
LPROC_LL_MKWRITE, 1);