mirror of
https://github.com/ceph/ceph
synced 2024-12-18 09:25:49 +00:00
osd/PrimayLogPG: update modified range to include the whole object size for write_full op
Signed-off-by: runsisi <runsisi@zte.com.cn>
This commit is contained in:
parent
bb6d2de31a
commit
1fdc92716e
@ -5491,7 +5491,7 @@ int PrimaryLogPG::do_osd_ops(OpContext *ctx, vector<OSDOp>& ops)
|
||||
obs.oi.set_data_digest(osd_op.indata.crc32c(-1));
|
||||
|
||||
write_update_size_and_usage(ctx->delta_stats, oi, ctx->modified_ranges,
|
||||
0, op.extent.length, op.extent.length != oi.size ? true : false);
|
||||
0, op.extent.length, true);
|
||||
}
|
||||
break;
|
||||
|
||||
@ -6753,13 +6753,16 @@ void PrimaryLogPG::make_writeable(OpContext *ctx)
|
||||
|
||||
void PrimaryLogPG::write_update_size_and_usage(object_stat_sum_t& delta_stats, object_info_t& oi,
|
||||
interval_set<uint64_t>& modified, uint64_t offset,
|
||||
uint64_t length, bool force_changesize)
|
||||
uint64_t length, bool write_full)
|
||||
{
|
||||
interval_set<uint64_t> ch;
|
||||
if (length)
|
||||
if (write_full) {
|
||||
if (oi.size)
|
||||
ch.insert(0, oi.size);
|
||||
} else if (length)
|
||||
ch.insert(offset, length);
|
||||
modified.union_of(ch);
|
||||
if (force_changesize || offset + length > oi.size) {
|
||||
if (write_full || offset + length > oi.size) {
|
||||
uint64_t new_size = offset + length;
|
||||
delta_stats.num_bytes -= oi.size;
|
||||
delta_stats.num_bytes += new_size;
|
||||
|
@ -1099,8 +1099,7 @@ protected:
|
||||
|
||||
void write_update_size_and_usage(object_stat_sum_t& stats, object_info_t& oi,
|
||||
interval_set<uint64_t>& modified, uint64_t offset,
|
||||
uint64_t length,
|
||||
bool force_changesize=false);
|
||||
uint64_t length, bool write_full=false);
|
||||
void add_interval_usage(interval_set<uint64_t>& s, object_stat_sum_t& st);
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user