* [PATCH] affs: Remove writepage implementation
@ 2023-07-14 18:34 Matthew Wilcox (Oracle)
2023-07-21 16:46 ` David Sterba
0 siblings, 1 reply; 2+ messages in thread
From: Matthew Wilcox (Oracle) @ 2023-07-14 18:34 UTC (permalink / raw)
To: David Sterba; +Cc: Matthew Wilcox (Oracle), linux-fsdevel, Christoph Hellwig
If the filesystem implements migrate_folio and writepages, there is
no need for a writepage implementation.
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
---
fs/affs/file.c | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/fs/affs/file.c b/fs/affs/file.c
index 705e227ff63d..aa38674d2978 100644
--- a/fs/affs/file.c
+++ b/fs/affs/file.c
@@ -15,6 +15,7 @@
#include <linux/uio.h>
#include <linux/blkdev.h>
+#include <linux/mpage.h>
#include "affs.h"
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
return -ENOSPC;
}
-static int affs_writepage(struct page *page, struct writeback_control *wbc)
+static int affs_writepages(struct address_space *mapping,
+ struct writeback_control *wbc)
{
- return block_write_full_page(page, affs_get_block, wbc);
+ return mpage_writepages(mapping, wbc, affs_get_block);
}
static int affs_read_folio(struct file *file, struct folio *folio)
@@ -456,10 +458,11 @@ const struct address_space_operations affs_aops = {
.dirty_folio = block_dirty_folio,
.invalidate_folio = block_invalidate_folio,
.read_folio = affs_read_folio,
- .writepage = affs_writepage,
+ .writepages = affs_writepages,
.write_begin = affs_write_begin,
.write_end = affs_write_end,
.direct_IO = affs_direct_IO,
+ .migrate_folio = buffer_migrate_folio,
.bmap = _affs_bmap
};
@@ -834,9 +837,10 @@ const struct address_space_operations affs_aops_ofs = {
.dirty_folio = block_dirty_folio,
.invalidate_folio = block_invalidate_folio,
.read_folio = affs_read_folio_ofs,
- //.writepage = affs_writepage_ofs,
+ //.writepages = affs_writepages_ofs,
.write_begin = affs_write_begin_ofs,
- .write_end = affs_write_end_ofs
+ .write_end = affs_write_end_ofs,
+ .migrate_folio = filemap_migrate_folio,
};
/* Free any preallocated blocks. */
--
2.39.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] affs: Remove writepage implementation
2023-07-14 18:34 [PATCH] affs: Remove writepage implementation Matthew Wilcox (Oracle)
@ 2023-07-21 16:46 ` David Sterba
0 siblings, 0 replies; 2+ messages in thread
From: David Sterba @ 2023-07-21 16:46 UTC (permalink / raw)
To: Matthew Wilcox (Oracle); +Cc: David Sterba, linux-fsdevel, Christoph Hellwig
On Fri, Jul 14, 2023 at 07:34:40PM +0100, Matthew Wilcox (Oracle) wrote:
> If the filesystem implements migrate_folio and writepages, there is
> no need for a writepage implementation.
>
> Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Added to my AFFS branch, thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-07-21 16:53 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-14 18:34 [PATCH] affs: Remove writepage implementation Matthew Wilcox (Oracle)
2023-07-21 16:46 ` David Sterba
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.