From: Sage Weil Date: Fri, 1 May 2015 16:22:01 +0000 (-0700) Subject: Merge branch 'wip-journal-header' of git://github.com/XinzeChi/ceph X-Git-Tag: v9.0.1~35 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=8d596bfa24c9c3e2aadbb87494284cb5fd824e55;p=ceph.git Merge branch 'wip-journal-header' of git://github.com/XinzeChi/ceph Conflicts: src/gmock --- 8d596bfa24c9c3e2aadbb87494284cb5fd824e55 diff --cc src/os/FileJournal.cc index c6bb6f2c0755,1b04d8e27f67..7e84e05a29fa --- a/src/os/FileJournal.cc +++ b/src/os/FileJournal.cc @@@ -648,7 -648,11 +648,10 @@@ void FileJournal::stop_writer( commit_cond.Signal(); } write_thread.join(); - - // write jouranl header right now, so that - // committed_up_to in journal header is newer enough. - write_header(); + ++ // write journal header now so that we have less to replay on remount ++ write_header_sync(); + #ifdef HAVE_LIBAIO // stop aio completeion thread *after* writer thread has stopped // and has submitted all of its io @@@ -733,7 -737,14 +736,14 @@@ bufferptr FileJournal::prepare_header( return bp; } - -void FileJournal::write_header() ++void FileJournal::write_header_sync() + { + Mutex::Locker locker(write_lock); + must_write_header = true; + bufferlist bl; + do_write(bl); + dout(20) << __func__ << " finish" << dendl; + } int FileJournal::check_for_full(uint64_t seq, off64_t pos, off64_t size) { diff --cc src/os/FileJournal.h index 574c902a68bb,8aa04a9d93ac..430f773c83d8 --- a/src/os/FileJournal.h +++ b/src/os/FileJournal.h @@@ -414,6 -414,8 +414,8 @@@ private return full_state != FULL_NOTFULL && !write_stop; } - void write_header(); ++ void write_header_sync(); + void set_wait_on_full(bool b) { wait_on_full = b; } // reads