ctx->set_snap_read(seq);
}
+int IoCtx::sparse_read(const std::string& oid, std::map<uint64_t,uint64_t>& m,
+ bufferlist& bl, size_t len, uint64_t off) {
+ TestIoCtxImpl *ctx = reinterpret_cast<TestIoCtxImpl*>(io_ctx_impl);
+ return ctx->execute_operation(
+ oid, boost::bind(&TestIoCtxImpl::sparse_read, _1, _2, off, len, &m, &bl));
+}
+
int IoCtx::stat(const std::string& oid, uint64_t *psize, time_t *pmtime) {
TestIoCtxImpl *ctx = reinterpret_cast<TestIoCtxImpl*>(io_ctx_impl);
return ctx->execute_operation(
RWLock::RLocker l(file->lock);
len = clip_io(off, len, file->data.length());
+ // TODO support sparse read
if (m != NULL) {
m->clear();
if (len > 0) {
bit.substr_of(file->data, off, len);
append_clone(bit, data_bl);
}
- return 0;
+ return len > 0 ? 1 : 0;
}
int TestMemIoCtxImpl::stat(const std::string& oid, uint64_t *psize,