Merge tag 'ext4_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso...
[cascardo/linux.git] / fs / jbd2 / journal.c
index e3ca4b4..46261a6 100644 (file)
@@ -691,6 +691,7 @@ int jbd2_log_wait_commit(journal_t *journal, tid_t tid)
 {
        int err = 0;
 
+       jbd2_might_wait_for_commit(journal);
        read_lock(&journal->j_state_lock);
 #ifdef CONFIG_JBD2_DEBUG
        if (!tid_geq(journal->j_commit_request, tid)) {
@@ -1091,6 +1092,7 @@ static void jbd2_stats_proc_exit(journal_t *journal)
 
 static journal_t * journal_init_common (void)
 {
+       static struct lock_class_key jbd2_trans_commit_key;
        journal_t *journal;
        int err;
 
@@ -1126,6 +1128,9 @@ static journal_t * journal_init_common (void)
 
        spin_lock_init(&journal->j_history_lock);
 
+       lockdep_init_map(&journal->j_trans_commit_map, "jbd2_handle",
+                        &jbd2_trans_commit_key, 0);
+
        return journal;
 }
 
@@ -1346,15 +1351,15 @@ static int journal_reset(journal_t *journal)
        return jbd2_journal_start_thread(journal);
 }
 
-static int jbd2_write_superblock(journal_t *journal, int write_op)
+static int jbd2_write_superblock(journal_t *journal, int write_flags)
 {
        struct buffer_head *bh = journal->j_sb_buffer;
        journal_superblock_t *sb = journal->j_superblock;
        int ret;
 
-       trace_jbd2_write_superblock(journal, write_op);
+       trace_jbd2_write_superblock(journal, write_flags);
        if (!(journal->j_flags & JBD2_BARRIER))
-               write_op &= ~(REQ_FUA | REQ_FLUSH);
+               write_flags &= ~(REQ_FUA | REQ_PREFLUSH);
        lock_buffer(bh);
        if (buffer_write_io_error(bh)) {
                /*
@@ -1374,7 +1379,7 @@ static int jbd2_write_superblock(journal_t *journal, int write_op)
        jbd2_superblock_csum_set(journal, sb);
        get_bh(bh);
        bh->b_end_io = end_buffer_write_sync;
-       ret = submit_bh(write_op, bh);
+       ret = submit_bh(REQ_OP_WRITE, write_flags, bh);
        wait_on_buffer(bh);
        if (buffer_write_io_error(bh)) {
                clear_buffer_write_io_error(bh);
@@ -1498,7 +1503,7 @@ static int journal_get_superblock(journal_t *journal)
 
        J_ASSERT(bh != NULL);
        if (!buffer_uptodate(bh)) {
-               ll_rw_block(READ, 1, &bh);
+               ll_rw_block(REQ_OP_READ, 0, 1, &bh);
                wait_on_buffer(bh);
                if (!buffer_uptodate(bh)) {
                        printk(KERN_ERR