mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-08 14:13:53 +00:00
ceph: Use folio_invalidate()
Instead of calling ->invalidatepage directly, use folio_invalidate(). Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org> 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
8e1dec8eb8
commit
a628304ebe
@ -516,6 +516,7 @@ static u64 get_writepages_data_length(struct inode *inode,
|
||||
*/
|
||||
static int writepage_nounlock(struct page *page, struct writeback_control *wbc)
|
||||
{
|
||||
struct folio *folio = page_folio(page);
|
||||
struct inode *inode = page->mapping->host;
|
||||
struct ceph_inode_info *ci = ceph_inode(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)
|
||||
|
||||
/* is this a partial page at end of file? */
|
||||
if (page_off >= ceph_wbc.i_size) {
|
||||
dout("%p page eof %llu\n", page, ceph_wbc.i_size);
|
||||
page->mapping->a_ops->invalidatepage(page, 0, thp_size(page));
|
||||
dout("folio at %lu beyond eof %llu\n", folio->index,
|
||||
ceph_wbc.i_size);
|
||||
folio_invalidate(folio, 0, folio_size(folio));
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -867,14 +869,16 @@ static int ceph_writepages_start(struct address_space *mapping,
|
||||
continue;
|
||||
}
|
||||
if (page_offset(page) >= ceph_wbc.i_size) {
|
||||
dout("%p page eof %llu\n",
|
||||
page, ceph_wbc.i_size);
|
||||
struct folio *folio = page_folio(page);
|
||||
|
||||
dout("folio at %lu beyond eof %llu\n",
|
||||
folio->index, ceph_wbc.i_size);
|
||||
if ((ceph_wbc.size_stable ||
|
||||
page_offset(page) >= i_size_read(inode)) &&
|
||||
clear_page_dirty_for_io(page))
|
||||
mapping->a_ops->invalidatepage(page,
|
||||
0, thp_size(page));
|
||||
unlock_page(page);
|
||||
folio_pos(folio) >= i_size_read(inode)) &&
|
||||
folio_clear_dirty_for_io(folio))
|
||||
folio_invalidate(folio, 0,
|
||||
folio_size(folio));
|
||||
folio_unlock(folio);
|
||||
continue;
|
||||
}
|
||||
if (strip_unit_end && (page->index > strip_unit_end)) {
|
||||
|
Loading…
Reference in New Issue
Block a user