We need to wake up the sync thread (duh).
Also, we need to obey the FileJournal::lock -> journal_lock locking
order.
Also, lockdep is broken. :(
Signed-off-by: Sage Weil <sage@newdream.net>
dout(10) << "start_sync" << dendl;
}
+void FileStore::trigger_commit(uint64_t seq)
+{
+ /*
+ * crib the lock -> journal_lock. we need to start the sync under lock,
+ * but once we release lock it will block because journal_lock is held.
+ * _trigger_commit() expects journal_lock to be held by the caller.
+ */
+ lock.Lock();
+ dout(10) << "trigger_commit seq" << dendl;
+ force_sync = true;
+ sync_cond.Signal();
+ journal_lock.Lock();
+ lock.Unlock();
+ _trigger_commit(seq);
+ journal_lock.Unlock();
+}
+
void FileStore::sync()
{
Mutex l("FileStore::sync");
}
} sync_thread;
+ void trigger_commit(uint64_t);
+
void sync_fs(); // actuall sync underlying fs
// -- op workqueue --
* an open_ops reference. it should block only long enough for the
* commit to _start_ waiting for open_ops, but not longer or else we
* will deadlock.
+ *
+ * caller must hold journal_lock.
*/
-void JournalingObjectStore::trigger_commit(uint64_t seq)
+void JournalingObjectStore::_trigger_commit(uint64_t seq)
{
+ assert(journal_lock.is_locked());
dout(10) << "trigger_commit " << seq << dendl;
- journal_lock.Lock();
force_commit = true;
while (!blocked && committing_seq < seq) {
dout(20) << "trigger_commit not blocked and seq " << seq << " > committing " << committing_seq << dendl;
cond.Wait(journal_lock);
}
dout(10) << "trigger_commit triggered, will commit something >= " << seq << dendl;
- journal_lock.Unlock();
}
bool JournalingObjectStore::commit_start()
void journal_stop();
int journal_replay(uint64_t fs_op_seq);
- void trigger_commit(uint64_t op_seq);
+ virtual void trigger_commit(uint64_t op_seq) = 0;
+ void _trigger_commit(uint64_t op_seq);
// --
uint64_t op_submit_start();