if (!base->is_waiting_for_dir(approx_fg) || !onfinish) {
discover_info_t& d = _create_discover(from);
+ d.pin_base(base);
d.ino = base->ino();
d.frag = approx_fg;
d.want_base_dir = true;
!base->is_waiting_for_dir(fg) || !onfinish) {
discover_info_t& d = _create_discover(from);
d.ino = base->ino();
+ d.pin_base(base);
d.frag = fg;
d.snap = snap;
d.want_path = want_path;
!base->is_waiting_for_dentry(want_path[0].c_str(), snap) || !onfinish) {
discover_info_t& d = _create_discover(from);
d.ino = base->ino();
+ d.pin_base(base);
d.frag = base->get_frag();
d.snap = snap;
d.want_path = want_path;
frag_t frag;
snapid_t snap;
filepath want_path;
+ MDSCacheObject *base;
bool want_base_dir;
bool want_xlocked;
- discover_info_t() : tid(0), mds(-1), snap(CEPH_NOSNAP), want_base_dir(false), want_xlocked(false) {}
+ discover_info_t() :
+ tid(0), mds(-1), snap(CEPH_NOSNAP), base(NULL),
+ want_base_dir(false), want_xlocked(false) {}
+ ~discover_info_t() {
+ if (base)
+ base->put(MDSCacheObject::PIN_DISCOVERBASE);
+ }
+ void pin_base(MDSCacheObject *b) {
+ base = b;
+ base->get(MDSCacheObject::PIN_DISCOVERBASE);
+ }
};
map<ceph_tid_t, discover_info_t> discovers;
static const int PIN_PTRWAITER = -1007;
const static int PIN_TEMPEXPORTING = 1008; // temp pin between encode_ and finish_export
static const int PIN_CLIENTLEASE = 1009;
+ static const int PIN_DISCOVERBASE = 1010;
const char *generic_pin_name(int p) const {
switch (p) {
case PIN_PTRWAITER: return "ptrwaiter";
case PIN_TEMPEXPORTING: return "tempexporting";
case PIN_CLIENTLEASE: return "clientlease";
+ case PIN_DISCOVERBASE: return "discoverbase";
default: ceph_abort(); return 0;
}
}