mirror of
https://github.com/ceph/ceph
synced 2025-03-11 02:39:05 +00:00
filer: make tail zeroing in stripe result assembly optional
Objecter doesn't want it, librbd will. Signed-off-by: Sage Weil <sage@inktank.com>
This commit is contained in:
parent
6cd51feced
commit
08d1eb5b0b
@ -143,7 +143,7 @@ class Filer {
|
||||
}
|
||||
}
|
||||
|
||||
void assemble_result(bufferlist& bl) {
|
||||
void assemble_result(bufferlist& bl, bool zero_tail) {
|
||||
// go backwards, so that we can efficiently discard zeros
|
||||
map<uint64_t,pair<bufferlist,uint64_t> >::reverse_iterator p = partial.rbegin();
|
||||
if (p == partial.rend())
|
||||
@ -157,7 +157,7 @@ class Filer {
|
||||
|
||||
size_t len = p->second.first.length();
|
||||
if (len < p->second.second) {
|
||||
if (bl.length()) {
|
||||
if (zero_tail || bl.length()) {
|
||||
bufferptr bp(p->second.second - p->second.first.length());
|
||||
bp.zero();
|
||||
bl.push_front(bp);
|
||||
|
@ -1875,7 +1875,7 @@ void Objecter::_sg_read_finish(vector<ObjectExtent>& extents, vector<bufferlist>
|
||||
r.add_partial_result(*bit, eit->buffer_extents);
|
||||
}
|
||||
bl->clear();
|
||||
r.assemble_result(*bl);
|
||||
r.assemble_result(*bl, false);
|
||||
} else {
|
||||
ldout(cct, 15) << " only one frag" << dendl;
|
||||
bl->claim(resultbl[0]);
|
||||
|
Loading…
Reference in New Issue
Block a user