From: Ira Weiny <ira.weiny@intel.com>
To: "Matthew Wilcox (Oracle)" <willy@infradead.org>
Cc: <reiserfs-devel@vger.kernel.org>, Jan Kara <jack@suse.cz>,
<linux-fsdevel@vger.kernel.org>,
"Fabio M. De Francesco" <fmdefrancesco@gmail.com>
Subject: Re: [PATCH 5/8] reiserfs: Convert do_journal_end() to use kmap_local_folio()
Date: Sat, 17 Dec 2022 15:52:50 -0800 [thread overview]
Message-ID: <Y55WUrzblTsw6FfQ@iweiny-mobl> (raw)
In-Reply-To: <20221216205348.3781217-6-willy@infradead.org>
On Fri, Dec 16, 2022 at 08:53:44PM +0000, Matthew Wilcox (Oracle) wrote:
> Remove uses of kmap() and b_page. Also move the set_buffer_uptodate()
> call to after the memcpy() so that the memory barrier in
> set_buffer_uptodate() actually ensures that the old data can't be visible.
>
> Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
> ---
> fs/reiserfs/journal.c | 12 +++++-------
> 1 file changed, 5 insertions(+), 7 deletions(-)
>
> diff --git a/fs/reiserfs/journal.c b/fs/reiserfs/journal.c
> index 9ce4ec296b74..faf2f09d82e1 100644
> --- a/fs/reiserfs/journal.c
> +++ b/fs/reiserfs/journal.c
> @@ -4200,21 +4200,19 @@ static int do_journal_end(struct reiserfs_transaction_handle *th, int flags)
> /* copy all the real blocks into log area. dirty log blocks */
> if (buffer_journaled(cn->bh)) {
> struct buffer_head *tmp_bh;
> + size_t offset = offset_in_folio(cn->bh->b_folio,
> + cn->bh->b_data);
> char *addr;
> - struct page *page;
> tmp_bh =
> journal_getblk(sb,
> SB_ONDISK_JOURNAL_1st_BLOCK(sb) +
> ((cur_write_start +
> jindex) %
> SB_ONDISK_JOURNAL_SIZE(sb)));
> + addr = kmap_local_folio(cn->bh->b_folio, offset);
> + memcpy(tmp_bh->b_data, addr, cn->bh->b_size);
> + kunmap_local(addr);
I think we should have a memcpy_{to|from}_folio() like we do for the pages.
Did I miss this in the earlier patch?
Ira
> set_buffer_uptodate(tmp_bh);
> - page = cn->bh->b_page;
> - addr = kmap(page);
> - memcpy(tmp_bh->b_data,
> - addr + offset_in_page(cn->bh->b_data),
> - cn->bh->b_size);
> - kunmap(page);
> mark_buffer_dirty(tmp_bh);
> jindex++;
> set_buffer_journal_dirty(cn->bh);
> --
> 2.35.1
>
next prev parent reply other threads:[~2022-12-17 23:53 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-16 20:53 [PATCH 0/8] Convert reiserfs from b_page to b_folio Matthew Wilcox (Oracle)
2022-12-16 20:53 ` [PATCH 1/8] reiserfs: use b_folio instead of b_page in some obvious cases Matthew Wilcox (Oracle)
2022-12-16 20:53 ` [PATCH 2/8] reiserfs: use kmap_local_folio() in _get_block_create_0() Matthew Wilcox (Oracle)
2022-12-17 17:14 ` Ira Weiny
2022-12-17 19:07 ` Matthew Wilcox
2022-12-17 23:33 ` Ira Weiny
2022-12-19 10:42 ` Jan Kara
2022-12-16 20:53 ` [PATCH 3/8] reiserfs: Convert direct2indirect() to call folio_zero_range() Matthew Wilcox (Oracle)
2022-12-17 21:08 ` Ira Weiny
2022-12-16 20:53 ` [PATCH 4/8] reiserfs: Convert reiserfs_delete_item() to use kmap_local_folio() Matthew Wilcox (Oracle)
2022-12-17 23:44 ` Ira Weiny
2022-12-16 20:53 ` [PATCH 5/8] reiserfs: Convert do_journal_end() " Matthew Wilcox (Oracle)
2022-12-17 23:52 ` Ira Weiny [this message]
2022-12-20 9:35 ` Matthew Wilcox
2022-12-20 11:18 ` Jan Kara
2022-12-20 16:58 ` Ira Weiny
2022-12-20 18:34 ` Matthew Wilcox
2022-12-20 23:59 ` Ira Weiny
2022-12-21 19:04 ` Matthew Wilcox
2022-12-22 10:37 ` Jan Kara
2022-12-16 20:53 ` [PATCH 6/8] reiserfs: Convert map_block_for_writepage() " Matthew Wilcox (Oracle)
2022-12-18 0:02 ` Ira Weiny
2022-12-16 20:53 ` [PATCH 7/8] reiserfs: Convert convert_tail_for_hole() to use folios Matthew Wilcox (Oracle)
2022-12-16 20:53 ` [PATCH 8/8] reiserfs: Use flush_dcache_folio() in reiserfs_quota_write() Matthew Wilcox (Oracle)
2022-12-17 20:43 ` [PATCH 0/8] Convert reiserfs from b_page to b_folio Fabio M. De Francesco
2022-12-17 23:39 ` Ira Weiny
2022-12-18 8:09 ` Fabio M. De Francesco
2022-12-18 17:59 ` Matthew Wilcox
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=Y55WUrzblTsw6FfQ@iweiny-mobl \
--to=ira.weiny@intel.com \
--cc=fmdefrancesco@gmail.com \
--cc=jack@suse.cz \
--cc=linux-fsdevel@vger.kernel.org \
--cc=reiserfs-devel@vger.kernel.org \
--cc=willy@infradead.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox