]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: match bottom half of assilate_dirty_rstat_inodes with a dir flag
authorSage Weil <sage@newdream.net>
Fri, 5 Nov 2010 05:44:01 +0000 (22:44 -0700)
committerSage Weil <sage@newdream.net>
Fri, 5 Nov 2010 05:44:01 +0000 (22:44 -0700)
We only do the assimilate_dirty_rstat_inodes if we do an update AND the
frag rstat was non-stale, but the bottom half (_finish) doesn't have the
same info to know whether we did it because the top half updates the
fragstat version.  Use a flag to indicate we've updated the dirfrag so
the bottom half will only run when needed.

Signed-off-by: Sage Weil <sage@newdream.net>
src/mds/CDir.cc
src/mds/CDir.h

index a968ecd068296abf5aa1c2d776dd0a2c99bd7b50..064b0bde2ef038395ebd3ce954015f92d13344a3 100644 (file)
@@ -799,11 +799,15 @@ void CDir::assimilate_dirty_rstat_inodes()
 
     inode->mdcache->project_rstat_inode_to_frag(in, this, 0, 0);
   }
+  state_set(STATE_ASSIMRSTAT);
   dout(10) << "assimilate_dirty_rstat_inodes done" << dendl;
 }
 
 void CDir::assimilate_dirty_rstat_inodes_finish(Mutation *mut, EMetaBlob *blob)
 {
+  if (!state_test(STATE_ASSIMRSTAT))
+    return;
+  state_clear(STATE_ASSIMRSTAT);
   dout(10) << "assimilate_dirty_rstat_inodes_finish" << dendl;
   elist<CInode*>::iterator p = dirty_rstat_inodes.begin_use_current();
   while (!p.end()) {
index 78ef86296fe1f2eb84aae9115cf723a055206d3d..f3be970f7a47f1b761059ca94d622c97920d7d16 100644 (file)
@@ -101,6 +101,7 @@ public:
   static const unsigned STATE_FRAGMENTING =   (1<<14);
   static const unsigned STATE_STICKY =        (1<<15);  // sticky pin due to inode stickydirs
   static const unsigned STATE_DNPINNEDFRAG =  (1<<16);  // dir is refragmenting
+  static const unsigned STATE_ASSIMRSTAT =    (1<<17);  // assimilating inode->frag rstats
 
   // common states
   static const unsigned STATE_CLEAN =  0;