Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tools: Cleanup dead code in ceph-objectstore-tool #15812

Merged
merged 1 commit into from Jun 29, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
31 changes: 5 additions & 26 deletions src/tools/ceph_objectstore_tool.cc
Expand Up @@ -820,9 +820,7 @@ int get_data(ObjectStore *store, coll_t coll, ghobject_t hoid,
int get_attrs(
ObjectStore *store, coll_t coll, ghobject_t hoid,
ObjectStore::Transaction *t, bufferlist &bl,
OSDriver &driver, SnapMapper &snap_mapper,
const ghobject_t& last_head,
const set<ghobject_t>& last_clones)
OSDriver &driver, SnapMapper &snap_mapper)
{
bufferlist::iterator ebliter = bl.begin();
attr_section as;
Expand Down Expand Up @@ -852,7 +850,7 @@ int get_attrs(
}
}
} else {
if (hoid == last_head) {
if (hoid.hobj.is_head()) {
map<string,bufferlist>::iterator mi = as.data.find(SS_ATTR);
if (mi != as.data.end()) {
SnapSet snapset;
Expand Down Expand Up @@ -911,9 +909,7 @@ int get_omap(ObjectStore *store, coll_t coll, ghobject_t hoid,
int ObjectStoreTool::get_object(ObjectStore *store, coll_t coll,
bufferlist &bl, OSDMap &curmap,
bool *skipped_objects,
ObjectStore::Sequencer &osr,
ghobject_t *last_head,
set<ghobject_t> *last_clones)
ObjectStore::Sequencer &osr)
{
ObjectStore::Transaction tran;
ObjectStore::Transaction *t = &tran;
Expand Down Expand Up @@ -963,19 +959,6 @@ int ObjectStoreTool::get_object(ObjectStore *store, coll_t coll,

cout << "Write " << ob.hoid << std::endl;

// manage snap collection
if (ob.hoid.hobj.is_snap()) {
ghobject_t head = ob.hoid;
head.hobj = head.hobj.get_head();
if (head == *last_head) {
last_clones->insert(ob.hoid);
} else {
*last_head = head;
last_clones->clear();
}
last_clones->insert(ob.hoid);
}

bufferlist ebl;
bool done = false;
while(!done) {
Expand All @@ -998,8 +981,7 @@ int ObjectStoreTool::get_object(ObjectStore *store, coll_t coll,
break;
case TYPE_ATTRS:
if (dry_run) break;
ret = get_attrs(store, coll, ob.hoid, t, ebl, driver, mapper,
*last_head, *last_clones);
ret = get_attrs(store, coll, ob.hoid, t, ebl, driver, mapper);
if (ret) return ret;
break;
case TYPE_OMAP_HDR:
Expand Down Expand Up @@ -1328,8 +1310,6 @@ int ObjectStoreTool::do_import(ObjectStore *store, OSDSuperblock& sb,
bool done = false;
bool found_metadata = false;
metadata_section ms;
ghobject_t last_head;
set<ghobject_t> last_clones;
while(!done) {
ret = read_section(&type, &ebl);
if (ret)
Expand All @@ -1342,8 +1322,7 @@ int ObjectStoreTool::do_import(ObjectStore *store, OSDSuperblock& sb,
}
switch(type) {
case TYPE_OBJECT_BEGIN:
ret = get_object(store, coll, ebl, curmap, &skipped_objects, osr,
&last_head, &last_clones);
ret = get_object(store, coll, ebl, curmap, &skipped_objects, osr);
if (ret) return ret;
break;
case TYPE_PG_METADATA:
Expand Down
4 changes: 1 addition & 3 deletions src/tools/ceph_objectstore_tool.h
Expand Up @@ -34,9 +34,7 @@ class ObjectStoreTool : public RadosDump
int get_object(
ObjectStore *store, coll_t coll,
bufferlist &bl, OSDMap &curmap, bool *skipped_objects,
ObjectStore::Sequencer &osr,
ghobject_t *last_head,
set<ghobject_t> *last_clones);
ObjectStore::Sequencer &osr);
int export_file(
ObjectStore *store, coll_t cid, ghobject_t &obj);
int export_files(ObjectStore *store, coll_t coll);
Expand Down