]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os/ObjectStore: add get_devices() method
authorSage Weil <sage@redhat.com>
Fri, 20 Oct 2017 22:11:21 +0000 (17:11 -0500)
committerSage Weil <sage@redhat.com>
Tue, 31 Oct 2017 16:54:42 +0000 (11:54 -0500)
The intent here is to return the set of hardware storage devices, as
identified by the "devname" (i.e., the directory name for the device in
/sys/block/).  For example, "sda", "nvme0n1", etc.

Signed-off-by: Sage Weil <sage@redhat.com>
src/os/ObjectStore.h
src/os/memstore/MemStore.h

index 9eff1ff0db14b3d59aa12419d2deabc2d912955b..d4fc72255c23f8944a5ad23c3e9a71d95c7c5757 100644 (file)
@@ -1562,6 +1562,11 @@ public:
   virtual bool wants_journal() = 0;  //< prefers a journal
   virtual bool allows_journal() = 0; //< allows a journal
 
+  /// enumerate hardware devices (by 'devname', e.g., 'sda' as in /sys/block/sda)
+  virtual int get_devices(std::set<string> *devls) {
+    return -EOPNOTSUPP;
+  }
+
   /**
    * is_rotational
    *
index b6ed62c26898f70898e1bab1c80ae09a0c1a7290..72c7b5cec6946966c65298a4b11b9fec8171854f 100644 (file)
@@ -280,6 +280,11 @@ public:
     return false;
   }
 
+  int get_devices(set<string> *ls) override {
+    // no devices for us!
+    return 0;
+  }
+
   int statfs(struct store_statfs_t *buf) override;
 
   bool exists(const coll_t& cid, const ghobject_t& oid) override;