Skip to content

Commit 3102932

Browse files
Matthew Wilcox (Oracle)akpm00
authored andcommitted
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. [[email protected]: fixed panic by using buffer_migrate_folio_norefs] Link: https://lkml.kernel.org/r/[email protected] Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Matthew Wilcox (Oracle) <[email protected]> Signed-off-by: Ryusuke Konishi <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent a6cb5b1 commit 3102932

File tree

1 file changed

+1
-32
lines changed

1 file changed

+1
-32
lines changed

fs/nilfs2/inode.c

Lines changed: 1 addition & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -170,37 +170,6 @@ static int nilfs_writepages(struct address_space *mapping,
170170
return err;
171171
}
172172

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-
204173
static bool nilfs_dirty_folio(struct address_space *mapping,
205174
struct folio *folio)
206175
{
@@ -295,7 +264,6 @@ nilfs_direct_IO(struct kiocb *iocb, struct iov_iter *iter)
295264
}
296265

297266
const struct address_space_operations nilfs_aops = {
298-
.writepage = nilfs_writepage,
299267
.read_folio = nilfs_read_folio,
300268
.writepages = nilfs_writepages,
301269
.dirty_folio = nilfs_dirty_folio,
@@ -304,6 +272,7 @@ const struct address_space_operations nilfs_aops = {
304272
.write_end = nilfs_write_end,
305273
.invalidate_folio = block_invalidate_folio,
306274
.direct_IO = nilfs_direct_IO,
275+
.migrate_folio = buffer_migrate_folio_norefs,
307276
.is_partially_uptodate = block_is_partially_uptodate,
308277
};
309278

0 commit comments

Comments
 (0)