wait_for_ready();
ghobject_t new_obj = object_gen->create_object(rng);
available_objects.erase(new_obj);
- ObjectStore::Transaction *t = new ObjectStore::Transaction;
- t->touch(cid, new_obj);
+ ObjectStore::Transaction t;
+ t.touch(cid, new_obj);
boost::uniform_int<> u(17, 22);
boost::uniform_int<> v(12, 17);
- t->set_alloc_hint(cid, new_obj,
+ t.set_alloc_hint(cid, new_obj,
1ull << u(*rng),
1ull << v(*rng),
get_random_alloc_hints());
in_flight_objects.insert(new_obj);
if (!contents.count(new_obj))
contents[new_obj] = Object();
- int status = store->queue_transaction(osr, std::move(*t), new C_SyntheticOnReadable(this, new_obj));
- delete t;
+ int status = store->queue_transaction(osr, std::move(t), new C_SyntheticOnReadable(this, new_obj));
return status;
}
new_obj.generation++;
available_objects.erase(new_obj);
- ObjectStore::Transaction *t = new ObjectStore::Transaction;
- t->collection_move_rename(cid, old_obj, cid, new_obj);
+ ObjectStore::Transaction t;
+ t.collection_move_rename(cid, old_obj, cid, new_obj);
++in_flight;
in_flight_objects.insert(old_obj);
contents[old_obj].data.length());
contents.erase(old_obj);
int status = store->queue_transaction(
- osr, std::move(*t),
+ osr, std::move(t),
new C_SyntheticOnStash(this, old_obj, new_obj));
- delete t;
return status;
}
new_obj.hobj.set_hash(old_obj.hobj.get_hash());
available_objects.erase(new_obj);
- ObjectStore::Transaction *t = new ObjectStore::Transaction;
- t->clone(cid, old_obj, new_obj);
+ ObjectStore::Transaction t;
+ t.clone(cid, old_obj, new_obj);
++in_flight;
in_flight_objects.insert(old_obj);
contents[new_obj].data.clear();
contents[new_obj].data.append(contents[old_obj].data.c_str(),
contents[old_obj].data.length());
- int status = store->queue_transaction(osr, std::move(*t), new C_SyntheticOnClone(this, old_obj, new_obj));
- delete t;
+ int status = store->queue_transaction(osr, std::move(t), new C_SyntheticOnClone(this, old_obj, new_obj));
return status;
}
ghobject_t obj = get_uniform_random_object();
available_objects.erase(obj);
- ObjectStore::Transaction *t = new ObjectStore::Transaction;
+ ObjectStore::Transaction t;
boost::uniform_int<> u0(1, max_attr_size);
boost::uniform_int<> u1(4, max_attr_name_len);
contents[obj].attrs[name.c_str()] = value;
}
}
- t->setattrs(cid, obj, attrs);
+ t.setattrs(cid, obj, attrs);
++in_flight;
in_flight_objects.insert(obj);
- int status = store->queue_transaction(osr, std::move(*t), new C_SyntheticOnReadable(this, obj));
- delete t;
+ int status = store->queue_transaction(osr, std::move(t), new C_SyntheticOnReadable(this, obj));
return status;
}
}
available_objects.erase(obj);
- ObjectStore::Transaction *t = new ObjectStore::Transaction;
- t->rmattr(cid, obj, it->first);
+ ObjectStore::Transaction t;
+ t.rmattr(cid, obj, it->first);
contents[obj].attrs.erase(it->first);
++in_flight;
in_flight_objects.insert(obj);
- int status = store->queue_transaction(osr, std::move(*t), new C_SyntheticOnReadable(this, obj));
- delete t;
+ int status = store->queue_transaction(osr, std::move(t), new C_SyntheticOnReadable(this, obj));
return status;
}
ghobject_t new_obj = get_uniform_random_object();
available_objects.erase(new_obj);
- ObjectStore::Transaction *t = new ObjectStore::Transaction;
+ ObjectStore::Transaction t;
boost::uniform_int<> u1(0, max_object_len - max_write_len);
boost::uniform_int<> u2(0, max_write_len);
value.swap(data);
}
- t->write(cid, new_obj, offset, len, bl);
+ t.write(cid, new_obj, offset, len, bl);
++in_flight;
in_flight_objects.insert(new_obj);
- int status = store->queue_transaction(osr, std::move(*t), new C_SyntheticOnReadable(this, new_obj));
- delete t;
+ int status = store->queue_transaction(osr, std::move(t), new C_SyntheticOnReadable(this, new_obj));
return status;
}
ghobject_t obj = get_uniform_random_object();
available_objects.erase(obj);
- ObjectStore::Transaction *t = new ObjectStore::Transaction;
+ ObjectStore::Transaction t;
boost::uniform_int<> choose(0, max_object_len);
size_t len = choose(*rng);
bufferlist bl;
- t->truncate(cid, obj, len);
+ t.truncate(cid, obj, len);
++in_flight;
in_flight_objects.insert(obj);
bufferlist& data = contents[obj].data;
bl.swap(data);
}
- int status = store->queue_transaction(osr, std::move(*t), new C_SyntheticOnReadable(this, obj));
- delete t;
+ int status = store->queue_transaction(osr, std::move(t), new C_SyntheticOnReadable(this, obj));
return status;
}
if (!can_unlink())
return -ENOENT;
ghobject_t to_remove = get_uniform_random_object();
- ObjectStore::Transaction *t = new ObjectStore::Transaction;
- t->remove(cid, to_remove);
+ ObjectStore::Transaction t;
+ t.remove(cid, to_remove);
++in_flight;
available_objects.erase(to_remove);
in_flight_objects.insert(to_remove);
contents.erase(to_remove);
- int status = store->queue_transaction(osr, std::move(*t), new C_SyntheticOnReadable(this, to_remove));
- delete t;
+ int status = store->queue_transaction(osr, std::move(t), new C_SyntheticOnReadable(this, to_remove));
return status;
}
ghobject_t new_obj = get_uniform_random_object();
available_objects.erase(new_obj);
- ObjectStore::Transaction *t = new ObjectStore::Transaction;
+ ObjectStore::Transaction t;
boost::uniform_int<> u1(0, max_object_len - max_write_len);
boost::uniform_int<> u2(0, max_write_len);
}
contents[new_obj].data.zero(offset, len);
- t->zero(cid, new_obj, offset, len);
+ t.zero(cid, new_obj, offset, len);
++in_flight;
in_flight_objects.insert(new_obj);
- int status = store->queue_transaction(osr, std::move(*t), new C_SyntheticOnReadable(this, new_obj));
- delete t;
+ int status = store->queue_transaction(osr, std::move(t), new C_SyntheticOnReadable(this, new_obj));
return status;
}