]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: Bluefs, expand api for getting BlockDevice on BD/WAL
authorAdam Kupczyk <akupczyk@ibm.com>
Tue, 13 Feb 2024 12:50:51 +0000 (12:50 +0000)
committerAdam Kupczyk <akupczyk@ibm.com>
Mon, 22 Jul 2024 12:36:28 +0000 (12:36 +0000)
Signed-off-by: Adam Kupczyk <akupczyk@ibm.com>
src/os/bluestore/BlueFS.cc
src/os/bluestore/BlueFS.h

index d369f7397d19f6f77d8b873d51019cf9fb8a71d6..89accf7880a99c47ac95c8bbda9a8d67d12d5403 100644 (file)
@@ -546,6 +546,13 @@ uint64_t BlueFS::get_block_device_size(unsigned id) const
   return 0;
 }
 
+BlockDevice* BlueFS::get_block_device(unsigned id) const
+{
+  if (id < bdev.size() && bdev[id])
+    return bdev[id];
+  return nullptr;
+}
+
 void BlueFS::handle_discard(unsigned id, interval_set<uint64_t>& to_release)
 {
   dout(10) << __func__ << " bdev " << id << dendl;
index 86a4971d798ca450364c4a064214862ef53fc254..17ba9bed32c5d1f98fd38a50515ddee074a92f46 100644 (file)
@@ -743,6 +743,7 @@ public:
                       bluefs_shared_alloc_context_t* _shared_alloc = nullptr);
   bool bdev_support_label(unsigned id);
   uint64_t get_block_device_size(unsigned bdev) const;
+  BlockDevice* get_block_device(unsigned bdev) const;
 
   // handler for discard event
   void handle_discard(unsigned dev, interval_set<uint64_t>& to_release);