MCPcopy Create free account
hub / github.com/ceph/ceph / do_set_omap

Function do_set_omap

src/tools/ceph_objectstore_tool.cc:2683–2714  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2681}
2682
2683int do_set_omap(ObjectStore *store, coll_t coll,
2684 ghobject_t &ghobj, string key, int fd)
2685{
2686 ObjectStore::Transaction tran;
2687 ObjectStore::Transaction *t = &tran;
2688 map<string, bufferlist> attrset;
2689 bufferlist valbl;
2690
2691 if (debug)
2692 cerr << "Set_omap " << ghobj << std::endl;
2693
2694 int ret = get_fd_data(fd, valbl);
2695 if (ret < 0)
2696 return ret;
2697
2698 attrset.insert(pair<string, bufferlist>(key, valbl));
2699
2700 if (dry_run)
2701 return 0;
2702
2703 t->touch(coll, ghobj);
2704
2705 t->omap_setkeys(coll, ghobj, attrset);
2706
2707 auto ch = store->open_collection(coll);
2708 if (!ch) {
2709 cerr << "Collection " << coll << " does not exist" << std::endl;
2710 return -ENOENT;
2711 }
2712 store->queue_transaction(ch, std::move(*t));
2713 return 0;
2714}
2715
2716int do_rm_omap(ObjectStore *store, coll_t coll,
2717 ghobject_t &ghobj, string key)

Callers 1

mainFunction · 0.85

Calls 6

get_fd_dataFunction · 0.70
insertMethod · 0.45
touchMethod · 0.45
omap_setkeysMethod · 0.45
open_collectionMethod · 0.45
queue_transactionMethod · 0.45

Tested by

no test coverage detected