diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-03-24 13:16:26 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-03-24 13:16:26 -0400 |
commit | 6c5103890057b1bb781b26b7aae38d33e4c517d8 (patch) | |
tree | e6e57961dcddcb5841acb34956e70b9dc696a880 /fs/jbd2 | |
parent | 3dab04e6978e358ad2307bca563fabd6c5d2c58b (diff) | |
parent | 9d2e157d970a73b3f270b631828e03eb452d525e (diff) |
Merge branch 'for-2.6.39/core' of git://git.kernel.dk/linux-2.6-block
* 'for-2.6.39/core' of git://git.kernel.dk/linux-2.6-block: (65 commits)
Documentation/iostats.txt: bit-size reference etc.
cfq-iosched: removing unnecessary think time checking
cfq-iosched: Don't clear queue stats when preempt.
blk-throttle: Reset group slice when limits are changed
blk-cgroup: Only give unaccounted_time under debug
cfq-iosched: Don't set active queue in preempt
block: fix non-atomic access to genhd inflight structures
block: attempt to merge with existing requests on plug flush
block: NULL dereference on error path in __blkdev_get()
cfq-iosched: Don't update group weights when on service tree
fs: assign sb->s_bdi to default_backing_dev_info if the bdi is going away
block: Require subsystems to explicitly allocate bio_set integrity mempool
jbd2: finish conversion from WRITE_SYNC_PLUG to WRITE_SYNC and explicit plugging
jbd: finish conversion from WRITE_SYNC_PLUG to WRITE_SYNC and explicit plugging
fs: make fsync_buffers_list() plug
mm: make generic_writepages() use plugging
blk-cgroup: Add unaccounted time to timeslice_used.
block: fixup plugging stubs for !CONFIG_BLOCK
block: remove obsolete comments for blkdev_issue_zeroout.
blktrace: Use rq->cmd_flags directly in blk_add_trace_rq.
...
Fix up conflicts in fs/{aio.c,super.c}
Diffstat (limited to 'fs/jbd2')
-rw-r--r-- | fs/jbd2/commit.c | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/fs/jbd2/commit.c b/fs/jbd2/commit.c index f3ad1598b201..fa36d7662b21 100644 --- a/fs/jbd2/commit.c +++ b/fs/jbd2/commit.c | |||
@@ -137,9 +137,9 @@ static int journal_submit_commit_record(journal_t *journal, | |||
137 | if (journal->j_flags & JBD2_BARRIER && | 137 | if (journal->j_flags & JBD2_BARRIER && |
138 | !JBD2_HAS_INCOMPAT_FEATURE(journal, | 138 | !JBD2_HAS_INCOMPAT_FEATURE(journal, |
139 | JBD2_FEATURE_INCOMPAT_ASYNC_COMMIT)) | 139 | JBD2_FEATURE_INCOMPAT_ASYNC_COMMIT)) |
140 | ret = submit_bh(WRITE_SYNC_PLUG | WRITE_FLUSH_FUA, bh); | 140 | ret = submit_bh(WRITE_SYNC | WRITE_FLUSH_FUA, bh); |
141 | else | 141 | else |
142 | ret = submit_bh(WRITE_SYNC_PLUG, bh); | 142 | ret = submit_bh(WRITE_SYNC, bh); |
143 | 143 | ||
144 | *cbh = bh; | 144 | *cbh = bh; |
145 | return ret; | 145 | return ret; |
@@ -329,7 +329,7 @@ void jbd2_journal_commit_transaction(journal_t *journal) | |||
329 | int tag_bytes = journal_tag_bytes(journal); | 329 | int tag_bytes = journal_tag_bytes(journal); |
330 | struct buffer_head *cbh = NULL; /* For transactional checksums */ | 330 | struct buffer_head *cbh = NULL; /* For transactional checksums */ |
331 | __u32 crc32_sum = ~0; | 331 | __u32 crc32_sum = ~0; |
332 | int write_op = WRITE_SYNC; | 332 | struct blk_plug plug; |
333 | 333 | ||
334 | /* | 334 | /* |
335 | * First job: lock down the current transaction and wait for | 335 | * First job: lock down the current transaction and wait for |
@@ -363,13 +363,6 @@ void jbd2_journal_commit_transaction(journal_t *journal) | |||
363 | write_lock(&journal->j_state_lock); | 363 | write_lock(&journal->j_state_lock); |
364 | commit_transaction->t_state = T_LOCKED; | 364 | commit_transaction->t_state = T_LOCKED; |
365 | 365 | ||
366 | /* | ||
367 | * Use plugged writes here, since we want to submit several before | ||
368 | * we unplug the device. We don't do explicit unplugging in here, | ||
369 | * instead we rely on sync_buffer() doing the unplug for us. | ||
370 | */ | ||
371 | if (commit_transaction->t_synchronous_commit) | ||
372 | write_op = WRITE_SYNC_PLUG; | ||
373 | trace_jbd2_commit_locking(journal, commit_transaction); | 366 | trace_jbd2_commit_locking(journal, commit_transaction); |
374 | stats.run.rs_wait = commit_transaction->t_max_wait; | 367 | stats.run.rs_wait = commit_transaction->t_max_wait; |
375 | stats.run.rs_locked = jiffies; | 368 | stats.run.rs_locked = jiffies; |
@@ -469,8 +462,10 @@ void jbd2_journal_commit_transaction(journal_t *journal) | |||
469 | if (err) | 462 | if (err) |
470 | jbd2_journal_abort(journal, err); | 463 | jbd2_journal_abort(journal, err); |
471 | 464 | ||
465 | blk_start_plug(&plug); | ||
472 | jbd2_journal_write_revoke_records(journal, commit_transaction, | 466 | jbd2_journal_write_revoke_records(journal, commit_transaction, |
473 | write_op); | 467 | WRITE_SYNC); |
468 | blk_finish_plug(&plug); | ||
474 | 469 | ||
475 | jbd_debug(3, "JBD: commit phase 2\n"); | 470 | jbd_debug(3, "JBD: commit phase 2\n"); |
476 | 471 | ||
@@ -497,6 +492,7 @@ void jbd2_journal_commit_transaction(journal_t *journal) | |||
497 | err = 0; | 492 | err = 0; |
498 | descriptor = NULL; | 493 | descriptor = NULL; |
499 | bufs = 0; | 494 | bufs = 0; |
495 | blk_start_plug(&plug); | ||
500 | while (commit_transaction->t_buffers) { | 496 | while (commit_transaction->t_buffers) { |
501 | 497 | ||
502 | /* Find the next buffer to be journaled... */ | 498 | /* Find the next buffer to be journaled... */ |
@@ -658,7 +654,7 @@ start_journal_io: | |||
658 | clear_buffer_dirty(bh); | 654 | clear_buffer_dirty(bh); |
659 | set_buffer_uptodate(bh); | 655 | set_buffer_uptodate(bh); |
660 | bh->b_end_io = journal_end_buffer_io_sync; | 656 | bh->b_end_io = journal_end_buffer_io_sync; |
661 | submit_bh(write_op, bh); | 657 | submit_bh(WRITE_SYNC, bh); |
662 | } | 658 | } |
663 | cond_resched(); | 659 | cond_resched(); |
664 | stats.run.rs_blocks_logged += bufs; | 660 | stats.run.rs_blocks_logged += bufs; |
@@ -699,6 +695,8 @@ start_journal_io: | |||
699 | __jbd2_journal_abort_hard(journal); | 695 | __jbd2_journal_abort_hard(journal); |
700 | } | 696 | } |
701 | 697 | ||
698 | blk_finish_plug(&plug); | ||
699 | |||
702 | /* Lo and behold: we have just managed to send a transaction to | 700 | /* Lo and behold: we have just managed to send a transaction to |
703 | the log. Before we can commit it, wait for the IO so far to | 701 | the log. Before we can commit it, wait for the IO so far to |
704 | complete. Control buffers being written are on the | 702 | complete. Control buffers being written are on the |