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 <sage@redhat.com>
This commit is contained in:
Sage Weil 2017-10-20 17:11:21 -05:00
parent 6b3b0afc28
commit f709da6f2c
2 changed files with 10 additions and 0 deletions

View 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
*

View 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;