Whamcloud - gitweb
LU-13163 mdc: new kernel function xa_is_value()
[fs/lustre-release.git] / lustre / include / lustre_compat.h
index ad73cb7..3ebef7a 100644 (file)
@@ -243,6 +243,10 @@ static inline struct dentry *d_make_root(struct inode *root)
 }
 #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
@@ -326,6 +330,13 @@ static inline int radix_tree_exceptional_entry(void *arg)
 }
 #endif
 
+#ifndef HAVE_XA_IS_VALUE
+static inline bool xa_is_value(void *entry)
+{
+       return radix_tree_exceptional_entry(entry);
+}
+#endif
+
 #ifndef HAVE_TRUNCATE_INODE_PAGES_FINAL
 static inline void truncate_inode_pages_final(struct address_space *map)
 {
@@ -373,9 +384,11 @@ static inline int __must_check PTR_ERR_OR_ZERO(__force const void *ptr)
 #endif
 
 #ifdef HAVE_PID_NS_FOR_CHILDREN
-# define ll_task_pid_ns(task)  ((task)->nsproxy->pid_ns_for_children)
+# define ll_task_pid_ns(task) \
+        ((task)->nsproxy ? ((task)->nsproxy->pid_ns_for_children) : NULL)
 #else
-# define ll_task_pid_ns(task)  ((task)->nsproxy->pid_ns)
+# define ll_task_pid_ns(task) \
+        ((task)->nsproxy ? ((task)->nsproxy->pid_ns) : NULL)
 #endif
 
 #ifdef HAVE_FULL_NAME_HASH_3ARGS