stray_index = (stray_index+1)%NUM_STRAY;
}
+ void activate_stray_manager() {
+ stray_manager.activate();
+ }
+
/**
* Call this when you know that a CDentry is ready to be passed
* on to StrayManager (i.e. this is a stray you've just created)
mdcache->start_files_to_recover();
mdcache->reissue_all_caps();
+ mdcache->activate_stray_manager();
finish_contexts(g_ceph_context, waiting_for_active); // kick waiters
}
{
const int files_avail = g_conf->mds_max_purge_files - files_purging;
+ if (!started) {
+ dout(20) << __func__ << ": haven't started purging yet" << dendl;
+ return false;
+ }
+
if (files_avail <= 0) {
dout(20) << __func__ << ": throttling on max files" << dendl;
return false;
}
}
+void StrayManager::activate()
+{
+ dout(10) << __func__ << dendl;
+ started = true;
+ _advance();
+}
+
bool StrayManager::eval_stray(CDentry *dn, bool delay)
{
// avoid nested eval_stray
StrayManager::StrayManager(MDSRank *mds)
: delayed_eval_stray(member_offset(CDentry, item_stray)),
- mds(mds), logger(NULL),
+ mds(mds), logger(NULL), started(false),
ops_in_flight(0), files_purging(0),
max_purge_ops(0),
num_strays(0), num_strays_purging(0), num_strays_delayed(0),
MDSRank *mds;
PerfCounters *logger;
+ bool started;
+
// Throttled allowances
uint64_t ops_in_flight;
uint64_t files_purging;
public:
explicit StrayManager(MDSRank *mds);
void set_logger(PerfCounters *l) {logger = l;}
+ void activate();
bool eval_stray(CDentry *dn, bool delay=false);