]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: fix snap purging during commit
authorSage Weil <sage@newdream.net>
Mon, 5 Apr 2010 17:53:17 +0000 (10:53 -0700)
committerSage Weil <sage@newdream.net>
Mon, 5 Apr 2010 17:53:17 +0000 (10:53 -0700)
Use the helper!

The commit_partial is still incomplete.. we need to purge the
dentry after the commit completes?

src/mds/CDir.cc

index 635b24269885e2b86412f811477c3f59a4c7a2fd..ca8d74e20c7d0c92e80878761bfba186d6733e7d 100644 (file)
@@ -1415,16 +1415,9 @@ void CDir::_commit_full(ObjectOperation& m, const set<snapid_t> *snaps)
     if (dn->linkage.is_null()) 
       continue;  // skip negative entries
 
-    if (snaps && dn->last != CEPH_NOSNAP) {
-      set<snapid_t>::const_iterator p = snaps->lower_bound(dn->first);
-      if (p == snaps->end() || *p > dn->last) {
-       dout(10) << " purging " << *dn << dendl;
-       if (dn->linkage.is_primary() && dn->linkage.get_inode()->is_dirty())
-         dn->linkage.get_inode()->mark_clean();
-       remove_dentry(dn);
-       continue;
-      }
-    }
+    if (snaps && dn->last != CEPH_NOSNAP &&
+       try_trim_snap_dentry(dn, *snaps))
+      continue;
     
     n++;
 
@@ -1464,10 +1457,6 @@ void CDir::_commit_partial(ObjectOperation& m, const set<snapid_t> *snaps)
     if (snaps && dn->last != CEPH_NOSNAP) {
       set<snapid_t>::const_iterator p = snaps->lower_bound(dn->first);
       if (p == snaps->end() || *p > dn->last) {
-       dout(10) << " purging " << *dn << dendl;
-       if (dn->linkage.is_primary() && dn->linkage.get_inode()->is_dirty())
-         dn->linkage.get_inode()->mark_clean();
-
        dout(10) << " rm " << dn->name << " " << *dn << dendl;
        finalbl.append(CEPH_OSD_TMAP_RM);
        dn->key().encode(finalbl);