]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: set has_reference flag when need_reference is set
authormyoungwon oh <omwmw@sk.com>
Tue, 15 May 2018 08:45:08 +0000 (17:45 +0900)
committermyoungwon oh <omwmw@sk.com>
Mon, 4 Jun 2018 00:51:46 +0000 (09:51 +0900)
Signed-off-by: Myoungwon Oh <omwmw@sk.com>
src/osd/PrimaryLogPG.cc

index f402e4518df799b7899aa26945190818f4b810f6..769133244cad8782362df55c2b16f9a7a125065a 100644 (file)
@@ -6810,6 +6810,9 @@ int PrimaryLogPG::do_osd_ops(OpContext *ctx, vector<OSDOp>& 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<OSDOp>& 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