diff options
author | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2011-03-25 11:41:20 -0400 |
---|---|---|
committer | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2011-03-25 11:41:20 -0400 |
commit | 7bf7e370d5919112c223a269462cd0b546903829 (patch) | |
tree | 03ccc715239df14ae168277dbccc9d9cf4d8a2c8 /fs/jbd2/commit.c | |
parent | 68b1a1e786f29c900fa1c516a402e24f0ece622a (diff) | |
parent | d39dd11c3e6a7af5c20bfac40594db36cf270f42 (diff) |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6 into for-linus-1
* 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6: (9356 commits)
[media] rc: update for bitop name changes
fs: simplify iget & friends
fs: pull inode->i_lock up out of writeback_single_inode
fs: rename inode_lock to inode_hash_lock
fs: move i_wb_list out from under inode_lock
fs: move i_sb_list out from under inode_lock
fs: remove inode_lock from iput_final and prune_icache
fs: Lock the inode LRU list separately
fs: factor inode disposal
fs: protect inode->i_state with inode->i_lock
lib, arch: add filter argument to show_mem and fix private implementations
SLUB: Write to per cpu data when allocating it
slub: Fix debugobjects with lockless fastpath
autofs4: Do not potentially dereference NULL pointer returned by fget() in autofs_dev_ioctl_setpipefd()
autofs4 - remove autofs4_lock
autofs4 - fix d_manage() return on rcu-walk
autofs4 - fix autofs4_expire_indirect() traversal
autofs4 - fix dentry leak in autofs4_expire_direct()
autofs4 - reinstate last used update on access
vfs - check non-mountpoint dentry might block in __follow_mount_rcu()
...
NOTE!
This merge commit was created to fix compilation error. The block
tree was merged upstream and removed the 'elv_queue_empty()'
function which the new 'mtdswap' driver is using. So a simple
merge of the mtd tree with upstream does not compile. And the
mtd tree has already be published, so re-basing it is not an option.
To fix this unfortunate situation, I had to merge upstream into the
mtd-2.6.git tree without committing, put the fixup patch on top of
this, and then commit this. The result is that we do not have commits
which do not compile.
In other words, this merge commit "merges" 3 things: the MTD tree, the
upstream tree, and the fixup patch.
Diffstat (limited to 'fs/jbd2/commit.c')
-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 |