Skip to content

Commit e00307e

Browse files
Matthew Wilcox (Oracle)Andreas Gruenbacher
authored andcommitted
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>
1 parent e6ff5f2 commit e00307e

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

fs/gfs2/lops.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -406,25 +406,25 @@ static void gfs2_end_log_read(struct bio *bio)
406406
}
407407

408408
/**
409-
* gfs2_jhead_pg_srch - Look for the journal head in a given page.
409+
* gfs2_jhead_folio_search - Look for the journal head in a given page.
410410
* @jd: The journal descriptor
411411
* @head: The journal head to start from
412-
* @page: The page to look in
412+
* @folio: The folio to look in
413413
*
414414
* Returns: 1 if found, 0 otherwise.
415415
*/
416-
417-
static bool gfs2_jhead_pg_srch(struct gfs2_jdesc *jd,
418-
struct gfs2_log_header_host *head,
419-
struct page *page)
416+
static bool gfs2_jhead_folio_search(struct gfs2_jdesc *jd,
417+
struct gfs2_log_header_host *head,
418+
struct folio *folio)
420419
{
421420
struct gfs2_sbd *sdp = GFS2_SB(jd->jd_inode);
422421
struct gfs2_log_header_host lh;
423422
void *kaddr;
424423
unsigned int offset;
425424
bool ret = false;
426425

427-
kaddr = kmap_local_page(page);
426+
VM_BUG_ON_FOLIO(folio_test_large(folio), folio);
427+
kaddr = kmap_local_folio(folio, 0);
428428
for (offset = 0; offset < PAGE_SIZE; offset += sdp->sd_sb.sb_bsize) {
429429
if (!__get_log_header(sdp, kaddr + offset, 0, &lh)) {
430430
if (lh.lh_sequence >= head->lh_sequence)
@@ -472,7 +472,7 @@ static void gfs2_jhead_process_page(struct gfs2_jdesc *jd, unsigned long index,
472472
*done = true;
473473

474474
if (!*done)
475-
*done = gfs2_jhead_pg_srch(jd, head, &folio->page);
475+
*done = gfs2_jhead_folio_search(jd, head, folio);
476476

477477
/* filemap_get_folio() and the earlier grab_cache_page() */
478478
folio_put_refs(folio, 2);

0 commit comments

Comments
 (0)