diff options
author | 2025-02-10 13:34:43 +0000 | |
---|---|---|
committer | 2025-03-10 18:15:39 +0100 | |
commit | e00307e8d4b2853ffd7835d4fdb7d6d8c696d189 (patch) | |
tree | 9bb30d8a666e0ada6a01d86bb0e6d0d56be76733 | |
parent | gfs2: Use b_folio in gfs2_check_magic() (diff) | |
download | wireguard-linux-e00307e8d4b2853ffd7835d4fdb7d6d8c696d189.tar.xz wireguard-linux-e00307e8d4b2853ffd7835d4fdb7d6d8c696d189.zip |
gfs2: Convert gfs2_jhead_pg_srch() to gfs2_jhead_folio_search()
Pass in the folio instead of the page. Add an assert that this is
not a large folio as we'd need a more complex solution if we wanted to
kmap() each page out of a large folio. Removes a use of folio->page.
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
[agruenba@redhat.com: Rename gfs2_jhead_folio_srch() to gfs2_jhead_folio_search().]
Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Diffstat (limited to '')
-rw-r--r-- | fs/gfs2/lops.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/fs/gfs2/lops.c b/fs/gfs2/lops.c index 4123bfc16680..f641ff837edc 100644 --- a/fs/gfs2/lops.c +++ b/fs/gfs2/lops.c @@ -406,17 +406,16 @@ static void gfs2_end_log_read(struct bio *bio) } /** - * gfs2_jhead_pg_srch - Look for the journal head in a given page. + * gfs2_jhead_folio_search - Look for the journal head in a given page. * @jd: The journal descriptor * @head: The journal head to start from - * @page: The page to look in + * @folio: The folio to look in * * Returns: 1 if found, 0 otherwise. */ - -static bool gfs2_jhead_pg_srch(struct gfs2_jdesc *jd, - struct gfs2_log_header_host *head, - struct page *page) +static bool gfs2_jhead_folio_search(struct gfs2_jdesc *jd, + struct gfs2_log_header_host *head, + struct folio *folio) { struct gfs2_sbd *sdp = GFS2_SB(jd->jd_inode); struct gfs2_log_header_host lh; @@ -424,7 +423,8 @@ static bool gfs2_jhead_pg_srch(struct gfs2_jdesc *jd, unsigned int offset; bool ret = false; - kaddr = kmap_local_page(page); + VM_BUG_ON_FOLIO(folio_test_large(folio), folio); + kaddr = kmap_local_folio(folio, 0); for (offset = 0; offset < PAGE_SIZE; offset += sdp->sd_sb.sb_bsize) { if (!__get_log_header(sdp, kaddr + offset, 0, &lh)) { if (lh.lh_sequence >= head->lh_sequence) @@ -472,7 +472,7 @@ static void gfs2_jhead_process_page(struct gfs2_jdesc *jd, unsigned long index, *done = true; if (!*done) - *done = gfs2_jhead_pg_srch(jd, head, &folio->page); + *done = gfs2_jhead_folio_search(jd, head, folio); /* filemap_get_folio() and the earlier grab_cache_page() */ folio_put_refs(folio, 2); |