]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
ceph: fix 32-bit ino numbers
authorAmon Ott <a.ott@m-privacy.de>
Thu, 20 Oct 2011 20:04:07 +0000 (13:04 -0700)
committerSage Weil <sage@newdream.net>
Tue, 25 Oct 2011 23:10:17 +0000 (16:10 -0700)
Fix 32-bit ino generation to not always be 1.

Signed-off-by: Amon Ott <a.ott@m-privacy.de>
fs/ceph/super.h

index 5c72430b8f7171abbebe4c203f2f7a8d0ebed030..b01442aaf278eff165f10596ba291c8953dee99e 100644 (file)
@@ -346,9 +346,10 @@ static inline struct ceph_vino ceph_vino(struct inode *inode)
  * x86_64+ino32  64                     32
  * x86_64        64                     64
  */
-static inline u32 ceph_ino_to_ino32(ino_t ino)
+static inline u32 ceph_ino_to_ino32(__u64 vino)
 {
-       ino ^= ino >> (sizeof(ino) * 8 - 32);
+       u32 ino = vino & 0xffffffff;
+       ino ^= vino >> 32;
        if (!ino)
                ino = 1;
        return ino;
@@ -359,11 +360,11 @@ static inline u32 ceph_ino_to_ino32(ino_t ino)
  */
 static inline ino_t ceph_vino_to_ino(struct ceph_vino vino)
 {
-       ino_t ino = (ino_t)vino.ino;  /* ^ (vino.snap << 20); */
 #if BITS_PER_LONG == 32
-       ino = ceph_ino_to_ino32(ino);
+       return ceph_ino_to_ino32(vino.ino);
+#else
+       return (ino_t)vino.ino;
 #endif
-       return ino;
 }
 
 /*