<< " extents " << image_extents
<< dendl;
aio_read(m_ictx->parent, image_extents, NULL, &m_read_data,
- m_parent_completion);
+ m_parent_completion, 0);
}
/** read **/
cp->prog_ctx.update_progress(offset, cp->src_size);
int ret = 0;
if (buf) {
- ret = write(cp->destictx, offset, len, buf);
+ ret = write(cp->destictx, offset, len, buf, 0);
}
return ret;
}
Context *ctx = new C_CopyWrite(m_throttle, m_bl);
AioCompletion *comp = aio_create_completion_internal(ctx, rbd_ctx_cb);
- r = aio_write(m_dest, m_offset, m_bl->length(), m_bl->c_str(), comp);
+ r = aio_write(m_dest, m_offset, m_bl->length(), m_bl->c_str(), comp, 0);
if (r < 0) {
ctx->complete(r);
comp->release();
bufferlist *bl = new bufferlist();
Context *ctx = new C_CopyRead(&throttle, dest, offset, bl);
AioCompletion *comp = aio_create_completion_internal(ctx, rbd_ctx_cb);
- r = aio_read(src, offset, len, NULL, bl, comp);
+ r = aio_read(src, offset, len, NULL, bl, comp, 0);
if (r < 0) {
ctx->complete(r);
comp->release();
Context *ctx = new C_SafeCond(&mylock, &cond, &done, &ret);
AioCompletion *c = aio_create_completion_internal(ctx, rbd_ctx_cb);
- r = aio_read(ictx, off, read_len, NULL, &bl, c);
+ r = aio_read(ictx, off, read_len, NULL, &bl, c, 0);
if (r < 0) {
c->release();
delete ctx;
return 0;
}
- ssize_t read(ImageCtx *ictx, uint64_t ofs, size_t len, char *buf)
+ ssize_t read(ImageCtx *ictx, uint64_t ofs, size_t len, char *buf, int op_flags)
{
vector<pair<uint64_t,uint64_t> > extents;
extents.push_back(make_pair(ofs, len));
- return read(ictx, extents, buf, NULL);
+ return read(ictx, extents, buf, NULL, op_flags);
}
- ssize_t read(ImageCtx *ictx, const vector<pair<uint64_t,uint64_t> >& image_extents, char *buf, bufferlist *pbl)
+ ssize_t read(ImageCtx *ictx, const vector<pair<uint64_t,uint64_t> >& image_extents,
+ char *buf, bufferlist *pbl, int op_flags)
{
Mutex mylock("IoCtxImpl::write::mylock");
Cond cond;
Context *ctx = new C_SafeCond(&mylock, &cond, &done, &ret);
AioCompletion *c = aio_create_completion_internal(ctx, rbd_ctx_cb);
- int r = aio_read(ictx, image_extents, buf, pbl, c);
+ int r = aio_read(ictx, image_extents, buf, pbl, c, op_flags);
if (r < 0) {
c->release();
delete ctx;
return ret;
}
- ssize_t write(ImageCtx *ictx, uint64_t off, size_t len, const char *buf)
+ ssize_t write(ImageCtx *ictx, uint64_t off, size_t len, const char *buf, int op_flags)
{
utime_t start_time, elapsed;
ldout(ictx->cct, 20) << "write " << ictx << " off = " << off << " len = "
Context *ctx = new C_SafeCond(&mylock, &cond, &done, &ret);
AioCompletion *c = aio_create_completion_internal(ctx, rbd_ctx_cb);
- r = aio_write(ictx, off, mylen, buf, c);
+ r = aio_write(ictx, off, mylen, buf, c, op_flags);
if (r < 0) {
c->release();
delete ctx;
}
int aio_write(ImageCtx *ictx, uint64_t off, size_t len, const char *buf,
- AioCompletion *c)
+ AioCompletion *c, int op_flags)
{
CephContext *cct = ictx->cct;
ldout(cct, 20) << "aio_write " << ictx << " off = " << off << " len = "
int aio_read(ImageCtx *ictx, uint64_t off, size_t len,
char *buf, bufferlist *bl,
- AioCompletion *c)
+ AioCompletion *c, int op_flags)
{
vector<pair<uint64_t,uint64_t> > image_extents(1);
image_extents[0] = make_pair(off, len);
- return aio_read(ictx, image_extents, buf, bl, c);
+ return aio_read(ictx, image_extents, buf, bl, c, op_flags);
}
struct C_RBD_Readahead : public Context {
}
int aio_read(ImageCtx *ictx, const vector<pair<uint64_t,uint64_t> >& image_extents,
- char *buf, bufferlist *pbl, AioCompletion *c)
+ char *buf, bufferlist *pbl, AioCompletion *c, int op_flags)
{
ldout(ictx->cct, 20) << "aio_read " << ictx << " completion " << c << " " << image_extents << dendl;
uint64_t off, uint64_t len,
int (*cb)(uint64_t, size_t, int, void *),
void *arg);
- ssize_t read(ImageCtx *ictx, uint64_t off, size_t len, char *buf);
+ ssize_t read(ImageCtx *ictx, uint64_t off, size_t len, char *buf, int op_flags);
ssize_t read(ImageCtx *ictx, const vector<pair<uint64_t,uint64_t> >& image_extents,
- char *buf, bufferlist *pbl);
- ssize_t write(ImageCtx *ictx, uint64_t off, size_t len, const char *buf);
+ char *buf, bufferlist *pbl, int op_flags);
+ ssize_t write(ImageCtx *ictx, uint64_t off, size_t len, const char *buf, int op_flags);
int discard(ImageCtx *ictx, uint64_t off, uint64_t len);
int aio_write(ImageCtx *ictx, uint64_t off, size_t len, const char *buf,
- AioCompletion *c);
+ AioCompletion *c, int op_flags);
int aio_discard(ImageCtx *ictx, uint64_t off, uint64_t len, AioCompletion *c);
int aio_read(ImageCtx *ictx, uint64_t off, size_t len,
- char *buf, bufferlist *pbl, AioCompletion *c);
+ char *buf, bufferlist *pbl, AioCompletion *c, int op_flags);
int aio_read(ImageCtx *ictx, const vector<pair<uint64_t,uint64_t> >& image_extents,
- char *buf, bufferlist *pbl, AioCompletion *c);
+ char *buf, bufferlist *pbl, AioCompletion *c, int op_flags);
int aio_flush(ImageCtx *ictx, AioCompletion *c);
int flush(ImageCtx *ictx);
int _flush(ImageCtx *ictx);
tracepoint(librbd, read_enter, ictx, ictx->name.c_str(), ictx->snap_name.c_str(), ictx->read_only, ofs, len);
bufferptr ptr(len);
bl.push_back(ptr);
- int r = librbd::read(ictx, ofs, len, bl.c_str());
+ int r = librbd::read(ictx, ofs, len, bl.c_str(), 0);
tracepoint(librbd, read_exit, r);
return r;
}
tracepoint(librbd, write_exit, -EINVAL);
return -EINVAL;
}
- int r = librbd::write(ictx, ofs, len, bl.c_str());
+ int r = librbd::write(ictx, ofs, len, bl.c_str(), 0);
tracepoint(librbd, write_exit, r);
return r;
}
return -EINVAL;
}
int r = librbd::aio_write(ictx, off, len, bl.c_str(),
- (librbd::AioCompletion *)c->pc);
+ (librbd::AioCompletion *)c->pc, 0);
tracepoint(librbd, aio_write_exit, r);
return r;
}
tracepoint(librbd, aio_read_enter, ictx, ictx->name.c_str(), ictx->snap_name.c_str(), ictx->read_only, off, len, bl.c_str(), c->pc);
ldout(ictx->cct, 10) << "Image::aio_read() buf=" << (void *)bl.c_str() << "~"
<< (void *)(bl.c_str() + len - 1) << dendl;
- int r = librbd::aio_read(ictx, off, len, NULL, &bl, (librbd::AioCompletion *)c->pc);
+ int r = librbd::aio_read(ictx, off, len, NULL, &bl, (librbd::AioCompletion *)c->pc, 0);
tracepoint(librbd, aio_read_exit, r);
return r;
}
{
librbd::ImageCtx *ictx = (librbd::ImageCtx *)image;
tracepoint(librbd, read_enter, ictx, ictx->name.c_str(), ictx->snap_name.c_str(), ictx->read_only, ofs, len);
- int r = librbd::read(ictx, ofs, len, buf);
+ int r = librbd::read(ictx, ofs, len, buf, 0);
tracepoint(librbd, read_exit, r);
return r;
}
{
librbd::ImageCtx *ictx = (librbd::ImageCtx *)image;
tracepoint(librbd, write_enter, ictx, ictx->name.c_str(), ictx->snap_name.c_str(), ictx->read_only, ofs, len, buf);
- int r = librbd::write(ictx, ofs, len, buf);
+ int r = librbd::write(ictx, ofs, len, buf, 0);
tracepoint(librbd, write_exit, r);
return r;
}
librbd::RBD::AioCompletion *comp = (librbd::RBD::AioCompletion *)c;
tracepoint(librbd, aio_write_enter, ictx, ictx->name.c_str(), ictx->snap_name.c_str(), ictx->read_only, off, len, buf, comp->pc);
int r = librbd::aio_write(ictx, off, len, buf,
- (librbd::AioCompletion *)comp->pc);
+ (librbd::AioCompletion *)comp->pc, 0);
tracepoint(librbd, aio_write_exit, r);
return r;
}
librbd::RBD::AioCompletion *comp = (librbd::RBD::AioCompletion *)c;
tracepoint(librbd, aio_read_enter, ictx, ictx->name.c_str(), ictx->snap_name.c_str(), ictx->read_only, off, len, buf, comp->pc);
int r = librbd::aio_read(ictx, off, len, buf, NULL,
- (librbd::AioCompletion *)comp->pc);
+ (librbd::AioCompletion *)comp->pc, 0);
tracepoint(librbd, aio_read_exit, r);
return r;
}