From f709da6f2c42e86dbc8d86c72004da6475512a59 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Fri, 20 Oct 2017 17:11:21 -0500 Subject: [PATCH] os/ObjectStore: add get_devices() method 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 --- src/os/ObjectStore.h | 5 +++++ src/os/memstore/MemStore.h | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/src/os/ObjectStore.h b/src/os/ObjectStore.h index 9eff1ff0db1..d4fc72255c2 100644 --- a/src/os/ObjectStore.h +++ b/src/os/ObjectStore.h @@ -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 *devls) { + return -EOPNOTSUPP; + } + /** * is_rotational * diff --git a/src/os/memstore/MemStore.h b/src/os/memstore/MemStore.h index b6ed62c2689..72c7b5cec69 100644 --- a/src/os/memstore/MemStore.h +++ b/src/os/memstore/MemStore.h @@ -280,6 +280,11 @@ public: return false; } + int get_devices(set *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;