linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] ext3: optimize ext3_force_commit
@ 2013-04-01  9:03 Dmitry Monakhov
  2013-04-01  9:03 ` [PATCH 2/2] ext4: optimize ext4_force_commit Dmitry Monakhov
  2013-04-02 13:20 ` [PATCH 1/2] ext3: optimize ext3_force_commit Jan Kara
  0 siblings, 2 replies; 6+ messages in thread
From: Dmitry Monakhov @ 2013-04-01  9:03 UTC (permalink / raw)
  To: linux-ext4; +Cc: tytso, jack, Dmitry Monakhov

We do not have to use journal_force_commit() because it explicitly
start and stop SYNC transaction. This is very suboptimal because the only
users of ext3_force_commit() are ext3_sync_file and ext3_write_inode().
Both functions just want to commit and wait any uncommitted transaction
similar to ext3_sync_fs().

Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
---
 fs/ext3/super.c |   11 +++++------
 1 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/fs/ext3/super.c b/fs/ext3/super.c
index fb5120a..1853031 100644
--- a/fs/ext3/super.c
+++ b/fs/ext3/super.c
@@ -2507,15 +2507,14 @@ static void ext3_clear_journal_err(struct super_block *sb,
  */
 int ext3_force_commit(struct super_block *sb)
 {
-	journal_t *journal;
-	int ret;
+	tid_t target;
 
 	if (sb->s_flags & MS_RDONLY)
 		return 0;
 
-	journal = EXT3_SB(sb)->s_journal;
-	ret = ext3_journal_force_commit(journal);
-	return ret;
+	if (journal_start_commit(EXT3_SB(sb)->s_journal, &target))
+		return log_wait_commit(EXT3_SB(sb)->s_journal, target);
+	return 0;
 }
 
 static int ext3_sync_fs(struct super_block *sb, int wait)
@@ -2530,7 +2529,7 @@ static int ext3_sync_fs(struct super_block *sb, int wait)
 	dquot_writeback_dquots(sb, -1);
 	if (journal_start_commit(EXT3_SB(sb)->s_journal, &target)) {
 		if (wait)
-			log_wait_commit(EXT3_SB(sb)->s_journal, target);
+			return log_wait_commit(EXT3_SB(sb)->s_journal, target);
 	}
 	return 0;
 }
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-04-09 14:37 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-01  9:03 [PATCH 1/2] ext3: optimize ext3_force_commit Dmitry Monakhov
2013-04-01  9:03 ` [PATCH 2/2] ext4: optimize ext4_force_commit Dmitry Monakhov
2013-04-01 18:58   ` Theodore Ts'o
     [not found]     ` <CAF5pi0FZ4MUdBMH9A_Wav8V7TX39z1cOtGspJP9k8LN0KFja7g@mail.gmail.com>
     [not found]       ` <20130409133123.GE12050@thunk.org>
     [not found]         ` <CAF5pi0GhudB=BmBNGPAp4KLvfuAiw_2zo5bzYVWQ3jhthsj3Xw@mail.gmail.com>
2013-04-09 14:06           ` Dmitry Monakhov
2013-04-09 14:36             ` Jan Kara
2013-04-02 13:20 ` [PATCH 1/2] ext3: optimize ext3_force_commit Jan Kara

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).