]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph: don't count snap dentries when calculating new fragstat/neststat
authorYan, Zheng <zyan@redhat.com>
Wed, 14 Jan 2015 06:24:14 +0000 (14:24 +0800)
committerYan, Zheng <zyan@redhat.com>
Thu, 5 Feb 2015 14:40:39 +0000 (22:40 +0800)
Signed-off-by: Yan, Zheng <zyan@redhat.com>
src/mds/CDir.cc

index 93fa4ac06ca1f3a62bbb0df86404eb6c02723245..7c06d91154f6afa372eee2922e69b4abc42018fe 100644 (file)
@@ -793,11 +793,8 @@ void CDir::steal_dentry(CDentry *dn)
       num_head_null++;
     else
       num_snap_null++;
-  } else {
-    if (dn->last == CEPH_NOSNAP)
+  } else if (dn->last == CEPH_NOSNAP) {
       num_head_items++;
-    else
-      num_snap_items++;
 
     if (dn->get_linkage()->is_primary()) {
       CInode *in = dn->get_linkage()->get_inode();
@@ -822,7 +819,8 @@ void CDir::steal_dentry(CDentry *dn)
       else
        fnode.fragstat.nfiles++;
     }
-  }
+  } else
+      num_snap_items++;
 
   if (dn->auth_pins || dn->nested_auth_pins) {
     // use the helpers here to maintain the auth_pin invariants on the dir inode