22960192 use readv to reimplement SPARSE_READ, however it is
still using total_read to accumulate total bytes it reads from
bluestore, which is always zero in code.
Fix by dropping the redundant local total_read counter.
By definition objects_readv_sync should return the correct bytes
it has read. Use that instead.
Signed-off-by: Yan Jun <yan.jun8@zte.com.cn>
} else {
// read into a buffer
map<uint64_t, uint64_t> m;
- uint32_t total_read = 0;
int r = osd->store->fiemap(ch, ghobject_t(soid, ghobject_t::NO_GEN,
info.pgid.shard),
op.extent.offset, op.extent.length, m);
}
}
- op.extent.length = total_read;
+ op.extent.length = r;
encode(m, osd_op.outdata); // re-encode since it might be modified
::encode_destructively(data_bl, osd_op.outdata);