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

Function do_set_attr

src/tools/ceph_objectstore_tool.cc:2594–2622  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2592}
2593
2594int 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
2624int do_rm_attr(ObjectStore *store, coll_t coll,
2625 ghobject_t &ghobj, string key)

Callers 1

mainFunction · 0.85

Calls 5

get_fd_dataFunction · 0.70
touchMethod · 0.45
setattrMethod · 0.45
open_collectionMethod · 0.45
queue_transactionMethod · 0.45

Tested by

no test coverage detected