Skip to content

Commit

Permalink
afs: Don't implement writepage
Browse files Browse the repository at this point in the history
Remove afs_writepage(), thereby allowing future removal of a lot of the
stuff in fs/afs/write.c once write_iter and writepages are delegated to
netfslib.

To quote from commit 21b4ee7:

    ->writepage is only used in one place - single page writeback from
    memory reclaim. We only allow such writeback from kswapd, not from
    direct memory reclaim, and so it is rarely used. When it comes from
    kswapd, it is effectively random dirty page shoot-down, which is
    horrible for IO patterns. We will already have background writeback
    trying to clean all the dirty pages in memory as efficiently as
    possible, so having kswapd interrupt our well formed IO stream only
    slows things down. So get rid of xfs_vm_writepage() completely.

Signed-off-by: David Howells <dhowells@redhat.com>
  • Loading branch information
dhowells committed Jun 9, 2022
1 parent 8175808 commit 2a9c241
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 30 deletions.
1 change: 0 additions & 1 deletion fs/afs/file.c
Expand Up @@ -56,7 +56,6 @@ const struct address_space_operations afs_file_aops = {
.invalidate_folio = netfs_invalidate_folio,
.write_begin = afs_write_begin,
.write_end = afs_write_end,
.writepage = afs_writepage,
.writepages = afs_writepages,
};

Expand Down
1 change: 0 additions & 1 deletion fs/afs/internal.h
Expand Up @@ -1535,7 +1535,6 @@ extern int afs_write_begin(struct file *file, struct address_space *mapping,
extern int afs_write_end(struct file *file, struct address_space *mapping,
loff_t pos, unsigned len, unsigned copied,
struct page *page, void *fsdata);
extern int afs_writepage(struct page *, struct writeback_control *);
extern int afs_writepages(struct address_space *, struct writeback_control *);
extern ssize_t afs_file_write(struct kiocb *, struct iov_iter *);
extern int afs_fsync(struct file *, loff_t, loff_t, int);
Expand Down
28 changes: 0 additions & 28 deletions fs/afs/write.c
Expand Up @@ -663,34 +663,6 @@ static ssize_t afs_write_back_from_locked_folio(struct address_space *mapping,
return ret;
}

/*
* write a page back to the server
* - the caller locked the page for us
*/
int afs_writepage(struct page *subpage, struct writeback_control *wbc)
{
struct folio *folio = page_folio(subpage);
ssize_t ret;
loff_t start;

_enter("{%lx},", folio_index(folio));

#ifdef CONFIG_AFS_FSCACHE
folio_wait_fscache(folio);
#endif

start = folio_index(folio) * PAGE_SIZE;
ret = afs_write_back_from_locked_folio(folio_mapping(folio), wbc,
folio, start, LLONG_MAX - start);
if (ret < 0) {
_leave(" = %zd", ret);
return ret;
}

_leave(" = 0");
return 0;
}

/*
* write a region of pages back to the server
*/
Expand Down

0 comments on commit 2a9c241

Please sign in to comment.