]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
gfs2: Convert gfs2_jhead_pg_srch() to gfs2_jhead_folio_search()
authorMatthew Wilcox (Oracle) <willy@infradead.org>
Mon, 10 Feb 2025 13:34:43 +0000 (13:34 +0000)
committerAndreas Gruenbacher <agruenba@redhat.com>
Mon, 10 Mar 2025 17:15:39 +0000 (18:15 +0100)
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>
fs/gfs2/lops.c

index 4123bfc1668084803367b7a47cea524b59664499..f641ff837edce6574fb7957412ad6d5022b1512a 100644 (file)
@@ -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);