This is a straightfoward conversion.
Unified · Split
| @@ -1287,25 +1287,25 @@ int ubifs_setattr(struct user_namespace *mnt_userns, struct dentry *dentry, · 1286 unmodified lines | ||
| 1287 | 1287 | return err; |
| 1288 | 1288 | } |
| 1289 | 1289 | |
| 1290 | −static void ubifs_invalidatepage(struct page *page, unsigned int offset, | |
| 1291 | − unsigned int length) | |
| 1290 | +static void ubifs_invalidate_folio(struct folio *folio, size_t offset, | |
| 1291 | + size_t length) | |
| 1292 | 1292 | { |
| 1293 | − struct inode *inode = page->mapping->host; | |
| 1293 | + struct inode *inode = folio->mapping->host; | |
| 1294 | 1294 | struct ubifs_info *c = inode->i_sb->s_fs_info; |
| 1295 | 1295 | |
| 1296 | − ubifs_assert(c, PagePrivate(page)); | |
| 1297 | − if (offset || length < PAGE_SIZE) | |
| 1298 | − /* Partial page remains dirty */ | |
| 1296 | + ubifs_assert(c, folio_test_private(folio)); | |
| 1297 | + if (offset || length < folio_size(folio)) | |
| 1298 | + /* Partial folio remains dirty */ | |
| 1299 | 1299 | return; |
| 1300 | 1300 | |
| 1301 | − if (PageChecked(page)) | |
| 1301 | + if (folio_test_checked(folio)) | |
| 1302 | 1302 | release_new_page_budget(c); |
| 1303 | 1303 | else |
| 1304 | 1304 | release_existing_page_budget(c); |
| 1305 | 1305 | |
| 1306 | 1306 | atomic_long_dec(&c->dirty_pg_cnt); |
| 1307 | − ClearPagePrivate(page); | |
| 1308 | − ClearPageChecked(page); | |
| 1307 | + folio_clear_private(folio); | |
| 1308 | + folio_clear_checked(folio); | |
| 1309 | 1309 | } |
| 1310 | 1310 | |
| 1311 | 1311 | int ubifs_fsync(struct file *file, loff_t start, loff_t end, int datasync) |
| @@ -1646,7 +1646,7 @@ const struct address_space_operations ubifs_file_address_operations = { · 334 unmodified lines | ||
| 1646 | 1646 | .writepage = ubifs_writepage, |
| 1647 | 1647 | .write_begin = ubifs_write_begin, |
| 1648 | 1648 | .write_end = ubifs_write_end, |
| 1649 | − .invalidatepage = ubifs_invalidatepage, | |
| 1649 | + .invalidate_folio = ubifs_invalidate_folio, | |
| 1650 | 1650 | .set_page_dirty = ubifs_set_page_dirty, |
| 1651 | 1651 | #ifdef CONFIG_MIGRATION |
| 1652 | 1652 | .migratepage = ubifs_migrate_page, |