Skip to content

Commit

Permalink
ceph_objectstore_tool: Add utility routine get_osdmap()
Browse files Browse the repository at this point in the history
Signed-off-by: David Zafman <dzafman@redhat.com>
(cherry picked from commit b3021b0)

Conflicts:
	src/tools/ceph_objectstore_tool.cc
  • Loading branch information
dzafman committed Mar 3, 2015
1 parent f997b12 commit 4e30d8c
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/tools/ceph_objectstore_tool.cc
Expand Up @@ -760,6 +760,21 @@ int export_files(ObjectStore *store, coll_t coll)
return 0;
}

int get_osdmap(ObjectStore *store, epoch_t e, OSDMap &osdmap)
{
bufferlist bl;
bool found = store->read(
coll_t::META_COLL, OSD::get_osdmap_pobject_name(e), 0, 0, bl) >= 0;
if (!found) {
cerr << "Can't find OSDMap for pg epoch " << e << std::endl;
return ENOENT;
}
osdmap.decode(bl);
if (debug)
cerr << osdmap << std::endl;
return 0;
}

//Write super_header with its fixed 16 byte length
void write_super()
{
Expand Down

0 comments on commit 4e30d8c

Please sign in to comment.