From 41da6a72b45236ea1497d1a6d6363c55cdf1d491 Mon Sep 17 00:00:00 2001 From: "Ritesh Harjani (IBM)" Date: Thu, 7 Sep 2023 09:57:49 -0400 Subject: [PATCH] reiserfs: Switch to memcpy_from_folio() Use a modern API instead of open-coded calls to kmap/memcpy/kunmap. Also removes a call to offset_in_page() which assumes the buffer_head points into a single page. Signed-off-by: Ritesh Harjani (IBM) Signed-off-by: Matthew Wilcox (Oracle) --- fs/reiserfs/journal.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/fs/reiserfs/journal.c b/fs/reiserfs/journal.c index 015bfe4e45241..55a105e68c411 100644 --- a/fs/reiserfs/journal.c +++ b/fs/reiserfs/journal.c @@ -4205,8 +4205,6 @@ 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; - char *addr; - struct page *page; tmp_bh = journal_getblk(sb, SB_ONDISK_JOURNAL_1st_BLOCK(sb) + @@ -4214,12 +4212,8 @@ static int do_journal_end(struct reiserfs_transaction_handle *th, int flags) jindex) % SB_ONDISK_JOURNAL_SIZE(sb))); 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); + memcpy_from_folio(tmp_bh->b_data, cn->bh->b_folio, + bh_offset(cn->bh), cn->bh->b_size); mark_buffer_dirty(tmp_bh); jindex++; set_buffer_journal_dirty(cn->bh); -- 2.49.0