From 13474b089b4ba702a37b6ca3483eddd6fc72b8f2 Mon Sep 17 00:00:00 2001 From: Samuel Just Date: Tue, 9 Apr 2013 14:18:51 -0700 Subject: [PATCH] Journal: pass the sequence number to commit_start A subsequent patch will need to see the committing seq. Signed-off-by: Samuel Just --- src/os/FileJournal.cc | 2 +- src/os/FileJournal.h | 2 +- src/os/Journal.h | 2 +- src/os/JournalingObjectStore.cc | 5 +++-- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/os/FileJournal.cc b/src/os/FileJournal.cc index 29139c12bca..8986490e600 100644 --- a/src/os/FileJournal.cc +++ b/src/os/FileJournal.cc @@ -1480,7 +1480,7 @@ void FileJournal::pop_write() writeq.pop_front(); } -void FileJournal::commit_start() +void FileJournal::commit_start(uint64_t seq) { dout(10) << "commit_start" << dendl; diff --git a/src/os/FileJournal.h b/src/os/FileJournal.h index 0e826fb4940..38e32324dca 100644 --- a/src/os/FileJournal.h +++ b/src/os/FileJournal.h @@ -403,7 +403,7 @@ private: void make_writeable(); // writes - void commit_start(); + void commit_start(uint64_t seq); void committed_thru(uint64_t seq); bool should_commit_now() { return full_state != FULL_NOTFULL; diff --git a/src/os/Journal.h b/src/os/Journal.h index 8241edc783d..1d413bb4c53 100644 --- a/src/os/Journal.h +++ b/src/os/Journal.h @@ -60,7 +60,7 @@ public: virtual void submit_entry(uint64_t seq, bufferlist& e, int alignment, Context *oncommit, TrackedOpRef osd_op = TrackedOpRef()) = 0; - virtual void commit_start() = 0; + virtual void commit_start(uint64_t seq) = 0; virtual void committed_thru(uint64_t seq) = 0; /// Read next journal entry - asserts on invalid journal diff --git a/src/os/JournalingObjectStore.cc b/src/os/JournalingObjectStore.cc index e65f010443f..e662580ac42 100644 --- a/src/os/JournalingObjectStore.cc +++ b/src/os/JournalingObjectStore.cc @@ -177,6 +177,7 @@ bool JournalingObjectStore::ApplyManager::commit_start() { bool ret = false; + uint64_t _committing_seq = 0; { Mutex::Locker l(apply_lock); dout(10) << "commit_start max_applied_seq " << max_applied_seq @@ -198,7 +199,7 @@ bool JournalingObjectStore::ApplyManager::commit_start() goto out; } - committing_seq = max_applied_seq; + _committing_seq = committing_seq = max_applied_seq; dout(10) << "commit_start committing " << committing_seq << ", still blocked" << dendl; @@ -208,7 +209,7 @@ bool JournalingObjectStore::ApplyManager::commit_start() out: if (journal) - journal->commit_start(); // tell the journal too + journal->commit_start(_committing_seq); // tell the journal too return ret; }