return false; // assume a backend cannot, unless it says otherwise
}
- virtual int statfs(struct store_statfs_t *buf) = 0;
+ virtual int statfs(struct store_statfs_t *buf,
+ osd_alert_list_t* alerts = nullptr) = 0;
virtual int pool_statfs(uint64_t pool_id, struct store_statfs_t *buf) = 0;
virtual void collect_metadata(map<string,string> *pm) { }
int BlueStore::_reload_logger()
{
struct store_statfs_t store_statfs;
-
int r = statfs(&store_statfs);
if (r >= 0) {
logger->set(l_bluestore_allocated, store_statfs.allocated);
buf->available = bfree;
}
-int BlueStore::statfs(struct store_statfs_t *buf)
+int BlueStore::statfs(struct store_statfs_t *buf,
+ osd_alert_list_t* alerts)
{
+ if (alerts) {
+ alerts->clear();
+ }
_get_statfs_overall(buf);
{
std::lock_guard l(vstatfs_lock);
string get_device_path(unsigned id);
public:
- int statfs(struct store_statfs_t *buf) override;
+ int statfs(struct store_statfs_t *buf,
+ osd_alert_list_t* alerts = nullptr) override;
int pool_statfs(uint64_t pool_id, struct store_statfs_t *buf) override;
void collect_metadata(map<string,string> *pm) override;
debug_mdata_error_objects.erase(o);
}
}
-
private:
// --------------------------------------------------------
return 0;
}
-int FileStore::statfs(struct store_statfs_t *buf0)
+int FileStore::statfs(struct store_statfs_t *buf0, osd_alert_list_t* alerts)
{
struct statfs buf;
buf0->reset();
+ if (alerts) {
+ alerts->clear(); // returns nothing for now
+ }
if (::statfs(basedir.c_str(), &buf) < 0) {
int r = -errno;
ceph_assert(!m_filestore_fail_eio || r != -EIO);
void collect_metadata(map<string,string> *pm) override;
int get_devices(set<string> *ls) override;
- int statfs(struct store_statfs_t *buf) override;
+ int statfs(struct store_statfs_t *buf,
+ osd_alert_list_t* alerts = nullptr) override;
int pool_statfs(uint64_t pool_id, struct store_statfs_t *buf) override;
int _do_transactions(
dout(10) << __func__ << " done" << dendl;
}
-int KStore::statfs(struct store_statfs_t* buf0)
+int KStore::statfs(struct store_statfs_t* buf0, osd_alert_list_t* alerts)
{
struct statfs buf;
buf0->reset();
+ if (alerts) {
+ alerts->clear(); // returns nothing for now
+ }
if (::statfs(basedir.c_str(), &buf) < 0) {
int r = -errno;
ceph_assert(r != -ENOENT);
void get_db_statistics(Formatter *f) override {
db->get_statistics(f);
}
- int statfs(struct store_statfs_t *buf) override;
+ int statfs(struct store_statfs_t *buf,
+ osd_alert_list_t* alerts = nullptr) override;
int pool_statfs(uint64_t pool_id, struct store_statfs_t *buf) override;
CollectionHandle open_collection(const coll_t& c) override;
return 0;
}
-int MemStore::statfs(struct store_statfs_t *st)
+int MemStore::statfs(struct store_statfs_t *st, osd_alert_list_t* alerts)
{
- dout(10) << __func__ << dendl;
+ dout(10) << __func__ << dendl;
+ if (alerts) {
+ alerts->clear(); // returns nothing for now
+ }
st->reset();
st->total = cct->_conf->memstore_device_bytes;
st->available = std::max<int64_t>(st->total - used_bytes, 0);
return 0;
}
- int statfs(struct store_statfs_t *buf) override;
+ int statfs(struct store_statfs_t *buf,
+ osd_alert_list_t* alerts = nullptr) override;
int pool_statfs(uint64_t pool_id, struct store_statfs_t *buf) override;
bool exists(CollectionHandle &c, const ghobject_t& oid) override;
// prime osd stats
{
struct store_statfs_t stbuf;
- int r = store->statfs(&stbuf);
+ osd_alert_list_t alerts;
+ int r = store->statfs(&stbuf, &alerts);
ceph_assert(r == 0);
service.set_statfs(stbuf);
}
snprintf(weight, sizeof(weight), "%.4lf", cct->_conf->osd_crush_initial_weight);
} else {
struct store_statfs_t st;
- int r = store->statfs(&st);
+ osd_alert_list_t alerts;
+ int r = store->statfs(&st, &alerts);
if (r < 0) {
derr << "statfs: " << cpp_strerror(r) << dendl;
return r;
// refresh osd stats
struct store_statfs_t stbuf;
- int r = store->statfs(&stbuf);
+ osd_alert_list_t alerts;
+ int r = store->statfs(&stbuf, &alerts);
ceph_assert(r == 0);
service.set_statfs(stbuf);
/// conver CEPH_OSD_ALLOC_HINT_FLAG_* op flags to a string
string ceph_osd_alloc_hint_flag_string(unsigned flags);
+typedef map<string,string> osd_alert_list_t;
/**
* osd request identifier