]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.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)
committerPere Diaz Bou <pere-altea@hotmail.com>
Fri, 23 Aug 2024 09:49:24 +0000 (11:49 +0200)
Signed-off-by: Adam Kupczyk <akupczyk@ibm.com>
(cherry picked from commit 0891702f23a7e98f79e58b6a35abd23a8944aa08)

src/os/bluestore/BlueFS.cc
src/os/bluestore/BlueFS.h

index e199a9f8d9cc528c936423ff228f7f161aa0939f..49c9d107af1cbc255a0f9ee908e1f4e129c7b42f 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 86fb3cc882e1e4c2c5cd9d98d0d98e246734ea7a..f656943e5984aab42468559c9e807067407eedba 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);