Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

nilfs2: remove nilfs_writepage

Since nilfs2 has a ->writepages operation already, ->writepage is only
called by the migration code. If we add a ->migrate_folio operation, it
won't even be used for that and so it can be deleted.

[konishi.ryusuke@gmail.com: fixed panic by using buffer_migrate_folio_norefs]
Link: https://lkml.kernel.org/r/20241002150036.1339475-2-willy@infradead.org
Link: https://lkml.kernel.org/r/20241024092602.13395-10-konishi.ryusuke@gmail.com
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Matthew Wilcox (Oracle) and committed by
Andrew Morton
31029320 a6cb5b1e

+1 -32
+1 -32
fs/nilfs2/inode.c
··· 170 170 return err; 171 171 } 172 172 173 - static int nilfs_writepage(struct page *page, struct writeback_control *wbc) 174 - { 175 - struct folio *folio = page_folio(page); 176 - struct inode *inode = folio->mapping->host; 177 - int err; 178 - 179 - if (sb_rdonly(inode->i_sb)) { 180 - /* 181 - * It means that filesystem was remounted in read-only 182 - * mode because of error or metadata corruption. But we 183 - * have dirty pages that try to be flushed in background. 184 - * So, here we simply discard this dirty page. 185 - */ 186 - nilfs_clear_folio_dirty(folio); 187 - folio_unlock(folio); 188 - return -EROFS; 189 - } 190 - 191 - folio_redirty_for_writepage(wbc, folio); 192 - folio_unlock(folio); 193 - 194 - if (wbc->sync_mode == WB_SYNC_ALL) { 195 - err = nilfs_construct_segment(inode->i_sb); 196 - if (unlikely(err)) 197 - return err; 198 - } else if (wbc->for_reclaim) 199 - nilfs_flush_segment(inode->i_sb, inode->i_ino); 200 - 201 - return 0; 202 - } 203 - 204 173 static bool nilfs_dirty_folio(struct address_space *mapping, 205 174 struct folio *folio) 206 175 { ··· 264 295 } 265 296 266 297 const struct address_space_operations nilfs_aops = { 267 - .writepage = nilfs_writepage, 268 298 .read_folio = nilfs_read_folio, 269 299 .writepages = nilfs_writepages, 270 300 .dirty_folio = nilfs_dirty_folio, ··· 272 304 .write_end = nilfs_write_end, 273 305 .invalidate_folio = block_invalidate_folio, 274 306 .direct_IO = nilfs_direct_IO, 307 + .migrate_folio = buffer_migrate_folio_norefs, 275 308 .is_partially_uptodate = block_is_partially_uptodate, 276 309 }; 277 310