]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
client: do not manually clean up on unlink/rmdir
authorSage Weil <sage@inktank.com>
Thu, 16 May 2013 20:49:58 +0000 (13:49 -0700)
committerYan, Zheng <zheng.z.yan@intel.com>
Thu, 8 May 2014 02:58:55 +0000 (10:58 +0800)
The reply handler will do this in a safe, ordered fashion.

Signed-off-by: Sage Weil <sage@inktank.com>
src/client/Client.cc

index 300ba1126bf3cdda5c22051192984cdd64b11bb1..535752ad33d7de9ddd70eafb87f04e0e6154c32f 100644 (file)
@@ -7956,13 +7956,6 @@ int Client::_unlink(Inode *dir, const char *name, int uid, int gid)
   req->set_inode(dir);
 
   res = make_request(req, uid, gid);
-  if (res == 0) {
-    if (dir->dir && dir->dir->dentries.count(name)) {
-      Dentry *dn = dir->dir->dentries[name];
-      unlink(dn, false, false);
-    }
-  }
-  ldout(cct, 10) << "unlink result is " << res << dendl;
 
   trim_cache();
   ldout(cct, 3) << "unlink(" << path << ") = " << res << dendl;
@@ -8018,15 +8011,6 @@ int Client::_rmdir(Inode *dir, const char *name, int uid, int gid)
   req->set_inode(in);
 
   res = make_request(req, uid, gid);
-  if (res == 0) {
-    if (dir->dir && dir->dir->dentries.count(name) ) {
-      Dentry *dn = dir->dir->dentries[name];
-      if (dn->inode->dir && dn->inode->dir->is_empty() &&
-         (dn->inode->dn_set.size() == 1))
-       close_dir(dn->inode->dir);  // FIXME: maybe i shoudl proactively hose the whole subtree from cache?
-      unlink(dn, false, false);
-    }
-  }
 
   trim_cache();
   ldout(cct, 3) << "rmdir(" << path << ") = " << res << dendl;