From: Sage Weil Date: Fri, 20 Oct 2017 22:11:21 +0000 (-0500) Subject: os/ObjectStore: add get_devices() method X-Git-Tag: v13.0.1~329^2~4 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=f709da6f2c42e86dbc8d86c72004da6475512a59;p=ceph.git 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 --- 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;