]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
os/bluestore/bluefs: drop redundant eof check for read_random()
authorxie xingguo <xie.xingguo@zte.com.cn>
Wed, 31 Aug 2016 02:47:50 +0000 (10:47 +0800)
committerxie xingguo <xie.xingguo@zte.com.cn>
Wed, 31 Aug 2016 03:30:35 +0000 (11:30 +0800)
Because we have done the sanity check and fixed the length
at the entrance, so we don't have to check it again,
especially in the while loop, which is less efficient.

Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
src/os/bluestore/BlueFS.cc

index 8268c5632ec095491b60d45797d4a6759c682d0d..d5d0323bb3061ac3a353e0f70e7610653e9ad2d8 100644 (file)
@@ -837,10 +837,6 @@ int BlueFS::_read_random(
     uint64_t x_off = 0;
     vector<bluefs_extent_t>::iterator p = h->file->fnode.seek(off, &x_off);
     uint64_t l = MIN(p->length - x_off, len);
-    if (!h->ignore_eof &&
-       off + l > h->file->fnode.size) {
-      l = h->file->fnode.size - off;
-    }
     dout(20) << __func__ << " read buffered 0x"
              << std::hex << x_off << "~" << l << std::dec
              << " of " << *p << dendl;