getgroups_cb_handle(NULL),
async_ino_invalidator(m->cct),
async_dentry_invalidator(m->cct),
+ interrupt_finisher(m->cct),
objecter_finisher(m->cct),
tick_event(NULL),
monclient(mc), messenger(m), whoami(m->get_myname().num()),
async_dentry_invalidator.stop();
}
+ if (switch_interrupt_cb) {
+ ldout(cct, 10) << "shutdown stopping interrupt finisher" << dendl;
+ interrupt_finisher.wait_for_empty();
+ interrupt_finisher.stop();
+ }
+
objectcacher->stop(); // outside of client_lock! this does a join.
client_lock.Lock();
if (cb == NULL)
return;
switch_interrupt_cb = cb;
+ interrupt_finisher.start();
}
void Client::ll_register_getgroups_cb(client_getgroups_callback_t cb, void *handle)
return _flock(fh, cmd, owner, fuse_req);
}
+class C_Client_RequestInterrupt : public Context {
+private:
+ Client *client;
+ MetaRequest *req;
+public:
+ C_Client_RequestInterrupt(Client *c, MetaRequest *r) : client(c), req(r) {
+ req->get();
+ }
+ void finish(int r) {
+ Mutex::Locker l(client->client_lock);
+ assert(req->head.op == CEPH_MDS_OP_SETFILELOCK);
+ client->_interrupt_filelock(req);
+ client->put_request(req);
+ }
+};
+
void Client::ll_interrupt(void *d)
{
- Mutex::Locker lock(client_lock);
-
MetaRequest *req = static_cast<MetaRequest*>(d);
ldout(cct, 3) << "ll_interrupt tid " << req->get_tid() << dendl;
tout(cct) << "ll_interrupt tid " << req->get_tid() << std::endl;
-
- assert(req->head.op == CEPH_MDS_OP_SETFILELOCK);
- _interrupt_filelock(req);
+ interrupt_finisher.queue(new C_Client_RequestInterrupt(this, req));
}
// =========================================
Finisher async_ino_invalidator;
Finisher async_dentry_invalidator;
+ Finisher interrupt_finisher;
Finisher objecter_finisher;
Context *tick_event;
friend class C_Block_Sync; // Calls block map and protected helpers
friend class C_C_Tick; // Asserts on client_lock
friend class C_Client_SyncCommit; // Asserts on client_lock
+ friend class C_Client_RequestInterrupt;
//int get_cache_size() { return lru.lru_get_size(); }
//void set_cache_size(int m) { lru.lru_set_max(m); }