template <typename T>
class AsyncReserver {
Finisher *f;
- const unsigned max_allowed;
+ unsigned max_allowed;
Mutex lock;
list<pair<T, Context*> > queue;
unsigned max_allowed)
: f(f), max_allowed(max_allowed), lock("AsyncReserver::lock") {}
+ void set_max(unsigned max) {
+ Mutex::Locker l(lock);
+ assert(max > 0);
+ max_allowed = max;
+ do_queues();
+ }
+
/**
* Requests a reservation
*
const char** OSD::get_tracked_conf_keys() const
{
static const char* KEYS[] = {
+ "osd_max_backfills",
NULL
};
return KEYS;
void OSD::handle_conf_change(const struct md_config_t *conf,
const std::set <std::string> &changed)
{
+ if (changed.count("osd_max_backfills")) {
+ service.local_reserver.set_max(g_conf->osd_max_backfills);
+ service.remote_reserver.set_max(g_conf->osd_max_backfills);
+ }
}
// --------------------------------