Skip to content

Commit a3bf4c3

Browse files
Matthew Wilcox (Oracle)kdave
authored andcommitted
affs: remove writepage implementation
If the filesystem implements migrate_folio and writepages, there is no need for a writepage implementation. Signed-off-by: Matthew Wilcox (Oracle) <[email protected]> Reviewed-by: David Sterba <[email protected]> Signed-off-by: David Sterba <[email protected]>
1 parent 706a741 commit a3bf4c3

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

fs/affs/file.c

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
#include <linux/uio.h>
1717
#include <linux/blkdev.h>
18+
#include <linux/mpage.h>
1819
#include "affs.h"
1920

2021
static struct buffer_head *affs_get_extblock_slow(struct inode *inode, u32 ext);
@@ -370,9 +371,10 @@ affs_get_block(struct inode *inode, sector_t block, struct buffer_head *bh_resul
370371
return -ENOSPC;
371372
}
372373

373-
static int affs_writepage(struct page *page, struct writeback_control *wbc)
374+
static int affs_writepages(struct address_space *mapping,
375+
struct writeback_control *wbc)
374376
{
375-
return block_write_full_page(page, affs_get_block, wbc);
377+
return mpage_writepages(mapping, wbc, affs_get_block);
376378
}
377379

378380
static int affs_read_folio(struct file *file, struct folio *folio)
@@ -456,10 +458,11 @@ const struct address_space_operations affs_aops = {
456458
.dirty_folio = block_dirty_folio,
457459
.invalidate_folio = block_invalidate_folio,
458460
.read_folio = affs_read_folio,
459-
.writepage = affs_writepage,
461+
.writepages = affs_writepages,
460462
.write_begin = affs_write_begin,
461463
.write_end = affs_write_end,
462464
.direct_IO = affs_direct_IO,
465+
.migrate_folio = buffer_migrate_folio,
463466
.bmap = _affs_bmap
464467
};
465468

@@ -835,9 +838,10 @@ const struct address_space_operations affs_aops_ofs = {
835838
.dirty_folio = block_dirty_folio,
836839
.invalidate_folio = block_invalidate_folio,
837840
.read_folio = affs_read_folio_ofs,
838-
//.writepage = affs_writepage_ofs,
841+
//.writepages = affs_writepages_ofs,
839842
.write_begin = affs_write_begin_ofs,
840-
.write_end = affs_write_end_ofs
843+
.write_end = affs_write_end_ofs,
844+
.migrate_folio = filemap_migrate_folio,
841845
};
842846

843847
/* Free any preallocated blocks. */

0 commit comments

Comments
 (0)