gfs2: Convert invalidatepage to invalidate_folio

This is a straightforward conversion.
Signed-off-by: default avatarMatthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: default avatarBob Peterson <rpeterso@redhat.com>
Tested-by: default avatarDamien Le Moal <damien.lemoal@opensource.wdc.com>
Acked-by: default avatarDamien Le Moal <damien.lemoal@opensource.wdc.com>
Tested-by: Mike Marshall <hubcap@omnibond.com> # orangefs
Tested-by: David Howells <dhowells@redhat.com> # afs
parent 91503996
......@@ -672,22 +672,23 @@ static void gfs2_discard(struct gfs2_sbd *sdp, struct buffer_head *bh)
unlock_buffer(bh);
}
static void gfs2_invalidatepage(struct page *page, unsigned int offset,
unsigned int length)
static void gfs2_invalidate_folio(struct folio *folio, size_t offset,
size_t length)
{
struct gfs2_sbd *sdp = GFS2_SB(page->mapping->host);
unsigned int stop = offset + length;
int partial_page = (offset || length < PAGE_SIZE);
struct gfs2_sbd *sdp = GFS2_SB(folio->mapping->host);
size_t stop = offset + length;
int partial_page = (offset || length < folio_size(folio));
struct buffer_head *bh, *head;
unsigned long pos = 0;
BUG_ON(!PageLocked(page));
BUG_ON(!folio_test_locked(folio));
if (!partial_page)
ClearPageChecked(page);
if (!page_has_buffers(page))
folio_clear_checked(folio);
head = folio_buffers(folio);
if (!head)
goto out;
bh = head = page_buffers(page);
bh = head;
do {
if (pos + bh->b_size > stop)
return;
......@@ -699,7 +700,7 @@ static void gfs2_invalidatepage(struct page *page, unsigned int offset,
} while (bh != head);
out:
if (!partial_page)
try_to_release_page(page, 0);
filemap_release_folio(folio, 0);
}
/**
......@@ -796,7 +797,7 @@ static const struct address_space_operations gfs2_jdata_aops = {
.readahead = gfs2_readahead,
.set_page_dirty = jdata_set_page_dirty,
.bmap = gfs2_bmap,
.invalidatepage = gfs2_invalidatepage,
.invalidate_folio = gfs2_invalidate_folio,
.releasepage = gfs2_releasepage,
.is_partially_uptodate = block_is_partially_uptodate,
.error_remove_page = generic_error_remove_page,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment