Skip to content

Commit e1c420a

Browse files
Matthew Wilcox (Oracle)Miklos Szeredi
authored andcommitted
fuse: Remove fuse_writepage
The writepage operation is deprecated as it leads to worse performance under high memory pressure due to folios being written out in LRU order rather than sequentially within a file. Use filemap_migrate_folio() to support dirty folio migration instead of writepage. Signed-off-by: "Matthew Wilcox (Oracle)" <[email protected]> Signed-off-by: Miklos Szeredi <[email protected]>
1 parent f9c2913 commit e1c420a

File tree

1 file changed

+1
-29
lines changed

1 file changed

+1
-29
lines changed

fs/fuse/file.c

Lines changed: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -2104,34 +2104,6 @@ static int fuse_writepage_locked(struct page *page)
21042104
return error;
21052105
}
21062106

2107-
static int fuse_writepage(struct page *page, struct writeback_control *wbc)
2108-
{
2109-
struct fuse_conn *fc = get_fuse_conn(page->mapping->host);
2110-
int err;
2111-
2112-
if (fuse_page_is_writeback(page->mapping->host, page->index)) {
2113-
/*
2114-
* ->writepages() should be called for sync() and friends. We
2115-
* should only get here on direct reclaim and then we are
2116-
* allowed to skip a page which is already in flight
2117-
*/
2118-
WARN_ON(wbc->sync_mode == WB_SYNC_ALL);
2119-
2120-
redirty_page_for_writepage(wbc, page);
2121-
unlock_page(page);
2122-
return 0;
2123-
}
2124-
2125-
if (wbc->sync_mode == WB_SYNC_NONE &&
2126-
fc->num_background >= fc->congestion_threshold)
2127-
return AOP_WRITEPAGE_ACTIVATE;
2128-
2129-
err = fuse_writepage_locked(page);
2130-
unlock_page(page);
2131-
2132-
return err;
2133-
}
2134-
21352107
struct fuse_fill_wb_data {
21362108
struct fuse_writepage_args *wpa;
21372109
struct fuse_file *ff;
@@ -3347,10 +3319,10 @@ static const struct file_operations fuse_file_operations = {
33473319
static const struct address_space_operations fuse_file_aops = {
33483320
.read_folio = fuse_read_folio,
33493321
.readahead = fuse_readahead,
3350-
.writepage = fuse_writepage,
33513322
.writepages = fuse_writepages,
33523323
.launder_folio = fuse_launder_folio,
33533324
.dirty_folio = filemap_dirty_folio,
3325+
.migrate_folio = filemap_migrate_folio,
33543326
.bmap = fuse_bmap,
33553327
.direct_IO = fuse_direct_IO,
33563328
.write_begin = fuse_write_begin,

0 commit comments

Comments
 (0)