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:
Sage Weil 2013-04-23 15:44:42 -07:00
parent 7ad63d23d7
commit 6c798ed940

View File

@ -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)