| 2681 | } |
| 2682 | |
| 2683 | int 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 | |
| 2716 | int do_rm_omap(ObjectStore *store, coll_t coll, |
| 2717 | ghobject_t &ghobj, string key) |
no test coverage detected