ceph: Use folio_invalidate()

Instead of calling ->invalidatepage directly, use folio_invalidate().
Signed-off-by: default avatarMatthew Wilcox (Oracle) <willy@infradead.org>
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 8e1dec8e
...@@ -516,6 +516,7 @@ static u64 get_writepages_data_length(struct inode *inode, ...@@ -516,6 +516,7 @@ static u64 get_writepages_data_length(struct inode *inode,
*/ */
static int writepage_nounlock(struct page *page, struct writeback_control *wbc) static int writepage_nounlock(struct page *page, struct writeback_control *wbc)
{ {
struct folio *folio = page_folio(page);
struct inode *inode = page->mapping->host; struct inode *inode = page->mapping->host;
struct ceph_inode_info *ci = ceph_inode(inode); struct ceph_inode_info *ci = ceph_inode(inode);
struct ceph_fs_client *fsc = ceph_inode_to_client(inode); struct ceph_fs_client *fsc = ceph_inode_to_client(inode);
...@@ -550,8 +551,9 @@ static int writepage_nounlock(struct page *page, struct writeback_control *wbc) ...@@ -550,8 +551,9 @@ static int writepage_nounlock(struct page *page, struct writeback_control *wbc)
/* is this a partial page at end of file? */ /* is this a partial page at end of file? */
if (page_off >= ceph_wbc.i_size) { if (page_off >= ceph_wbc.i_size) {
dout("%p page eof %llu\n", page, ceph_wbc.i_size); dout("folio at %lu beyond eof %llu\n", folio->index,
page->mapping->a_ops->invalidatepage(page, 0, thp_size(page)); ceph_wbc.i_size);
folio_invalidate(folio, 0, folio_size(folio));
return 0; return 0;
} }
...@@ -867,14 +869,16 @@ static int ceph_writepages_start(struct address_space *mapping, ...@@ -867,14 +869,16 @@ static int ceph_writepages_start(struct address_space *mapping,
continue; continue;
} }
if (page_offset(page) >= ceph_wbc.i_size) { if (page_offset(page) >= ceph_wbc.i_size) {
dout("%p page eof %llu\n", struct folio *folio = page_folio(page);
page, ceph_wbc.i_size);
dout("folio at %lu beyond eof %llu\n",
folio->index, ceph_wbc.i_size);
if ((ceph_wbc.size_stable || if ((ceph_wbc.size_stable ||
page_offset(page) >= i_size_read(inode)) && folio_pos(folio) >= i_size_read(inode)) &&
clear_page_dirty_for_io(page)) folio_clear_dirty_for_io(folio))
mapping->a_ops->invalidatepage(page, folio_invalidate(folio, 0,
0, thp_size(page)); folio_size(folio));
unlock_page(page); folio_unlock(folio);
continue; continue;
} }
if (strip_unit_end && (page->index > strip_unit_end)) { if (strip_unit_end && (page->index > strip_unit_end)) {
......
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