From 47c8a214356983f0539f24fe1c5724b3bbae0406 Mon Sep 17 00:00:00 2001 From: xie xingguo Date: Wed, 31 Aug 2016 10:47:50 +0800 Subject: [PATCH] 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 --- src/os/bluestore/BlueFS.cc | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/os/bluestore/BlueFS.cc b/src/os/bluestore/BlueFS.cc index 8268c5632ec..d5d0323bb30 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; -- 2.47.3