From e22c00b659faaffa7ab5b49c48747cfd7449c1ef Mon Sep 17 00:00:00 2001 From: myoungwon oh Date: Tue, 15 May 2018 17:45:08 +0900 Subject: [PATCH] osd: set has_reference flag when need_reference is set Signed-off-by: Myoungwon Oh --- src/osd/PrimaryLogPG.cc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/osd/PrimaryLogPG.cc b/src/osd/PrimaryLogPG.cc index f402e4518df79..769133244cad8 100644 --- a/src/osd/PrimaryLogPG.cc +++ b/src/osd/PrimaryLogPG.cc @@ -6810,6 +6810,9 @@ int PrimaryLogPG::do_osd_ops(OpContext *ctx, vector& ops) const string& name = iter->first; t->rmattr(soid, name); } + if (!has_reference && need_reference) { + oi.set_flag(object_info_t::FLAG_REDIRECT_HAS_REFERENCE); + } dout(10) << "set-redirect oid:" << oi.soid << " user_version: " << oi.user_version << dendl; if (op_finisher) { ctx->op_finishers.erase(ctx->current_osd_subop_num); @@ -6908,6 +6911,10 @@ int PrimaryLogPG::do_osd_ops(OpContext *ctx, vector& ops) ctx->delta_stats.num_objects_manifest++; oi.set_flag(object_info_t::FLAG_MANIFEST); oi.manifest.type = object_manifest_t::TYPE_CHUNKED; + if (!has_reference && need_reference) { + oi.manifest.chunk_map[src_offset].flags |= + chunk_info_t::FLAG_HAS_REFERENCE; + } ctx->modify = true; dout(10) << "set-chunked oid:" << oi.soid << " user_version: " << oi.user_version -- 2.39.5