ceph: use d_invalidate() to invalidate aliases
authorYan, Zheng <zheng.z.yan@intel.com>
Mon, 2 Sep 2013 07:19:54 +0000 (15:19 +0800)
committerSage Weil <sage@inktank.com>
Fri, 6 Sep 2013 19:55:29 +0000 (12:55 -0700)
d_invalidate() is the standard VFS method to invalidate dentry.
compare to d_delete(), it also try shrinking children dentries.

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
Reviewed-by: Sage Weil <sage@inktank.com>
fs/ceph/caps.c

index 7b451eb7d123ce36d353118938b5ecd60456f720..13976c33332ec1fd7ca3999053b15b7079c5ab31 100644 (file)
@@ -2346,10 +2346,10 @@ static void invalidate_aliases(struct inode *inode)
        d_prune_aliases(inode);
        /*
         * For non-directory inode, d_find_alias() only returns
-        * connected dentry. After calling d_delete(), the dentry
-        * become disconnected.
+        * connected dentry. After calling d_invalidate(), the
+        * dentry become disconnected.
         *
-        * For directory inode, d_find_alias() only can return
+        * For directory inode, d_find_alias() can return
         * disconnected dentry. But directory inode should have
         * one alias at most.
         */
@@ -2358,7 +2358,7 @@ static void invalidate_aliases(struct inode *inode)
                        dput(dn);
                        break;
                }
-               d_delete(dn);
+               d_invalidate(dn);
                if (prev)
                        dput(prev);
                prev = dn;