Re: [PATCH 26/56] gfs2: Convert invalidatepage to invalidate_folio

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2/9/22 3:21 PM, Matthew Wilcox (Oracle) wrote:
This is a straightforward conversion.

Signed-off-by: Matthew Wilcox (Oracle) <willy@xxxxxxxxxxxxx>
---
  fs/gfs2/aops.c | 23 ++++++++++++-----------
  1 file changed, 12 insertions(+), 11 deletions(-)

diff --git a/fs/gfs2/aops.c b/fs/gfs2/aops.c
index 3d54e6101ed1..119cb38d99a7 100644
--- a/fs/gfs2/aops.c
+++ b/fs/gfs2/aops.c
@@ -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,
The gfs2 portion looks okay.

Reviewed-by: Bob Peterson <rpeterso@xxxxxxxxxx>

Regards,

Bob Peterson




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux