From: xie xingguo Date: Wed, 31 Aug 2016 02:47:50 +0000 (+0800) Subject: os/bluestore/bluefs: drop redundant eof check for read_random() X-Git-Tag: v11.0.1~350^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=47c8a214356983f0539f24fe1c5724b3bbae0406;p=ceph.git os/bluestore/bluefs: drop redundant eof check for read_random() 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 --- diff --git a/src/os/bluestore/BlueFS.cc b/src/os/bluestore/BlueFS.cc index 8268c5632ec09..d5d0323bb3061 100644 --- a/src/os/bluestore/BlueFS.cc +++ b/src/os/bluestore/BlueFS.cc @@ -837,10 +837,6 @@ int BlueFS::_read_random( uint64_t x_off = 0; vector::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;