Whamcloud - gitweb
Revert "b=20563 Increase LUSTRE_SEQ_MAX_WIDTH"
[fs/lustre-release.git] / lustre / lclient / lcommon_cl.c
index c172e9d..21a52e7 100644 (file)
@@ -1285,22 +1285,26 @@ __u16 ll_dirent_type_get(struct lu_dirent *ent)
 }
 
 /**
- * for 32 bit inode numbers directly map seq+oid to 32bit number.
- */
-__u32 cl_fid_build_ino32(const struct lu_fid *fid)
-{
-        RETURN(fid_flatten32(fid));
-}
-
-/**
  * build inode number from passed @fid */
-__u64 cl_fid_build_ino(const struct lu_fid *fid)
+ino_t cl_fid_build_ino(const struct lu_fid *fid)
 {
-#if BITS_PER_LONG == 32
-        RETURN(fid_flatten32(fid));
-#else
-        RETURN(fid_flatten(fid));
-#endif
+        ino_t ino;
+        ENTRY;
+
+        if (fid_is_igif(fid)) {
+                ino = lu_igif_ino(fid);
+                RETURN(ino);
+        }
+
+        /* Very stupid and having many downsides inode allocation algorithm
+         * based on fid. */
+        ino = fid_flatten(fid) & 0xFFFFFFFF;
+
+        if (unlikely(ino == 0))
+                /* the first result ino is 0xFFC001, so this is rarely used */
+                ino = 0xffbcde;
+        ino = ino | 0x80000000;
+        RETURN(ino);
 }
 
 /**