]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
kclient: include snap in ino hash
authorSage Weil <sage@newdream.net>
Mon, 11 Aug 2008 23:44:11 +0000 (16:44 -0700)
committerSage Weil <sage@newdream.net>
Mon, 11 Aug 2008 23:44:11 +0000 (16:44 -0700)
src/kernel/inode.c
src/kernel/super.h

index 28bb12bb6cab5d689c4a75f1ca792dced2f54a77..daebc0cd8cf871c1f6ac2a9b88aef2ee882d149c 100644 (file)
@@ -2178,6 +2178,7 @@ int ceph_getattr(struct vfsmount *mnt, struct dentry *dentry,
        dout(30, "getattr returned %d\n", err);
        if (!err) {
                generic_fillattr(dentry->d_inode, stat);
+               stat->ino = ceph_vino(dentry->d_inode).ino;
                if (ceph_vino(dentry->d_inode).snap != CEPH_NOSNAP)
                        stat->dev = ceph_vino(dentry->d_inode).snap;
                else
index 0e66a2fe5aade8bb50bb50e3b8dfc624be4dafa2..1bd0ce4b6ec24288b5bea01152493ce9f85d0820 100644 (file)
@@ -313,11 +313,10 @@ static inline void ceph_queue_writeback(struct ceph_client *cl,
 
 /*
  * ino_t is <64 bits on many architectures, blech.
- * let snapped inos chain up on the same linux ino_t.
  */
 static inline ino_t ceph_vino_to_ino(struct ceph_vino vino)
 {
-       ino_t ino = (ino_t)vino.ino;
+       ino_t ino = (ino_t)vino.ino ^ (vino.snap << 20);
 #if BITS_PER_LONG == 32
        ino ^= vino.ino >> (sizeof(u64)-sizeof(ino_t)) * 8;
 #endif