fs: Turn block_invalidatepage into block_invalidate_folio

Remove special-casing of a NULL invalidatepage, since there is no
more block_invalidatepage.
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 d82354f6
...@@ -430,6 +430,7 @@ static int blkdev_writepages(struct address_space *mapping, ...@@ -430,6 +430,7 @@ static int blkdev_writepages(struct address_space *mapping,
const struct address_space_operations def_blk_aops = { const struct address_space_operations def_blk_aops = {
.set_page_dirty = __set_page_dirty_buffers, .set_page_dirty = __set_page_dirty_buffers,
.invalidate_folio = block_invalidate_folio,
.readpage = blkdev_readpage, .readpage = blkdev_readpage,
.readahead = blkdev_readahead, .readahead = blkdev_readahead,
.writepage = blkdev_writepage, .writepage = blkdev_writepage,
......
...@@ -74,6 +74,7 @@ static sector_t _adfs_bmap(struct address_space *mapping, sector_t block) ...@@ -74,6 +74,7 @@ static sector_t _adfs_bmap(struct address_space *mapping, sector_t block)
static const struct address_space_operations adfs_aops = { static const struct address_space_operations adfs_aops = {
.set_page_dirty = __set_page_dirty_buffers, .set_page_dirty = __set_page_dirty_buffers,
.invalidate_folio = block_invalidate_folio,
.readpage = adfs_readpage, .readpage = adfs_readpage,
.writepage = adfs_writepage, .writepage = adfs_writepage,
.write_begin = adfs_write_begin, .write_begin = adfs_write_begin,
......
...@@ -454,6 +454,7 @@ static sector_t _affs_bmap(struct address_space *mapping, sector_t block) ...@@ -454,6 +454,7 @@ static sector_t _affs_bmap(struct address_space *mapping, sector_t block)
const struct address_space_operations affs_aops = { const struct address_space_operations affs_aops = {
.set_page_dirty = __set_page_dirty_buffers, .set_page_dirty = __set_page_dirty_buffers,
.invalidate_folio = block_invalidate_folio,
.readpage = affs_readpage, .readpage = affs_readpage,
.writepage = affs_writepage, .writepage = affs_writepage,
.write_begin = affs_write_begin, .write_begin = affs_write_begin,
...@@ -835,6 +836,7 @@ static int affs_write_end_ofs(struct file *file, struct address_space *mapping, ...@@ -835,6 +836,7 @@ static int affs_write_end_ofs(struct file *file, struct address_space *mapping,
const struct address_space_operations affs_aops_ofs = { const struct address_space_operations affs_aops_ofs = {
.set_page_dirty = __set_page_dirty_buffers, .set_page_dirty = __set_page_dirty_buffers,
.invalidate_folio = block_invalidate_folio,
.readpage = affs_readpage_ofs, .readpage = affs_readpage_ofs,
//.writepage = affs_writepage_ofs, //.writepage = affs_writepage_ofs,
.write_begin = affs_write_begin_ofs, .write_begin = affs_write_begin_ofs,
......
...@@ -189,6 +189,7 @@ static sector_t bfs_bmap(struct address_space *mapping, sector_t block) ...@@ -189,6 +189,7 @@ static sector_t bfs_bmap(struct address_space *mapping, sector_t block)
const struct address_space_operations bfs_aops = { const struct address_space_operations bfs_aops = {
.set_page_dirty = __set_page_dirty_buffers, .set_page_dirty = __set_page_dirty_buffers,
.invalidate_folio = block_invalidate_folio,
.readpage = bfs_readpage, .readpage = bfs_readpage,
.writepage = bfs_writepage, .writepage = bfs_writepage,
.write_begin = bfs_write_begin, .write_begin = bfs_write_begin,
......
...@@ -1482,41 +1482,40 @@ static void discard_buffer(struct buffer_head * bh) ...@@ -1482,41 +1482,40 @@ static void discard_buffer(struct buffer_head * bh)
} }
/** /**
* block_invalidatepage - invalidate part or all of a buffer-backed page * block_invalidate_folio - Invalidate part or all of a buffer-backed folio.
* * @folio: The folio which is affected.
* @page: the page which is affected
* @offset: start of the range to invalidate * @offset: start of the range to invalidate
* @length: length of the range to invalidate * @length: length of the range to invalidate
* *
* block_invalidatepage() is called when all or part of the page has become * block_invalidate_folio() is called when all or part of the folio has been
* invalidated by a truncate operation. * invalidated by a truncate operation.
* *
* block_invalidatepage() does not have to release all buffers, but it must * block_invalidate_folio() does not have to release all buffers, but it must
* ensure that no dirty buffer is left outside @offset and that no I/O * ensure that no dirty buffer is left outside @offset and that no I/O
* is underway against any of the blocks which are outside the truncation * is underway against any of the blocks which are outside the truncation
* point. Because the caller is about to free (and possibly reuse) those * point. Because the caller is about to free (and possibly reuse) those
* blocks on-disk. * blocks on-disk.
*/ */
void block_invalidatepage(struct page *page, unsigned int offset, void block_invalidate_folio(struct folio *folio, size_t offset, size_t length)
unsigned int length)
{ {
struct buffer_head *head, *bh, *next; struct buffer_head *head, *bh, *next;
unsigned int curr_off = 0; size_t curr_off = 0;
unsigned int stop = length + offset; size_t stop = length + offset;
BUG_ON(!PageLocked(page)); BUG_ON(!folio_test_locked(folio));
if (!page_has_buffers(page))
goto out;
/* /*
* Check for overflow * Check for overflow
*/ */
BUG_ON(stop > PAGE_SIZE || stop < length); BUG_ON(stop > folio_size(folio) || stop < length);
head = folio_buffers(folio);
if (!head)
return;
head = page_buffers(page);
bh = head; bh = head;
do { do {
unsigned int next_off = curr_off + bh->b_size; size_t next_off = curr_off + bh->b_size;
next = bh->b_this_page; next = bh->b_this_page;
/* /*
...@@ -1535,16 +1534,16 @@ void block_invalidatepage(struct page *page, unsigned int offset, ...@@ -1535,16 +1534,16 @@ void block_invalidatepage(struct page *page, unsigned int offset,
} while (bh != head); } while (bh != head);
/* /*
* We release buffers only if the entire page is being invalidated. * We release buffers only if the entire folio is being invalidated.
* The get_block cached value has been unconditionally invalidated, * The get_block cached value has been unconditionally invalidated,
* so real IO is not possible anymore. * so real IO is not possible anymore.
*/ */
if (length == PAGE_SIZE) if (length == folio_size(folio))
try_to_release_page(page, 0); filemap_release_folio(folio, 0);
out: out:
return; return;
} }
EXPORT_SYMBOL(block_invalidatepage); EXPORT_SYMBOL(block_invalidate_folio);
/* /*
......
...@@ -546,6 +546,7 @@ const struct address_space_operations ecryptfs_aops = { ...@@ -546,6 +546,7 @@ const struct address_space_operations ecryptfs_aops = {
*/ */
#ifdef CONFIG_BLOCK #ifdef CONFIG_BLOCK
.set_page_dirty = __set_page_dirty_buffers, .set_page_dirty = __set_page_dirty_buffers,
.invalidate_folio = block_invalidate_folio,
#endif #endif
.writepage = ecryptfs_writepage, .writepage = ecryptfs_writepage,
.readpage = ecryptfs_readpage, .readpage = ecryptfs_readpage,
......
...@@ -491,6 +491,7 @@ int exfat_block_truncate_page(struct inode *inode, loff_t from) ...@@ -491,6 +491,7 @@ int exfat_block_truncate_page(struct inode *inode, loff_t from)
static const struct address_space_operations exfat_aops = { static const struct address_space_operations exfat_aops = {
.set_page_dirty = __set_page_dirty_buffers, .set_page_dirty = __set_page_dirty_buffers,
.invalidate_folio = block_invalidate_folio,
.readpage = exfat_readpage, .readpage = exfat_readpage,
.readahead = exfat_readahead, .readahead = exfat_readahead,
.writepage = exfat_writepage, .writepage = exfat_writepage,
......
...@@ -968,6 +968,7 @@ ext2_dax_writepages(struct address_space *mapping, struct writeback_control *wbc ...@@ -968,6 +968,7 @@ ext2_dax_writepages(struct address_space *mapping, struct writeback_control *wbc
const struct address_space_operations ext2_aops = { const struct address_space_operations ext2_aops = {
.set_page_dirty = __set_page_dirty_buffers, .set_page_dirty = __set_page_dirty_buffers,
.invalidate_folio = block_invalidate_folio,
.readpage = ext2_readpage, .readpage = ext2_readpage,
.readahead = ext2_readahead, .readahead = ext2_readahead,
.writepage = ext2_writepage, .writepage = ext2_writepage,
...@@ -983,6 +984,7 @@ const struct address_space_operations ext2_aops = { ...@@ -983,6 +984,7 @@ const struct address_space_operations ext2_aops = {
const struct address_space_operations ext2_nobh_aops = { const struct address_space_operations ext2_nobh_aops = {
.set_page_dirty = __set_page_dirty_buffers, .set_page_dirty = __set_page_dirty_buffers,
.invalidate_folio = block_invalidate_folio,
.readpage = ext2_readpage, .readpage = ext2_readpage,
.readahead = ext2_readahead, .readahead = ext2_readahead,
.writepage = ext2_nobh_writepage, .writepage = ext2_nobh_writepage,
......
...@@ -137,8 +137,6 @@ static inline int ext4_begin_ordered_truncate(struct inode *inode, ...@@ -137,8 +137,6 @@ static inline int ext4_begin_ordered_truncate(struct inode *inode,
new_size); new_size);
} }
static void ext4_invalidatepage(struct page *page, unsigned int offset,
unsigned int length);
static int __ext4_journalled_writepage(struct page *page, unsigned int len); static int __ext4_journalled_writepage(struct page *page, unsigned int len);
static int ext4_meta_trans_blocks(struct inode *inode, int lblocks, static int ext4_meta_trans_blocks(struct inode *inode, int lblocks,
int pextents); int pextents);
...@@ -1571,16 +1569,18 @@ static void mpage_release_unused_pages(struct mpage_da_data *mpd, ...@@ -1571,16 +1569,18 @@ static void mpage_release_unused_pages(struct mpage_da_data *mpd,
break; break;
for (i = 0; i < nr_pages; i++) { for (i = 0; i < nr_pages; i++) {
struct page *page = pvec.pages[i]; struct page *page = pvec.pages[i];
struct folio *folio = page_folio(page);
BUG_ON(!PageLocked(page)); BUG_ON(!folio_test_locked(folio));
BUG_ON(PageWriteback(page)); BUG_ON(folio_test_writeback(folio));
if (invalidate) { if (invalidate) {
if (page_mapped(page)) if (folio_mapped(folio))
clear_page_dirty_for_io(page); folio_clear_dirty_for_io(folio);
block_invalidatepage(page, 0, PAGE_SIZE); block_invalidate_folio(folio, 0,
ClearPageUptodate(page); folio_size(folio));
folio_clear_uptodate(folio);
} }
unlock_page(page); folio_unlock(folio);
} }
pagevec_release(&pvec); pagevec_release(&pvec);
} }
...@@ -3183,15 +3183,15 @@ static void ext4_readahead(struct readahead_control *rac) ...@@ -3183,15 +3183,15 @@ static void ext4_readahead(struct readahead_control *rac)
ext4_mpage_readpages(inode, rac, NULL); ext4_mpage_readpages(inode, rac, NULL);
} }
static void ext4_invalidatepage(struct page *page, unsigned int offset, static void ext4_invalidate_folio(struct folio *folio, size_t offset,
unsigned int length) size_t length)
{ {
trace_ext4_invalidatepage(page, offset, length); trace_ext4_invalidatepage(&folio->page, offset, length);
/* No journalling happens on data buffers when this function is used */ /* No journalling happens on data buffers when this function is used */
WARN_ON(page_has_buffers(page) && buffer_jbd(page_buffers(page))); WARN_ON(folio_buffers(folio) && buffer_jbd(folio_buffers(folio)));
block_invalidatepage(page, offset, length); block_invalidate_folio(folio, offset, length);
} }
static int __ext4_journalled_invalidatepage(struct page *page, static int __ext4_journalled_invalidatepage(struct page *page,
...@@ -3583,7 +3583,7 @@ static const struct address_space_operations ext4_aops = { ...@@ -3583,7 +3583,7 @@ static const struct address_space_operations ext4_aops = {
.write_end = ext4_write_end, .write_end = ext4_write_end,
.set_page_dirty = ext4_set_page_dirty, .set_page_dirty = ext4_set_page_dirty,
.bmap = ext4_bmap, .bmap = ext4_bmap,
.invalidatepage = ext4_invalidatepage, .invalidate_folio = ext4_invalidate_folio,
.releasepage = ext4_releasepage, .releasepage = ext4_releasepage,
.direct_IO = noop_direct_IO, .direct_IO = noop_direct_IO,
.migratepage = buffer_migrate_page, .migratepage = buffer_migrate_page,
...@@ -3618,7 +3618,7 @@ static const struct address_space_operations ext4_da_aops = { ...@@ -3618,7 +3618,7 @@ static const struct address_space_operations ext4_da_aops = {
.write_end = ext4_da_write_end, .write_end = ext4_da_write_end,
.set_page_dirty = ext4_set_page_dirty, .set_page_dirty = ext4_set_page_dirty,
.bmap = ext4_bmap, .bmap = ext4_bmap,
.invalidatepage = ext4_invalidatepage, .invalidate_folio = ext4_invalidate_folio,
.releasepage = ext4_releasepage, .releasepage = ext4_releasepage,
.direct_IO = noop_direct_IO, .direct_IO = noop_direct_IO,
.migratepage = buffer_migrate_page, .migratepage = buffer_migrate_page,
......
...@@ -343,6 +343,7 @@ int fat_block_truncate_page(struct inode *inode, loff_t from) ...@@ -343,6 +343,7 @@ int fat_block_truncate_page(struct inode *inode, loff_t from)
static const struct address_space_operations fat_aops = { static const struct address_space_operations fat_aops = {
.set_page_dirty = __set_page_dirty_buffers, .set_page_dirty = __set_page_dirty_buffers,
.invalidate_folio = block_invalidate_folio,
.readpage = fat_readpage, .readpage = fat_readpage,
.readahead = fat_readahead, .readahead = fat_readahead,
.writepage = fat_writepage, .writepage = fat_writepage,
......
...@@ -90,12 +90,14 @@ static int gfs2_aspace_writepage(struct page *page, struct writeback_control *wb ...@@ -90,12 +90,14 @@ static int gfs2_aspace_writepage(struct page *page, struct writeback_control *wb
const struct address_space_operations gfs2_meta_aops = { const struct address_space_operations gfs2_meta_aops = {
.set_page_dirty = __set_page_dirty_buffers, .set_page_dirty = __set_page_dirty_buffers,
.invalidate_folio = block_invalidate_folio,
.writepage = gfs2_aspace_writepage, .writepage = gfs2_aspace_writepage,
.releasepage = gfs2_releasepage, .releasepage = gfs2_releasepage,
}; };
const struct address_space_operations gfs2_rgrp_aops = { const struct address_space_operations gfs2_rgrp_aops = {
.set_page_dirty = __set_page_dirty_buffers, .set_page_dirty = __set_page_dirty_buffers,
.invalidate_folio = block_invalidate_folio,
.writepage = gfs2_aspace_writepage, .writepage = gfs2_aspace_writepage,
.releasepage = gfs2_releasepage, .releasepage = gfs2_releasepage,
}; };
......
...@@ -160,6 +160,7 @@ static int hfs_writepages(struct address_space *mapping, ...@@ -160,6 +160,7 @@ static int hfs_writepages(struct address_space *mapping,
const struct address_space_operations hfs_btree_aops = { const struct address_space_operations hfs_btree_aops = {
.set_page_dirty = __set_page_dirty_buffers, .set_page_dirty = __set_page_dirty_buffers,
.invalidate_folio = block_invalidate_folio,
.readpage = hfs_readpage, .readpage = hfs_readpage,
.writepage = hfs_writepage, .writepage = hfs_writepage,
.write_begin = hfs_write_begin, .write_begin = hfs_write_begin,
...@@ -170,6 +171,7 @@ const struct address_space_operations hfs_btree_aops = { ...@@ -170,6 +171,7 @@ const struct address_space_operations hfs_btree_aops = {
const struct address_space_operations hfs_aops = { const struct address_space_operations hfs_aops = {
.set_page_dirty = __set_page_dirty_buffers, .set_page_dirty = __set_page_dirty_buffers,
.invalidate_folio = block_invalidate_folio,
.readpage = hfs_readpage, .readpage = hfs_readpage,
.writepage = hfs_writepage, .writepage = hfs_writepage,
.write_begin = hfs_write_begin, .write_begin = hfs_write_begin,
......
...@@ -157,6 +157,7 @@ static int hfsplus_writepages(struct address_space *mapping, ...@@ -157,6 +157,7 @@ static int hfsplus_writepages(struct address_space *mapping,
const struct address_space_operations hfsplus_btree_aops = { const struct address_space_operations hfsplus_btree_aops = {
.set_page_dirty = __set_page_dirty_buffers, .set_page_dirty = __set_page_dirty_buffers,
.invalidate_folio = block_invalidate_folio,
.readpage = hfsplus_readpage, .readpage = hfsplus_readpage,
.writepage = hfsplus_writepage, .writepage = hfsplus_writepage,
.write_begin = hfsplus_write_begin, .write_begin = hfsplus_write_begin,
...@@ -167,6 +168,7 @@ const struct address_space_operations hfsplus_btree_aops = { ...@@ -167,6 +168,7 @@ const struct address_space_operations hfsplus_btree_aops = {
const struct address_space_operations hfsplus_aops = { const struct address_space_operations hfsplus_aops = {
.set_page_dirty = __set_page_dirty_buffers, .set_page_dirty = __set_page_dirty_buffers,
.invalidate_folio = block_invalidate_folio,
.readpage = hfsplus_readpage, .readpage = hfsplus_readpage,
.writepage = hfsplus_writepage, .writepage = hfsplus_writepage,
.write_begin = hfsplus_write_begin, .write_begin = hfsplus_write_begin,
......
...@@ -246,6 +246,7 @@ static int hpfs_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo, ...@@ -246,6 +246,7 @@ static int hpfs_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo,
const struct address_space_operations hpfs_aops = { const struct address_space_operations hpfs_aops = {
.set_page_dirty = __set_page_dirty_buffers, .set_page_dirty = __set_page_dirty_buffers,
.invalidate_folio = block_invalidate_folio,
.readpage = hpfs_readpage, .readpage = hpfs_readpage,
.writepage = hpfs_writepage, .writepage = hpfs_writepage,
.readahead = hpfs_readahead, .readahead = hpfs_readahead,
......
...@@ -358,6 +358,7 @@ static ssize_t jfs_direct_IO(struct kiocb *iocb, struct iov_iter *iter) ...@@ -358,6 +358,7 @@ static ssize_t jfs_direct_IO(struct kiocb *iocb, struct iov_iter *iter)
const struct address_space_operations jfs_aops = { const struct address_space_operations jfs_aops = {
.set_page_dirty = __set_page_dirty_buffers, .set_page_dirty = __set_page_dirty_buffers,
.invalidate_folio = block_invalidate_folio,
.readpage = jfs_readpage, .readpage = jfs_readpage,
.readahead = jfs_readahead, .readahead = jfs_readahead,
.writepage = jfs_writepage, .writepage = jfs_writepage,
......
...@@ -443,6 +443,7 @@ static sector_t minix_bmap(struct address_space *mapping, sector_t block) ...@@ -443,6 +443,7 @@ static sector_t minix_bmap(struct address_space *mapping, sector_t block)
static const struct address_space_operations minix_aops = { static const struct address_space_operations minix_aops = {
.set_page_dirty = __set_page_dirty_buffers, .set_page_dirty = __set_page_dirty_buffers,
.invalidate_folio = block_invalidate_folio,
.readpage = minix_readpage, .readpage = minix_readpage,
.writepage = minix_writepage, .writepage = minix_writepage,
.write_begin = minix_write_begin, .write_begin = minix_write_begin,
......
...@@ -304,7 +304,7 @@ const struct address_space_operations nilfs_aops = { ...@@ -304,7 +304,7 @@ const struct address_space_operations nilfs_aops = {
.write_begin = nilfs_write_begin, .write_begin = nilfs_write_begin,
.write_end = nilfs_write_end, .write_end = nilfs_write_end,
/* .releasepage = nilfs_releasepage, */ /* .releasepage = nilfs_releasepage, */
.invalidatepage = block_invalidatepage, .invalidate_folio = block_invalidate_folio,
.direct_IO = nilfs_direct_IO, .direct_IO = nilfs_direct_IO,
.is_partially_uptodate = block_is_partially_uptodate, .is_partially_uptodate = block_is_partially_uptodate,
}; };
......
...@@ -435,6 +435,7 @@ nilfs_mdt_write_page(struct page *page, struct writeback_control *wbc) ...@@ -435,6 +435,7 @@ nilfs_mdt_write_page(struct page *page, struct writeback_control *wbc)
static const struct address_space_operations def_mdt_aops = { static const struct address_space_operations def_mdt_aops = {
.set_page_dirty = __set_page_dirty_buffers, .set_page_dirty = __set_page_dirty_buffers,
.invalidate_folio = block_invalidate_folio,
.writepage = nilfs_mdt_write_page, .writepage = nilfs_mdt_write_page,
}; };
......
...@@ -1350,12 +1350,13 @@ static int ntfs_writepage(struct page *page, struct writeback_control *wbc) ...@@ -1350,12 +1350,13 @@ static int ntfs_writepage(struct page *page, struct writeback_control *wbc)
/* Is the page fully outside i_size? (truncate in progress) */ /* Is the page fully outside i_size? (truncate in progress) */
if (unlikely(page->index >= (i_size + PAGE_SIZE - 1) >> if (unlikely(page->index >= (i_size + PAGE_SIZE - 1) >>
PAGE_SHIFT)) { PAGE_SHIFT)) {
struct folio *folio = page_folio(page);
/* /*
* The page may have dirty, unmapped buffers. Make them * The page may have dirty, unmapped buffers. Make them
* freeable here, so the page does not leak. * freeable here, so the page does not leak.
*/ */
block_invalidatepage(page, 0, PAGE_SIZE); block_invalidate_folio(folio, 0, folio_size(folio));
unlock_page(page); folio_unlock(folio);
ntfs_debug("Write outside i_size - truncated?"); ntfs_debug("Write outside i_size - truncated?");
return 0; return 0;
} }
......
...@@ -2461,7 +2461,7 @@ const struct address_space_operations ocfs2_aops = { ...@@ -2461,7 +2461,7 @@ const struct address_space_operations ocfs2_aops = {
.write_end = ocfs2_write_end, .write_end = ocfs2_write_end,
.bmap = ocfs2_bmap, .bmap = ocfs2_bmap,
.direct_IO = ocfs2_direct_IO, .direct_IO = ocfs2_direct_IO,
.invalidatepage = block_invalidatepage, .invalidate_folio = block_invalidate_folio,
.releasepage = ocfs2_releasepage, .releasepage = ocfs2_releasepage,
.migratepage = buffer_migrate_page, .migratepage = buffer_migrate_page,
.is_partially_uptodate = block_is_partially_uptodate, .is_partially_uptodate = block_is_partially_uptodate,
......
...@@ -373,6 +373,7 @@ const struct inode_operations omfs_file_inops = { ...@@ -373,6 +373,7 @@ const struct inode_operations omfs_file_inops = {
const struct address_space_operations omfs_aops = { const struct address_space_operations omfs_aops = {
.set_page_dirty = __set_page_dirty_buffers, .set_page_dirty = __set_page_dirty_buffers,
.invalidate_folio = block_invalidate_folio,
.readpage = omfs_readpage, .readpage = omfs_readpage,
.readahead = omfs_readahead, .readahead = omfs_readahead,
.writepage = omfs_writepage, .writepage = omfs_writepage,
......
...@@ -496,6 +496,7 @@ static sector_t sysv_bmap(struct address_space *mapping, sector_t block) ...@@ -496,6 +496,7 @@ static sector_t sysv_bmap(struct address_space *mapping, sector_t block)
const struct address_space_operations sysv_aops = { const struct address_space_operations sysv_aops = {
.set_page_dirty = __set_page_dirty_buffers, .set_page_dirty = __set_page_dirty_buffers,
.invalidate_folio = block_invalidate_folio,
.readpage = sysv_readpage, .readpage = sysv_readpage,
.writepage = sysv_writepage, .writepage = sysv_writepage,
.write_begin = sysv_write_begin, .write_begin = sysv_write_begin,
......
...@@ -126,6 +126,7 @@ static int udf_adinicb_write_end(struct file *file, struct address_space *mappin ...@@ -126,6 +126,7 @@ static int udf_adinicb_write_end(struct file *file, struct address_space *mappin
const struct address_space_operations udf_adinicb_aops = { const struct address_space_operations udf_adinicb_aops = {
.set_page_dirty = __set_page_dirty_buffers, .set_page_dirty = __set_page_dirty_buffers,
.invalidate_folio = block_invalidate_folio,
.readpage = udf_adinicb_readpage, .readpage = udf_adinicb_readpage,
.writepage = udf_adinicb_writepage, .writepage = udf_adinicb_writepage,
.write_begin = udf_adinicb_write_begin, .write_begin = udf_adinicb_write_begin,
......
...@@ -236,6 +236,7 @@ static sector_t udf_bmap(struct address_space *mapping, sector_t block) ...@@ -236,6 +236,7 @@ static sector_t udf_bmap(struct address_space *mapping, sector_t block)
const struct address_space_operations udf_aops = { const struct address_space_operations udf_aops = {
.set_page_dirty = __set_page_dirty_buffers, .set_page_dirty = __set_page_dirty_buffers,
.invalidate_folio = block_invalidate_folio,
.readpage = udf_readpage, .readpage = udf_readpage,
.readahead = udf_readahead, .readahead = udf_readahead,
.writepage = udf_writepage, .writepage = udf_writepage,
......
...@@ -527,6 +527,7 @@ static sector_t ufs_bmap(struct address_space *mapping, sector_t block) ...@@ -527,6 +527,7 @@ static sector_t ufs_bmap(struct address_space *mapping, sector_t block)
const struct address_space_operations ufs_aops = { const struct address_space_operations ufs_aops = {
.set_page_dirty = __set_page_dirty_buffers, .set_page_dirty = __set_page_dirty_buffers,
.invalidate_folio = block_invalidate_folio,
.readpage = ufs_readpage, .readpage = ufs_readpage,
.writepage = ufs_writepage, .writepage = ufs_writepage,
.write_begin = ufs_write_begin, .write_begin = ufs_write_begin,
......
...@@ -217,8 +217,7 @@ extern int buffer_heads_over_limit; ...@@ -217,8 +217,7 @@ extern int buffer_heads_over_limit;
* Generic address_space_operations implementations for buffer_head-backed * Generic address_space_operations implementations for buffer_head-backed
* address_spaces. * address_spaces.
*/ */
void block_invalidatepage(struct page *page, unsigned int offset, void block_invalidate_folio(struct folio *folio, size_t offset, size_t length);
unsigned int length);
int block_write_full_page(struct page *page, get_block_t *get_block, int block_write_full_page(struct page *page, get_block_t *get_block,
struct writeback_control *wbc); struct writeback_control *wbc);
int __block_write_full_page(struct inode *inode, struct page *page, int __block_write_full_page(struct inode *inode, struct page *page,
......
...@@ -163,10 +163,6 @@ void folio_invalidate(struct folio *folio, size_t offset, size_t length) ...@@ -163,10 +163,6 @@ void folio_invalidate(struct folio *folio, size_t offset, size_t length)
} }
invalidatepage = aops->invalidatepage; invalidatepage = aops->invalidatepage;
#ifdef CONFIG_BLOCK
if (!invalidatepage)
invalidatepage = block_invalidatepage;
#endif
if (invalidatepage) if (invalidatepage)
(*invalidatepage)(&folio->page, offset, length); (*invalidatepage)(&folio->page, offset, length);
} }
......
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