Whamcloud - gitweb
LU-1477 kernel: Kernel update [RHEL6.3 2.6.32-279.2.1.el6]
[fs/lustre-release.git] / lustre / osd-ldiskfs / osd_internal.h
index de8a83b..6617c25 100644 (file)
@@ -868,5 +868,24 @@ extern const struct dt_index_operations osd_acct_index_ops;
 int osd_acct_obj_lookup(struct osd_thread_info *info, struct osd_device *osd,
                        const struct lu_fid *fid, struct osd_inode_id *id);
 
+/* copy from fs/ext4/dir.c */
+static inline int is_32bit_api(void)
+{
+#ifdef CONFIG_COMPAT
+       return is_compat_task();
+#else
+       return (BITS_PER_LONG == 32);
+#endif
+}
+
+static inline loff_t ldiskfs_get_htree_eof(struct file *filp)
+{
+       if ((filp->f_mode & FMODE_32BITHASH) ||
+           (!(filp->f_mode & FMODE_64BITHASH) && is_32bit_api()))
+               return LDISKFS_HTREE_EOF_32BIT;
+       else
+               return LDISKFS_HTREE_EOF_64BIT;
+}
+
 #endif /* __KERNEL__ */
 #endif /* _OSD_INTERNAL_H */