aboutsummaryrefslogtreecommitdiffstats
path: root/fs/jbd2/commit.c
diff options
context:
space:
mode:
authorJan Kara <jack@suse.cz>2010-08-18 09:56:56 -0400
committerJens Axboe <jaxboe@fusionio.com>2010-09-10 06:35:39 -0400
commitf73bee49855fe968e87af18e44f2d17e1e675e74 (patch)
treeb8c4bc3ac8fcc6c2ef066bf641e70b7522392c12 /fs/jbd2/commit.c
parent4524451ef7e88c64a868a8f5a0b49bda73beb2a3 (diff)
jbd2: Modify ASYNC_COMMIT code to not rely on queue draining on barrier
Currently JBD2 relies blkdev_issue_flush() draining the queue when ASYNC_COMMIT feature is set. This property is going away so make JBD2 wait for buffers it needs on its own before submitting the cache flush. Signed-off-by: Jan Kara <jack@suse.cz> Signed-off-by: Tejun Heo <tj@kernel.org> Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
Diffstat (limited to 'fs/jbd2/commit.c')
-rw-r--r--fs/jbd2/commit.c29
1 files changed, 16 insertions, 13 deletions
diff --git a/fs/jbd2/commit.c b/fs/jbd2/commit.c
index 7c068c189d80..d6aeb1f6cfe0 100644
--- a/fs/jbd2/commit.c
+++ b/fs/jbd2/commit.c
@@ -701,6 +701,16 @@ start_journal_io:
701 } 701 }
702 } 702 }
703 703
704 err = journal_finish_inode_data_buffers(journal, commit_transaction);
705 if (err) {
706 printk(KERN_WARNING
707 "JBD2: Detected IO errors while flushing file data "
708 "on %s\n", journal->j_devname);
709 if (journal->j_flags & JBD2_ABORT_ON_SYNCDATA_ERR)
710 jbd2_journal_abort(journal, err);
711 err = 0;
712 }
713
704 /* 714 /*
705 * If the journal is not located on the file system device, 715 * If the journal is not located on the file system device,
706 * then we must flush the file system device before we issue 716 * then we must flush the file system device before we issue
@@ -719,19 +729,6 @@ start_journal_io:
719 &cbh, crc32_sum); 729 &cbh, crc32_sum);
720 if (err) 730 if (err)
721 __jbd2_journal_abort_hard(journal); 731 __jbd2_journal_abort_hard(journal);
722 if (journal->j_flags & JBD2_BARRIER)
723 blkdev_issue_flush(journal->j_dev, GFP_KERNEL, NULL,
724 BLKDEV_IFL_WAIT);
725 }
726
727 err = journal_finish_inode_data_buffers(journal, commit_transaction);
728 if (err) {
729 printk(KERN_WARNING
730 "JBD2: Detected IO errors while flushing file data "
731 "on %s\n", journal->j_devname);
732 if (journal->j_flags & JBD2_ABORT_ON_SYNCDATA_ERR)
733 jbd2_journal_abort(journal, err);
734 err = 0;
735 } 732 }
736 733
737 /* Lo and behold: we have just managed to send a transaction to 734 /* Lo and behold: we have just managed to send a transaction to
@@ -845,6 +842,12 @@ wait_for_iobuf:
845 } 842 }
846 if (!err && !is_journal_aborted(journal)) 843 if (!err && !is_journal_aborted(journal))
847 err = journal_wait_on_commit_record(journal, cbh); 844 err = journal_wait_on_commit_record(journal, cbh);
845 if (JBD2_HAS_INCOMPAT_FEATURE(journal,
846 JBD2_FEATURE_INCOMPAT_ASYNC_COMMIT) &&
847 journal->j_flags & JBD2_BARRIER) {
848 blkdev_issue_flush(journal->j_dev, GFP_KERNEL, NULL,
849 BLKDEV_IFL_WAIT);
850 }
848 851
849 if (err) 852 if (err)
850 jbd2_journal_abort(journal, err); 853 jbd2_journal_abort(journal, err);