From 474b16d0093088ba2002576b4f741612bf886465 Mon Sep 17 00:00:00 2001 From: sageweil Date: Mon, 10 Sep 2007 22:15:19 +0000 Subject: [PATCH] localized ll trace playback git-svn-id: https://ceph.svn.sf.net/svnroot/ceph@1814 29311d96-e01e-0410-9327-a35deaab8ce9 --- trunk/ceph/client/SyntheticClient.cc | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/trunk/ceph/client/SyntheticClient.cc b/trunk/ceph/client/SyntheticClient.cc index 44abc039058fa..6f6e777274641 100644 --- a/trunk/ceph/client/SyntheticClient.cc +++ b/trunk/ceph/client/SyntheticClient.cc @@ -660,7 +660,7 @@ int SyntheticClient::run() string tfile = get_sarg(0); sargs.push_front(string("~")); int iarg1 = iargs.front(); iargs.pop_front(); - string prefix;// = get_sarg(0); + string prefix = get_sarg(0); char realtfile[100]; sprintf(realtfile, tfile.c_str(), client->get_nodeid()); @@ -843,8 +843,6 @@ int SyntheticClient::play_trace(Trace& t, string& prefix, bool metadata_only) utime_t start = g_clock.now(); - const char *p = prefix.c_str(); - hash_map open_files; hash_map open_dirs; @@ -854,6 +852,19 @@ int SyntheticClient::play_trace(Trace& t, string& prefix, bool metadata_only) ll_inos[1] = 1; // root inode is known. + const char *p = prefix.c_str(); + if (prefix.length()) { + client->mkdir(prefix.c_str(), 0755); + struct stat attr; + if (client->ll_lookup(1, prefix.c_str(), &attr) == 0) { + ll_inos[1] = attr.st_ino; + dout(0) << "'root' ino is " << attr.st_ino << dendl; + } else { + dout(0) << "warning: play_trace coudln't lookup up my per-client directory" << dendl; + } + } + + utime_t last_status = start; int n = 0; -- 2.39.5