public inbox for linux-ext4@vger.kernel.org
 help / color / mirror / Atom feed
From: Zhang Yi <yi.zhang@huaweicloud.com>
To: Kemeng Shi <shikemeng@huaweicloud.com>
Cc: linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org,
	tytso@mit.edu, jack@suse.com
Subject: Re: [PATCH 4/9] jbd2: move repeat tag around to remove a repeat check of b_frozen_data
Date: Tue, 7 May 2024 20:41:43 +0800	[thread overview]
Message-ID: <b2fa97c7-3f1c-321d-038e-7fb46420d24b@huaweicloud.com> (raw)
In-Reply-To: <20240506141801.1165315-5-shikemeng@huaweicloud.com>

On 2024/5/6 22:17, Kemeng Shi wrote:
> We make sure b_frozen_data is not NULL before jump to "repeat" tag, move
> "repeat" tag around to remove repeat check of b_frozen_data.
> 
> Signed-off-by: Kemeng Shi <shikemeng@huaweicloud.com>
> ---
>  fs/jbd2/journal.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/jbd2/journal.c b/fs/jbd2/journal.c
> index 9a35d0c5b38c..77fcdc76fdfd 100644
> --- a/fs/jbd2/journal.c
> +++ b/fs/jbd2/journal.c
> @@ -353,12 +353,12 @@ int jbd2_journal_write_metadata_buffer(transaction_t *transaction,
>  	atomic_set(&new_bh->b_count, 1);
>  
>  	spin_lock(&jh_in->b_state_lock);
> -repeat:
>  	/*
>  	 * If a new transaction has already done a buffer copy-out, then
>  	 * we use that version of the data for the commit.
>  	 */
>  	if (jh_in->b_frozen_data) {
> +repeat:
>  		done_copy_out = 1;
>  		new_folio = virt_to_folio(jh_in->b_frozen_data);
>  		new_offset = offset_in_folio(new_folio, jh_in->b_frozen_data);
> 

I suppose we could drop the repeat tag entirely, just set the new_folio and
new_offset, and then goto handle do_escape. We don't need to call
jbd2_buffer_frozen_trigger() and check for escaping again, is that right?

Thanks,
Yi.


  reply	other threads:[~2024-05-07 12:41 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-06 14:17 [PATCH 0/9] A fix and some cleanups to jbd2 Kemeng Shi
2024-05-06 14:17 ` [PATCH 1/9] jbd2: avoid memleak in jbd2_journal_write_metadata_buffer Kemeng Shi
2024-05-06 14:42   ` Zhang Yi
2024-05-12 10:09   ` Jan Kara
2024-05-06 14:17 ` [PATCH 2/9] jbd2: remove unused return info from jbd2_journal_write_metadata_buffer Kemeng Shi
2024-05-07 11:51   ` Zhang Yi
2024-05-08  1:42     ` Kemeng Shi
2024-05-12 10:14       ` Jan Kara
2024-05-06 14:17 ` [PATCH 3/9] jbd2: remove unnedded "need_copy_out" in jbd2_journal_write_metadata_buffer Kemeng Shi
2024-05-07 12:28   ` Zhang Yi
2024-05-12 11:06   ` Jan Kara
2024-05-06 14:17 ` [PATCH 4/9] jbd2: move repeat tag around to remove a repeat check of b_frozen_data Kemeng Shi
2024-05-07 12:41   ` Zhang Yi [this message]
2024-05-08  1:45     ` Kemeng Shi
2024-05-06 14:17 ` [PATCH 5/9] jbd2: remove unneeded kmap to do escape in jbd2_journal_write_metadata_buffer Kemeng Shi
2024-05-07 13:11   ` Zhang Yi
2024-05-12 11:13   ` Jan Kara
2024-05-06 14:17 ` [PATCH 6/9] jbd2: use bh_in instead of jh2bh(jh_in) to simplify code Kemeng Shi
2024-05-07 13:13   ` Zhang Yi
2024-05-12 11:14   ` Jan Kara
2024-05-06 14:17 ` [PATCH 7/9] jbd2: remove dead equality check of j_commit_[sequence/request] in kjournald2 Kemeng Shi
2024-05-09 11:51   ` Zhang Yi
2024-05-12 11:22   ` Jan Kara
2024-05-06 14:18 ` [PATCH 8/9] jbd2: remove dead check of JBD2_UNMOUNT " Kemeng Shi
2024-05-09 12:02   ` Zhang Yi
2024-05-12 11:24   ` Jan Kara
2024-05-06 14:18 ` [PATCH 9/9] jbd2: remove unnecessary "should_sleep" " Kemeng Shi
2024-05-09 12:09   ` Zhang Yi
2024-05-12 11:26   ` 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=b2fa97c7-3f1c-321d-038e-7fb46420d24b@huaweicloud.com \
    --to=yi.zhang@huaweicloud.com \
    --cc=jack@suse.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=shikemeng@huaweicloud.com \
    --cc=tytso@mit.edu \
    /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