Whamcloud - gitweb
support for sles10 kernel in lustre.
[fs/lustre-release.git] / lustre / include / linux / lustre_compat25.h
index e294e3f..b72ea7f 100644 (file)
@@ -336,5 +336,23 @@ generic_file_write(struct file *filp, const char __user *buf, size_t len, loff_t
 #define p_pptr parent
 #endif
 
+#ifndef HAVE_SB_TIME_GRAN
+#ifndef HAVE_S_TIME_GRAN
+#error Need s_time_gran patch!
+#endif
+static inline u32 get_sb_time_gran(struct super_block *sb)
+{
+        return sb->s_time_gran;
+}
+#endif
+
+#ifdef HAVE_RW_TREE_LOCK
+#define TREE_READ_LOCK_IRQ(mapping)    read_lock_irq(&(mapping)->tree_lock)
+#define TREE_READ_UNLOCK_IRQ(mapping) read_unlock_irq(&(mapping)->tree_lock)
+#else
+#define TREE_READ_LOCK_IRQ(mapping) spin_lock_irq(&(mapping)->tree_lock)
+#define TREE_READ_UNLOCK_IRQ(mapping) spin_unlock_irq(&(mapping)->tree_lock)
+#endif
+
 #endif /* __KERNEL__ */
 #endif /* _COMPAT25_H */