void ObjectWriteOperation::zero(uint64_t off, uint64_t len) {
TestObjectOperationImpl *o = reinterpret_cast<TestObjectOperationImpl*>(impl);
- o->ops.push_back(boost::bind(&TestIoCtxImpl::zero, _1, _2, off, len));
+ o->ops.push_back(boost::bind(&TestIoCtxImpl::zero, _1, _2, off, len, _4));
}
Rados::Rados() : client(NULL) {
std::map<std::string, bufferlist>* attrset) = 0;
virtual int xattr_set(const std::string& oid, const std::string &name,
bufferlist& bl) = 0;
- virtual int zero(const std::string& oid, uint64_t off, uint64_t len) = 0;
+ virtual int zero(const std::string& oid, uint64_t off, uint64_t len,
+ const SnapContext &snapc) = 0;
int execute_operation(const std::string& oid,
const Operation &operation);
return 0;
}
-int TestMemIoCtxImpl::zero(const std::string& oid, uint64_t off, uint64_t len) {
+int TestMemIoCtxImpl::zero(const std::string& oid, uint64_t off, uint64_t len,
+ const SnapContext &snapc) {
if (m_client->is_blacklisted()) {
return -EBLACKLISTED;
}
TestMemCluster::SharedFile file;
{
RWLock::WLocker l(m_pool->file_lock);
- file = get_file(oid, false, get_snap_context());
+ file = get_file(oid, false, snapc);
if (!file) {
return 0;
}
- file = get_file(oid, true, get_snap_context());
+ file = get_file(oid, true, snapc);
RWLock::RLocker l2(file->lock);
if (len > 0 && off + len >= file->data.length()) {
}
}
if (truncate_redirect) {
- return truncate(oid, off, get_snap_context());
+ return truncate(oid, off, snapc);
}
bufferlist bl;
bl.append_zero(len);
- return write(oid, bl, len, off, get_snap_context());
+ return write(oid, bl, len, off, snapc);
}
void TestMemIoCtxImpl::append_clone(bufferlist& src, bufferlist* dest) {
std::map<std::string, bufferlist>* attrset) override;
int xattr_set(const std::string& oid, const std::string &name,
bufferlist& bl) override;
- int zero(const std::string& oid, uint64_t off, uint64_t len) override;
+ int zero(const std::string& oid, uint64_t off, uint64_t len,
+ const SnapContext &snapc) override;
protected:
TestMemCluster::Pool *get_pool() {