From 5f64dda832d5aadf16da45d0f58c204ad08753d2 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Mon, 6 Apr 2009 14:48:05 +0200 Subject: [PATCH] --- yaml --- r: 142031 b: refs/heads/master c: 4194b1eaf18ddc3eee9597e8800b6d2ffdfd3614 h: refs/heads/master i: 142029: db2cdb340013b15a95a53bc1a4a4dcb81d0145c9 142027: 94dc61a7fb7139426c12e5bec9eeff26b3fc5ade 142023: ce9c7d10ca8645904c7273af406412496f4cd7de 142015: ecf7718ece657a0e08e7d6789d31b8fe0df2375c v: v3 --- [refs] | 2 +- trunk/fs/jbd2/commit.c | 13 +++++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/[refs] b/[refs] index 189a64b81204..c3dfe480df2b 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 6c4bac6b3351fd278dc3537dae42f88f733ff12e +refs/heads/master: 4194b1eaf18ddc3eee9597e8800b6d2ffdfd3614 diff --git a/trunk/fs/jbd2/commit.c b/trunk/fs/jbd2/commit.c index 4ea72377c7a2..073c8c3df7cd 100644 --- a/trunk/fs/jbd2/commit.c +++ b/trunk/fs/jbd2/commit.c @@ -138,7 +138,7 @@ static int journal_submit_commit_record(journal_t *journal, set_buffer_ordered(bh); barrier_done = 1; } - ret = submit_bh(WRITE_SYNC, bh); + ret = submit_bh(WRITE_SYNC_PLUG, bh); if (barrier_done) clear_buffer_ordered(bh); @@ -159,7 +159,7 @@ static int journal_submit_commit_record(journal_t *journal, lock_buffer(bh); set_buffer_uptodate(bh); clear_buffer_dirty(bh); - ret = submit_bh(WRITE_SYNC, bh); + ret = submit_bh(WRITE_SYNC_PLUG, bh); } *cbh = bh; return ret; @@ -190,7 +190,7 @@ static int journal_wait_on_commit_record(journal_t *journal, set_buffer_uptodate(bh); bh->b_end_io = journal_end_buffer_io_sync; - ret = submit_bh(WRITE_SYNC, bh); + ret = submit_bh(WRITE_SYNC_PLUG, bh); if (ret) { unlock_buffer(bh); return ret; @@ -402,8 +402,13 @@ void jbd2_journal_commit_transaction(journal_t *journal) spin_lock(&journal->j_state_lock); commit_transaction->t_state = T_LOCKED; + /* + * Use plugged writes here, since we want to submit several before + * we unplug the device. We don't do explicit unplugging in here, + * instead we rely on sync_buffer() doing the unplug for us. + */ if (commit_transaction->t_synchronous_commit) - write_op = WRITE_SYNC; + write_op = WRITE_SYNC_PLUG; stats.u.run.rs_wait = commit_transaction->t_max_wait; stats.u.run.rs_locked = jiffies; stats.u.run.rs_running = jbd2_time_diff(commit_transaction->t_start,