From: Jan Kara <jack@suse.cz>
To: Kemeng Shi <shikemeng@huaweicloud.com>
Cc: tytso@mit.edu, jack@suse.com, yi.zhang@huaweicloud.com,
linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 2/9] jbd2: remove unused return info from jbd2_journal_write_metadata_buffer
Date: Wed, 15 May 2024 01:41:01 +0200 [thread overview]
Message-ID: <20240514234101.2ke6hq4xwitwk7a5@quack3> (raw)
In-Reply-To: <20240514112438.1269037-3-shikemeng@huaweicloud.com>
On Tue 14-05-24 19:24:31, Kemeng Shi wrote:
> The done_copy_out info from jbd2_journal_write_metadata_buffer is not
> used. Simply remove it.
>
> Signed-off-by: Kemeng Shi <shikemeng@huaweicloud.com>
Looks good. Feel free to add:
Reviewed-by: Jan Kara <jack@suse.cz>
Honza
> ---
> fs/jbd2/commit.c | 10 +++++-----
> fs/jbd2/journal.c | 9 +++------
> 2 files changed, 8 insertions(+), 11 deletions(-)
>
> diff --git a/fs/jbd2/commit.c b/fs/jbd2/commit.c
> index 5e122586e06e..67077308b56b 100644
> --- a/fs/jbd2/commit.c
> +++ b/fs/jbd2/commit.c
> @@ -353,7 +353,7 @@ void jbd2_journal_commit_transaction(journal_t *journal)
> struct buffer_head *descriptor;
> struct buffer_head **wbuf = journal->j_wbuf;
> int bufs;
> - int flags;
> + int escape;
> int err;
> unsigned long long blocknr;
> ktime_t start_time;
> @@ -661,10 +661,10 @@ void jbd2_journal_commit_transaction(journal_t *journal)
> */
> set_bit(BH_JWrite, &jh2bh(jh)->b_state);
> JBUFFER_TRACE(jh, "ph3: write metadata");
> - flags = jbd2_journal_write_metadata_buffer(commit_transaction,
> + escape = jbd2_journal_write_metadata_buffer(commit_transaction,
> jh, &wbuf[bufs], blocknr);
> - if (flags < 0) {
> - jbd2_journal_abort(journal, flags);
> + if (escape < 0) {
> + jbd2_journal_abort(journal, escape);
> continue;
> }
> jbd2_file_log_bh(&io_bufs, wbuf[bufs]);
> @@ -673,7 +673,7 @@ void jbd2_journal_commit_transaction(journal_t *journal)
> buffer */
>
> tag_flag = 0;
> - if (flags & 1)
> + if (escape)
> tag_flag |= JBD2_FLAG_ESCAPE;
> if (!first_tag)
> tag_flag |= JBD2_FLAG_SAME_UUID;
> diff --git a/fs/jbd2/journal.c b/fs/jbd2/journal.c
> index 207b24e12ce9..2dca2f613a8e 100644
> --- a/fs/jbd2/journal.c
> +++ b/fs/jbd2/journal.c
> @@ -316,11 +316,8 @@ static void journal_kill_thread(journal_t *journal)
> *
> * Return value:
> * <0: Error
> - * >=0: Finished OK
> - *
> - * On success:
> - * Bit 0 set == escape performed on the data
> - * Bit 1 set == buffer copy-out performed (kfree the data after IO)
> + * =0: Finished OK without escape
> + * =1: Finished OK with escape
> */
>
> int jbd2_journal_write_metadata_buffer(transaction_t *transaction,
> @@ -455,7 +452,7 @@ int jbd2_journal_write_metadata_buffer(transaction_t *transaction,
> set_buffer_shadow(bh_in);
> spin_unlock(&jh_in->b_state_lock);
>
> - return do_escape | (done_copy_out << 1);
> + return do_escape;
> }
>
> /*
> --
> 2.30.0
>
--
Jan Kara <jack@suse.com>
SUSE Labs, CR
next prev parent reply other threads:[~2024-05-14 23:41 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-14 11:24 [PATCH v2 0/9] A fix and some cleanups to jbd2 Kemeng Shi
2024-05-14 11:24 ` [PATCH v2 1/9] jbd2: avoid memleak in jbd2_journal_write_metadata_buffer Kemeng Shi
2024-05-14 11:24 ` [PATCH v2 2/9] jbd2: remove unused return info from jbd2_journal_write_metadata_buffer Kemeng Shi
2024-05-14 13:53 ` Zhang Yi
2024-05-14 23:41 ` Jan Kara [this message]
2024-05-14 11:24 ` [PATCH v2 3/9] jbd2: remove unnedded "need_copy_out" in jbd2_journal_write_metadata_buffer Kemeng Shi
2024-05-14 11:24 ` [PATCH v2 4/9] jbd2: jump to new copy_done tag when b_frozen_data is created concurrently Kemeng Shi
2024-05-14 14:11 ` Zhang Yi
2024-05-14 23:42 ` Jan Kara
2024-05-14 11:24 ` [PATCH v2 5/9] jbd2: remove unneeded kmap to do escape in jbd2_journal_write_metadata_buffer Kemeng Shi
2024-05-14 11:24 ` [PATCH v2 6/9] jbd2: use bh_in instead of jh2bh(jh_in) to simplify code Kemeng Shi
2024-05-14 11:24 ` [PATCH v2 7/9] jbd2: remove dead equality check of j_commit_[sequence/request] in kjournald2 Kemeng Shi
2024-05-14 11:24 ` [PATCH v2 8/9] jbd2: remove dead check of JBD2_UNMOUNT " Kemeng Shi
2024-05-14 11:24 ` [PATCH v2 9/9] jbd2: remove unnecessary "should_sleep" " Kemeng Shi
2024-06-28 17:17 ` [PATCH v2 0/9] A fix and some cleanups to jbd2 Theodore Ts'o
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=20240514234101.2ke6hq4xwitwk7a5@quack3 \
--to=jack@suse.cz \
--cc=jack@suse.com \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=shikemeng@huaweicloud.com \
--cc=tytso@mit.edu \
--cc=yi.zhang@huaweicloud.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox