From: John Spray Date: Mon, 24 Aug 2015 11:56:21 +0000 (+0100) Subject: mds: add "tag path" command in MDSRank X-Git-Tag: v10.0.1~51^2~12 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=3eceaf8bbfbf88425ef018672deffcd498e1544b;p=ceph.git mds: add "tag path" command in MDSRank Signed-off-by: John Spray --- diff --git a/src/mds/MDSRank.cc b/src/mds/MDSRank.cc index bc657540c0f6..85ca8b158e8b 100644 --- a/src/mds/MDSRank.cc +++ b/src/mds/MDSRank.cc @@ -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; diff --git a/src/mds/MDSRank.h b/src/mds/MDSRank.h index 6dc59fe3ca8a..237b7368e119 100644 --- a/src/mds/MDSRank.h +++ b/src/mds/MDSRank.h @@ -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);