mirror of
https://github.com/ceph/ceph
synced 2025-01-19 01:21:49 +00:00
ReplicatedPG: Update stat accounting for truncate during write
Signed-off-by: Samuel Just <samuel.just@dreamhost.com> Reviewed-by: Josh Durgin <josh.durgin@dreamhost.com>
This commit is contained in:
parent
8ceb388396
commit
4815cafddf
@ -1606,6 +1606,14 @@ int ReplicatedPG::do_osd_ops(OpContext *ctx, vector<OSDOp>& ops,
|
||||
t.truncate(coll, soid, op.extent.truncate_size);
|
||||
oi.truncate_seq = op.extent.truncate_seq;
|
||||
oi.truncate_size = op.extent.truncate_size;
|
||||
if (op.extent.truncate_size != oi.size) {
|
||||
ctx->delta_stats.num_bytes -= oi.size;
|
||||
ctx->delta_stats.num_kb -= SHIFT_ROUND_UP(oi.size, 10);
|
||||
ctx->delta_stats.num_bytes += op.extent.truncate_size;
|
||||
ctx->delta_stats.num_kb +=
|
||||
SHIFT_ROUND_UP(op.extent.truncate_size, 10);
|
||||
oi.size = op.extent.truncate_size;
|
||||
}
|
||||
}
|
||||
bufferlist nbl;
|
||||
bp.copy(op.extent.length, nbl);
|
||||
|
Loading…
Reference in New Issue
Block a user