#include <linux/fs_struct.h>
#include <linux/namei.h>
#include <linux/pagemap.h>
+#include <linux/posix_acl_xattr.h>
#include <linux/bio.h>
#include <linux/xattr.h>
#include <linux/workqueue.h>
}
#endif
+#ifndef HAVE_FOP_ITERATE_SHARED
+#define iterate_shared iterate
+#endif
+
#ifdef HAVE_DIRTY_INODE_HAS_FLAG
# define ll_dirty_inode(inode, flag) (inode)->i_sb->s_op->dirty_inode((inode), flag)
#else
}
#endif /* HAVE_VFS_SETXATTR */
+#ifndef HAVE_POSIXACL_USER_NS
+/*
+ * Mask out &init_user_ns so we don't jump
+ * through hoops to define it somehow only
+ * to have it ignored anyway.
+ */
+#define posix_acl_from_xattr(a, b, c) posix_acl_from_xattr(b, c)
+#define posix_acl_to_xattr(a, b, c, d) posix_acl_to_xattr(b, c, d)
+#endif
+
+#ifndef HAVE_POSIX_ACL_VALID_USER_NS
+#define posix_acl_valid(a,b) posix_acl_valid(b)
+#endif
+
#ifdef HAVE_IOP_SET_ACL
-#ifdef CONFIG_FS_POSIX_ACL
+#ifdef CONFIG_LUSTRE_FS_POSIX_ACL
#ifndef HAVE_POSIX_ACL_UPDATE_MODE
static inline int posix_acl_update_mode(struct inode *inode, umode_t *mode_p,
struct posix_acl **acl)
#define page_tree i_pages
#else
#define i_pages tree_lock
-#define xa_lock_irq(lockp) spin_lock_irq(lockp)
-#define xa_unlock_irq(lockp) spin_unlock_irq(lockp)
+#endif
+
+#ifndef xa_lock_irqsave
+#define xa_lock_irqsave(lockp, flags) spin_lock_irqsave(lockp, flags)
+#define xa_unlock_irqrestore(lockp, flags) spin_unlock_irqrestore(lockp, flags)
+#endif
+
+#ifndef HAVE_LOCK_PAGE_MEMCG
+#define lock_page_memcg(page) do {} while (0)
+#define unlock_page_memcg(page) do {} while (0)
#endif
#ifndef KMEM_CACHE_USERCOPY