mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-08 14:13:53 +00:00
gfs2: Convert invalidatepage to invalidate_folio
This is a straightforward conversion. Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org> Reviewed-by: Bob Peterson <rpeterso@redhat.com> Tested-by: Damien Le Moal <damien.lemoal@opensource.wdc.com> Acked-by: Damien Le Moal <damien.lemoal@opensource.wdc.com> Tested-by: Mike Marshall <hubcap@omnibond.com> # orangefs Tested-by: David Howells <dhowells@redhat.com> # afs
This commit is contained in:
parent
9150399673
commit
5f4b297684
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user