diff options
author | Sage Weil <sage.weil@dreamhost.com> | 2011-04-01 19:46:07 +0200 |
---|---|---|
committer | Sage Weil <sage.weil@dreamhost.com> | 2011-04-01 20:24:14 +0200 |
commit | 8408f83ceed8f63f2cb7722d563cc802d8e6b58c (patch) | |
tree | 5cb8aa612a09e8cc02e69eacc7d7070bd9781d1e /src/client/SyntheticClient.cc | |
parent | client: fix lookup_hash request hash value (diff) | |
download | ceph-8408f83ceed8f63f2cb7722d563cc802d8e6b58c.tar.xz ceph-8408f83ceed8f63f2cb7722d563cc802d8e6b58c.zip |
client: lookup_ino command
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
Diffstat (limited to 'src/client/SyntheticClient.cc')
-rw-r--r-- | src/client/SyntheticClient.cc | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/client/SyntheticClient.cc b/src/client/SyntheticClient.cc index e96560232ca..4cd14b41e0e 100644 --- a/src/client/SyntheticClient.cc +++ b/src/client/SyntheticClient.cc @@ -243,6 +243,9 @@ void parse_syn_options(vector<const char*>& args) syn_sargs.push_back(args[++i]); syn_sargs.push_back(args[++i]); syn_sargs.push_back(args[++i]); + } else if (strcmp(args[i], "lookupino") == 0) { + syn_modes.push_back(SYNCLIENT_MODE_LOOKUPINO); + syn_sargs.push_back(args[++i]); } else if (strcmp(args[i], "chunkfile") == 0) { syn_modes.push_back(SYNCLIENT_MODE_CHUNK); @@ -881,6 +884,16 @@ int SyntheticClient::run() } } break; + case SYNCLIENT_MODE_LOOKUPINO: + { + inodeno_t ino; + string iname = get_sarg(0); + sscanf(iname.c_str(), "%llx", (long long unsigned*)&ino.val); + if (run_me()) { + lookup_ino(ino); + } + } + break; case SYNCLIENT_MODE_MKSNAP: { @@ -3341,6 +3354,13 @@ int SyntheticClient::lookup_hash(inodeno_t ino, inodeno_t dirino, const char *na return r; } +int SyntheticClient::lookup_ino(inodeno_t ino) +{ + int r = client->lookup_ino(ino); + dout(0) << "lookup_ino(" << ino << ") = " << r << dendl; + return r; +} + int SyntheticClient::chunk_file(string &filename) { int fd = client->open(filename.c_str(), O_RDONLY); |