Whamcloud - gitweb
LU-12355 llite: MS_* flags and SB_* flags split
[fs/lustre-release.git] / lustre / include / lustre_compat.h
index 03a1c3a..8fb9131 100644 (file)
@@ -42,6 +42,7 @@
 #include <linux/xattr.h>
 #include <linux/workqueue.h>
 #include <linux/blkdev.h>
+#include <linux/slab.h>
 
 #include <libcfs/linux/linux-fs.h>
 #include <lustre_patchless_compat.h>
@@ -570,11 +571,24 @@ static inline bool is_sxid(umode_t mode)
 #define IS_NOSEC(inode)        (!is_sxid(inode->i_mode))
 #endif
 
-#ifndef MS_NOSEC
-static inline void inode_has_no_xattr(struct inode *inode)
-{
-       return;
-}
+/*
+ * mount MS_* flags split from superblock SB_* flags
+ * if the SB_* flags are not available use the MS_* flags
+ */
+#if !defined(SB_RDONLY) && defined(MS_RDONLY)
+# define SB_RDONLY MS_RDONLY
+#endif
+#if !defined(SB_ACTIVE) && defined(MS_ACTIVE)
+# define SB_ACTIVE MS_ACTIVE
+#endif
+#if !defined(SB_NOSEC) && defined(MS_NOSEC)
+# define SB_NOSEC MS_NOSEC
+#endif
+#if !defined(SB_POSIXACL) && defined(MS_POSIXACL)
+# define SB_POSIXACL MS_POSIXACL
+#endif
+#if !defined(SB_NODIRATIME) && defined(MS_NODIRATIME)
+# define SB_NODIRATIME MS_NODIRATIME
 #endif
 
 #ifndef HAVE_FILE_OPERATIONS_READ_WRITE_ITER
@@ -826,4 +840,10 @@ static inline bool bdev_integrity_enabled(struct block_device *bdev, int rw)
 #define xa_unlock_irq(lockp) spin_unlock_irq(lockp)
 #endif
 
+#ifndef KMEM_CACHE_USERCOPY
+#define kmem_cache_create_usercopy(name, size, align, flags, useroffset, \
+                                  usersize, ctor)                       \
+       kmem_cache_create(name, size, align, flags, ctor)
+#endif
+
 #endif /* _LUSTRE_COMPAT_H */