@@ -556,27 +556,6 @@ bool GCManager::pdev_gc_actor::replace_blob_index(
556556 return true ;
557557}
558558
559- sisl::sg_list GCManager::pdev_gc_actor::generate_shard_super_blk_sg_list (shard_id_t shard_id) {
560- // TODO: do the buffer check before using it.
561- auto raw_shard_sb = m_hs_home_object->_get_hs_shard (shard_id);
562- RELEASE_ASSERT (raw_shard_sb, " can not find shard super blk for shard_id={} !!!" , shard_id);
563-
564- const auto shard_sb =
565- const_cast < HSHomeObject::HS_Shard* >(d_cast< const HSHomeObject::HS_Shard* >(raw_shard_sb))->sb_ .get ();
566-
567- auto blk_size = homestore::data_service ().get_blk_size ();
568- auto shard_sb_size = sizeof (HSHomeObject::shard_info_superblk);
569- auto total_size = sisl::round_up (shard_sb_size, blk_size);
570- auto shard_sb_buf = iomanager.iobuf_alloc (blk_size, total_size);
571-
572- std::memcpy (shard_sb_buf, shard_sb, shard_sb_size);
573-
574- sisl::sg_list shard_sb_sgs;
575- shard_sb_sgs.size = total_size;
576- shard_sb_sgs.iovs .emplace_back (iovec{.iov_base = shard_sb_buf, .iov_len = total_size});
577- return shard_sb_sgs;
578- }
579-
580559// note that, when we copy data, there is not create shard or put blob in this chunk, only delete blob might happen.
581560bool GCManager::pdev_gc_actor::copy_valid_data (chunk_id_t move_from_chunk, chunk_id_t move_to_chunk,
582561 const uint64_t task_id) {
@@ -696,7 +675,7 @@ bool GCManager::pdev_gc_actor::copy_valid_data(chunk_id_t move_from_chunk, chunk
696675 }
697676
698677 // prepare a shard header for this shard in move_to_chunk
699- sisl::sg_list header_sgs = generate_shard_super_blk_sg_list (shard_id);
678+ sisl::sg_list header_sgs = m_hs_home_object-> generate_shard_super_blk_sg_list (shard_id);
700679
701680 // we ignore the state in shard header blk. we never read a shard header since we don`t know where it is(nor
702681 // record the pba in indextable)
@@ -841,7 +820,7 @@ bool GCManager::pdev_gc_actor::copy_valid_data(chunk_id_t move_from_chunk, chunk
841820 }
842821
843822 // 3 write a shard footer for this shard
844- sisl::sg_list footer_sgs = generate_shard_super_blk_sg_list (shard_id);
823+ sisl::sg_list footer_sgs = m_hs_home_object-> generate_shard_super_blk_sg_list (shard_id);
845824 return folly::collectAllUnsafe (futs)
846825 .thenValue ([this , &is_last_shard, &shard_id, &blk_size, &hints, &move_to_chunk,
847826 &last_shard_state, task_id, &data_service, footer_sgs](auto && results) {
0 commit comments