From: Theodore Ts'o <tytso@mit.edu>
To: Dmitry Monakhov <dmonakhov@openvz.org>
Cc: linux-ext4@vger.kernel.org, jack@suse.cz
Subject: Re: [PATCH 2/2] ext4: optimize ext4_force_commit
Date: Mon, 1 Apr 2013 14:58:38 -0400 [thread overview]
Message-ID: <20130401185838.GC22443@thunk.org> (raw)
In-Reply-To: <1364807037-21664-2-git-send-email-dmonakhov@openvz.org>
On Mon, Apr 01, 2013 at 01:03:57PM +0400, Dmitry Monakhov wrote:
> diff --git a/fs/ext4/super.c b/fs/ext4/super.c
> index e3e6a06..280a918 100644
> --- a/fs/ext4/super.c
> +++ b/fs/ext4/super.c
> @@ -4436,13 +4436,14 @@ static void ext4_clear_journal_err(struct super_block *sb,
> */
> int ext4_force_commit(struct super_block *sb)
> {
> - journal_t *journal;
> + tid_t target;
>
> if (sb->s_flags & MS_RDONLY)
> return 0;
>
> - journal = EXT4_SB(sb)->s_journal;
> - return ext4_journal_force_commit(journal);
> + if (jbd2_journal_start_commit(EXT4_SB(sb)->s_journal, &target))
> + return jbd2_log_wait_commit(EXT4_SB(sb)->s_journal, target);
EXT4_SB(sb)->s_journal is NULL in no-journal mode. So you need to
check for this --- this is something which is done in
ext4_journal_force_commit().
Since this is the only user of ext4_journal_force_commit(), you might
as well get rid of ext4_journal_force_commit() as part of making this
change.
The other possibility is we perhaps we should just change
jbd2_journal_force_commit() to call jbd2_journal_start_commit() and
jbd2_log_wait_commit(); the only other caller of
jbd2_journal_force_commit() is ocfs2_sync_file(), and it would benefit
from this change as well.
- Ted
next prev parent reply other threads:[~2013-04-01 18:58 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
[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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20130401185838.GC22443@thunk.org \
--to=tytso@mit.edu \
--cc=dmonakhov@openvz.org \
--cc=jack@suse.cz \
--cc=linux-ext4@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.