Whamcloud - gitweb
LU-8066 obd: final pieces for sysfs/debugfs support.
[fs/lustre-release.git] / lustre / include / lustre_compat.h
index 4a3a0cf..37cca5a 100644 (file)
@@ -392,6 +392,16 @@ static inline void truncate_inode_pages_final(struct address_space *map)
 }
 #endif
 
+#ifndef HAVE_PTR_ERR_OR_ZERO
+static inline int __must_check PTR_ERR_OR_ZERO(__force const void *ptr)
+{
+       if (IS_ERR(ptr))
+               return PTR_ERR(ptr);
+       else
+               return 0;
+}
+#endif
+
 #ifndef SIZE_MAX
 #define SIZE_MAX       (~(size_t)0)
 #endif