]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd: implement read not in terms of read_iterate
authorSage Weil <sage@inktank.com>
Tue, 23 Apr 2013 22:44:42 +0000 (15:44 -0700)
committerSage Weil <sage@inktank.com>
Tue, 23 Apr 2013 22:45:19 +0000 (15:45 -0700)
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>
src/librbd/internal.cc

index c56f0a553b01aa111459eb0ce1f10d23194e9819..f57fb1d9d2703e45263b7a2df24485c242f45412 100644 (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)