| 2592 | } |
| 2593 | |
| 2594 | int do_set_attr(ObjectStore *store, coll_t coll, |
| 2595 | ghobject_t &ghobj, string key, int fd) |
| 2596 | { |
| 2597 | ObjectStore::Transaction tran; |
| 2598 | ObjectStore::Transaction *t = &tran; |
| 2599 | bufferlist bl; |
| 2600 | |
| 2601 | if (debug) |
| 2602 | cerr << "Setattr " << ghobj << std::endl; |
| 2603 | |
| 2604 | int ret = get_fd_data(fd, bl); |
| 2605 | if (ret < 0) |
| 2606 | return ret; |
| 2607 | |
| 2608 | if (dry_run) |
| 2609 | return 0; |
| 2610 | |
| 2611 | t->touch(coll, ghobj); |
| 2612 | |
| 2613 | t->setattr(coll, ghobj, key, bl); |
| 2614 | |
| 2615 | auto ch = store->open_collection(coll); |
| 2616 | if (!ch) { |
| 2617 | cerr << "Collection " << coll << " does not exist" << std::endl; |
| 2618 | return -ENOENT; |
| 2619 | } |
| 2620 | store->queue_transaction(ch, std::move(*t)); |
| 2621 | return 0; |
| 2622 | } |
| 2623 | |
| 2624 | int do_rm_attr(ObjectStore *store, coll_t coll, |
| 2625 | ghobject_t &ghobj, string key) |
no test coverage detected