]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
client: rename flush_caps() with no arguments to flush_caps_sync() 11710/head
authorJeff Layton <jlayton@redhat.com>
Thu, 10 Nov 2016 11:30:27 +0000 (06:30 -0500)
committerJeff Layton <jlayton@redhat.com>
Fri, 11 Nov 2016 11:28:50 +0000 (06:28 -0500)
Per Greg's recommendation, change the name of this function to better
indicate what it does now that we always request a journal flush on
the last cap flush.

Also, add a comment above the function to better explain why we do this.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
src/client/Client.cc
src/client/Client.h

index 9f0517a6b7b330b0a1d341e3002f6ab1bf46df50..44dd55ae485caf69292fc54b58df512253730808 100644 (file)
@@ -4113,9 +4113,14 @@ void Client::adjust_session_flushing_caps(Inode *in, MetaSession *old_s,  MetaSe
   new_s->flushing_caps.push_back(&in->flushing_cap_item);
 }
 
-void Client::flush_caps()
+/*
+ * Flush all caps back to the MDS. Because the callers generally wait on the
+ * result of this function (syncfs and umount cases), we set
+ * CHECK_CAPS_SYNCHRONOUS on the last check_caps call.
+ */
+void Client::flush_caps_sync()
 {
-  ldout(cct, 10) << "flush_caps" << dendl;
+  ldout(cct, 10) << __func__ << dendl;
   xlist<Inode*>::iterator p = delayed_caps.begin();
   while (!p.end()) {
     unsigned flags = CHECK_CAPS_NODELAY;
@@ -5773,7 +5778,7 @@ void Client::unmount()
     }
   }
 
-  flush_caps();
+  flush_caps_sync();
   wait_sync_caps(last_flush_tid);
 
   // empty lru cache
@@ -9670,7 +9675,7 @@ int Client::_sync_fs()
     flush_done = true;
 
   // flush caps
-  flush_caps();
+  flush_caps_sync();
   ceph_tid_t flush_tid = last_flush_tid;
 
   // wait for unsafe mds requests
index 155385d192f23d3618098fbcff8c45e51466ce8a..636de56f27beb07c2c1ef72dfa25c4330f3cc8aa 100644 (file)
@@ -627,7 +627,7 @@ protected:
   void mark_caps_dirty(Inode *in, int caps);
   int mark_caps_flushing(Inode *in, ceph_tid_t *ptid);
   void adjust_session_flushing_caps(Inode *in, MetaSession *old_s, MetaSession *new_s);
-  void flush_caps();
+  void flush_caps_sync();
   void flush_caps(Inode *in, MetaSession *session, bool sync=false);
   void kick_flushing_caps(MetaSession *session);
   void early_kick_flushing_caps(MetaSession *session);