mirror of
https://github.com/ceph/ceph
synced 2025-01-14 06:53:11 +00:00
librbd: implement read not in terms of read_iterate
The read() method returns the bytes read, trimmed to the end of the image; use the other read() variant to do this (which use aio_read()) instead of read_iterate(). Signed-off-by: Sage Weil <sage@inktank.com>
This commit is contained in:
parent
7ad63d23d7
commit
6c798ed940
@ -2459,7 +2459,9 @@ reprotect_and_return_err:
|
||||
|
||||
ssize_t read(ImageCtx *ictx, uint64_t ofs, size_t len, char *buf)
|
||||
{
|
||||
return read_iterate(ictx, ofs, len, simple_read_cb, buf);
|
||||
vector<pair<uint64_t,uint64_t> > extents;
|
||||
extents.push_back(make_pair(ofs, len));
|
||||
return read(ictx, extents, buf, NULL);
|
||||
}
|
||||
|
||||
ssize_t read(ImageCtx *ictx, const vector<pair<uint64_t,uint64_t> >& image_extents, char *buf, bufferlist *pbl)
|
||||
|
Loading…
Reference in New Issue
Block a user