]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: add "tag path" command in MDSRank
authorJohn Spray <john.spray@redhat.com>
Mon, 24 Aug 2015 11:56:21 +0000 (12:56 +0100)
committerYan, Zheng <zyan@redhat.com>
Wed, 4 Nov 2015 09:17:25 +0000 (17:17 +0800)
Signed-off-by: John Spray <john.spray@redhat.com>
src/mds/MDSRank.cc
src/mds/MDSRank.h

index bc657540c0f6e9407bf5d01cca181044ab5d136c..85ca8b158e8b75fbdfc47f76e91912c546a87c23 100644 (file)
@@ -1715,6 +1715,10 @@ bool MDSRankDispatcher::handle_asok_command(
     string path;
     cmd_getval(g_ceph_context, cmdmap, "path", path);
     command_scrub_path(f, path);
+  } else if (command == "tag path") {
+    string path;
+    cmd_getval(g_ceph_context, cmdmap, "path", path);
+    command_tag_path(f, path);
   } else if (command == "flush_path") {
     string path;
     cmd_getval(g_ceph_context, cmdmap, "path", path);
@@ -1854,6 +1858,16 @@ void MDSRank::command_scrub_path(Formatter *f, const string& path)
   // scrub_dentry() finishers will dump the data for us; we're done!
 }
 
+void MDSRank::command_tag_path(Formatter *f, const string& path)
+{
+  C_SaferCond scond;
+  {
+    Mutex::Locker l(mds_lock);
+    mdcache->enqueue_scrub(path, f, &scond);
+  }
+  scond.wait();
+}
+
 void MDSRank::command_flush_path(Formatter *f, const string& path)
 {
   C_SaferCond scond;
index 6dc59fe3ca8ad01dd29ddc0089a9b0411807d226..237b7368e1192821dced4706ffb821da7a4dee0f 100644 (file)
@@ -368,6 +368,7 @@ class MDSRank {
 
   protected:
     void command_scrub_path(Formatter *f, const string& path);
+    void command_tag_path(Formatter *f, const string& path);
     void command_flush_path(Formatter *f, const string& path);
     void command_flush_journal(Formatter *f);
     void command_get_subtrees(Formatter *f);