]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson: consolidate the return paths of get_segment_manager() 68839/head
authorKefu Chai <k.chai@proxmox.com>
Mon, 11 May 2026 05:46:25 +0000 (13:46 +0800)
committerKefu Chai <k.chai@proxmox.com>
Tue, 12 May 2026 03:03:03 +0000 (11:03 +0800)
before this change, two branches both return `BlockSegmentManager`,
which is redundant. in this change, consolidate them so that the
`HAVE_ZNS` path becomes an early return. this improves readability.

Signed-off-by: Kefu Chai <k.chai@proxmox.com>
src/crimson/os/seastore/segment_manager.cc

index 90a95be0a4308eeecf6bb961e552ab30cbde713d..0672b84a1374e445394c8f19521fba5395487757 100644 (file)
@@ -44,12 +44,9 @@ SegmentManager::get_segment_manager(
   INFO("Found {} zones.", nr_zones);
   if (nr_zones != 0) {
     co_return std::make_unique<segment_manager::zbd::ZBDSegmentManager>(device + "/block");
-  } else {
-    co_return std::make_unique<segment_manager::block::BlockSegmentManager>(device + "/block", dtype);
   }
-#else
-  co_return std::make_unique<segment_manager::block::BlockSegmentManager>(device + "/block", dtype);
 #endif
+  co_return std::make_unique<segment_manager::block::BlockSegmentManager>(device + "/block", dtype);
 }
 
 } // namespace crimson::os::seastore