summaryrefslogtreecommitdiffstats
path: root/fs/ceph/super.h
diff options
context:
space:
mode:
authorAmon Ott <a.ott@m-privacy.de>2011-10-20 22:04:07 +0200
committerSage Weil <sage@newdream.net>2011-10-26 01:10:17 +0200
commit3310f7541f0c991b51324a7712db51fb8f912601 (patch)
treed9a003be8ae51c41facdb80125e853b7f143e5e6 /fs/ceph/super.h
parentlibceph: force resend of osd requests if we skip an osdmap (diff)
downloadlinux-3310f7541f0c991b51324a7712db51fb8f912601.tar.xz
linux-3310f7541f0c991b51324a7712db51fb8f912601.zip
ceph: fix 32-bit ino numbers
Fix 32-bit ino generation to not always be 1. Signed-off-by: Amon Ott <a.ott@m-privacy.de>
Diffstat (limited to 'fs/ceph/super.h')
-rw-r--r--fs/ceph/super.h11
1 files changed, 6 insertions, 5 deletions
diff --git a/fs/ceph/super.h b/fs/ceph/super.h
index 5c72430b8f71..b01442aaf278 100644
--- a/fs/ceph/super.h
+++ b/fs/ceph/super.h
@@ -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;
}
/*