@@ -170,37 +170,6 @@ static int nilfs_writepages(struct address_space *mapping,
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
{
@@ -295,7 +264,6 @@ nilfs_direct_IO(struct kiocb *iocb, struct iov_iter *iter)
295
264
}
296
265
297
266
const struct address_space_operations nilfs_aops = {
298
- .writepage = nilfs_writepage ,
299
267
.read_folio = nilfs_read_folio ,
300
268
.writepages = nilfs_writepages ,
301
269
.dirty_folio = nilfs_dirty_folio ,
@@ -304,6 +272,7 @@ const struct address_space_operations nilfs_aops = {
304
272
.write_end = nilfs_write_end ,
305
273
.invalidate_folio = block_invalidate_folio ,
306
274
.direct_IO = nilfs_direct_IO ,
275
+ .migrate_folio = buffer_migrate_folio_norefs ,
307
276
.is_partially_uptodate = block_is_partially_uptodate ,
308
277
};
309
278
0 commit comments