Revert "ceph: keep reference to parent inode on ceph_dentry"
authorSage Weil <sage@newdream.net>
Mon, 28 Feb 2011 17:47:37 +0000 (09:47 -0800)
committerSage Weil <sage@newdream.net>
Thu, 3 Mar 2011 18:09:50 +0000 (10:09 -0800)
This reverts commit 97d79b403ef03f729883246208ef5d8a2ebc4d68.

This fails to account for d_parent changes due to rename or disconnected
dentries due to submounts or NFS reexports.

Signed-off-by: Sage Weil <sage@newdream.net>
fs/ceph/dir.c
fs/ceph/super.h

index f0aef787a1026cb96587054d19bc01c6eaf2e03b..0bc68de8edd7baa27af0de76cdae1f6eb1e29fea 100644 (file)
@@ -60,7 +60,6 @@ int ceph_init_dentry(struct dentry *dentry)
        }
        di->dentry = dentry;
        di->lease_session = NULL;
-       di->parent_inode = igrab(dentry->d_parent->d_inode);
        dentry->d_fsdata = di;
        dentry->d_time = jiffies;
        ceph_dentry_lru_add(dentry);
@@ -1034,7 +1033,7 @@ static void ceph_dentry_release(struct dentry *dentry)
        u64 snapid = CEPH_NOSNAP;
 
        if (!IS_ROOT(dentry)) {
-               parent_inode = di->parent_inode;
+               parent_inode = dentry->d_parent->d_inode;
                if (parent_inode)
                        snapid = ceph_snap(parent_inode);
        }
@@ -1059,8 +1058,6 @@ static void ceph_dentry_release(struct dentry *dentry)
                kmem_cache_free(ceph_dentry_cachep, di);
                dentry->d_fsdata = NULL;
        }
-       if (parent_inode)
-               iput(parent_inode);
 }
 
 static int ceph_snapdir_d_revalidate(struct dentry *dentry,
index 88fcaa21b801a8c10ba2be23c41967b95ddfcef6..20b907d76ae2f1be3b9e5ef4859bb1866b833c8a 100644 (file)
@@ -207,7 +207,6 @@ struct ceph_dentry_info {
        struct dentry *dentry;
        u64 time;
        u64 offset;
-       struct inode *parent_inode;
 };
 
 struct ceph_inode_xattrs_info {